Chapter 7: Google Drive/Sheets/Docs Authentication Setup via Google Cloud¶
Video: Watch this chapter on YouTube (56:15)
Overview¶
This chapter provides a comprehensive walkthrough for connecting Google services (Drive, Sheets, Docs, Gmail) to n8n through Google Cloud Console OAuth configuration. Once set up, this authentication works across all Google nodes in n8n.
Detailed Summary¶
Why Google Cloud Console Setup?¶
Google nodes in n8n (Drive, Sheets, Docs, Gmail) all require OAuth authentication. Setting this up once enables access to all Google services, making subsequent integrations simple API enabling exercises.
Starting Point: Google Drive Node¶
The tutorial uses Google Drive as the example, but the process applies to all Google services.
Initial Node Setup¶
- Add a Google Drive node to workflow
- Under Credentials, click Create new credential
- You'll need Client ID and Client Secret from Google Cloud
Google Cloud Console Configuration¶
Step 1: Access Google Cloud Console¶
- Navigate to
console.cloud.google.com - Sign in with your Google account
- Note: Page appearance varies based on prior Google Cloud usage
Step 2: Create a New Project¶
- Click the project selector (top left corner)
- Click New Project
- Enter project name (e.g., "n8n Demo KK")
- Set Location to "No organization"
- Click Create
- Wait for creation, then click Select Project
Step 3: Configure OAuth Consent Screen¶
- Navigate to APIs and Services → OAuth consent screen
- Click Get Started
- Fill in App Information:
- App name: Same as project (e.g., "n8n Demo KK")
- User support email: Select your email
- Select Audience:
- Internal: Only for Google Workspace accounts
- External: For personal Gmail accounts (most common)
- Add contact information email
- Click Next → agree to terms → Continue → Create
Step 4: Create OAuth Client¶
- Click Create OAuth Client
- Application type: Web application
- Name: Same as project (e.g., "n8n Demo KK")
- Add Authorized redirect URI:
- Copy from n8n credential setup screen
- Paste into Google Cloud Console
- Click Create
Step 5: Copy Credentials¶
- Copy Client ID
- Go back to n8n, paste into Client ID field
- Copy Client Secret from Google Cloud
- Paste into n8n Client Secret field
Additional Configuration Steps¶
Add Authorized Domain¶
- In Google Cloud Console, go to Branding
- Scroll to Authorized domains
- Add:
n8n.cloud - Click Save
Enable Required APIs¶
- Search for the API you need (e.g., "Google Drive API")
- Click on the API
- Click Enable
Repeat for each Google service: - Google Drive API - Google Sheets API - Gmail API - Google Docs API
Publish the App¶
- Go to Audience section
- Click Publish App
- Confirm publication
Completing the Connection¶
Sign In with Google¶
- Return to n8n workflow
- Click Sign in with Google
- Select your Google account
- See "Google hasn't verified this app" warning
- Click Advanced → Go to [app name]
- Grant all requested permissions
- Click Continue
- See "Connection successful" message
Testing the Google Drive Connection¶
- Select operation (e.g., "Watch for file created")
- Choose folder to watch from dropdown
- Click Fetch test event
- Upload a file to the selected Drive folder
- Return to n8n and re-run test
- File data appears in node output
Extending to Other Google Services¶
For additional Google nodes (Sheets, Docs, etc.):
- Enable the specific API:
- Go to Google Cloud Console
- Search for the API (e.g., "Google Sheets API")
-
Click Enable
-
Use the same OAuth credentials:
- No need to create new OAuth client
-
Same credentials work for all Google services
-
Connect in n8n:
- Select the Google node
- Choose existing Google credentials
- Connection works immediately
Important Notes¶
Credential Reuse¶
- One OAuth client works for all Google services
- Just enable additional APIs as needed
- Same redirect URI handles all services
External vs Internal Apps¶
- External: Requires test user configuration, app verification for production
- Internal: Google Workspace only, no verification needed
Security Warnings¶
- "Google hasn't verified this app" is normal for personal projects
- Safe to proceed since you created the app
- Production apps should go through Google's verification process
Troubleshooting Common Issues¶
| Issue | Solution |
|---|---|
| Redirect URI mismatch | Copy exact URI from n8n |
| API not enabled | Enable specific API in Cloud Console |
| Permission denied | Add email as test user |
| App not published | Publish app in Audience settings |
| Connection failed | Check all steps completed |
Key Takeaways¶
-
One setup covers all Google services: OAuth configuration done once enables Drive, Sheets, Docs, and Gmail.
-
Project structure is required: Google uses projects to organize OAuth access and API permissions.
-
External vs Internal matters: Choose External for personal Gmail accounts, Internal for Google Workspace.
-
Each API must be enabled: Even with OAuth configured, individual APIs need explicit enabling.
-
Authorized domain is critical: Add
n8n.cloudto authorized domains for cloud-based n8n. -
Redirect URI must match exactly: Copy from n8n, paste into Google Cloud Console precisely.
-
Test users required for External apps: Add your email to test users before testing.
-
Publishing enables broader access: Publish the app to move beyond test user limitations.
-
Verification warnings are normal: Self-created apps trigger warnings but are safe to use.
-
Credentials are reusable: Same OAuth credentials work across multiple workflows and nodes.
Conclusion¶
Setting up Google OAuth through Google Cloud Console is a foundational skill for n8n automation. While the process involves multiple steps, it only needs to be done once—after which all Google services become accessible through simple API enabling. This configuration unlocks powerful integrations with Google Drive for file management, Google Sheets for data storage, Gmail for email automation, and Google Docs for document handling. Understanding this process is particularly valuable because it mirrors enterprise OAuth configurations, preparing learners for professional deployment scenarios where manual OAuth setup is standard practice.