Skip to content

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

  1. Add a Google Drive node to workflow
  2. Under Credentials, click Create new credential
  3. You'll need Client ID and Client Secret from Google Cloud

Google Cloud Console Configuration

Step 1: Access Google Cloud Console

  1. Navigate to console.cloud.google.com
  2. Sign in with your Google account
  3. Note: Page appearance varies based on prior Google Cloud usage

Step 2: Create a New Project

  1. Click the project selector (top left corner)
  2. Click New Project
  3. Enter project name (e.g., "n8n Demo KK")
  4. Set Location to "No organization"
  5. Click Create
  6. Wait for creation, then click Select Project
  1. Navigate to APIs and ServicesOAuth consent screen
  2. Click Get Started
  3. Fill in App Information:
  4. App name: Same as project (e.g., "n8n Demo KK")
  5. User support email: Select your email
  6. Select Audience:
  7. Internal: Only for Google Workspace accounts
  8. External: For personal Gmail accounts (most common)
  9. Add contact information email
  10. Click Next → agree to terms → ContinueCreate

Step 4: Create OAuth Client

  1. Click Create OAuth Client
  2. Application type: Web application
  3. Name: Same as project (e.g., "n8n Demo KK")
  4. Add Authorized redirect URI:
  5. Copy from n8n credential setup screen
  6. Paste into Google Cloud Console
  7. Click Create

Step 5: Copy Credentials

  1. Copy Client ID
  2. Go back to n8n, paste into Client ID field
  3. Copy Client Secret from Google Cloud
  4. Paste into n8n Client Secret field

Additional Configuration Steps

Add Authorized Domain

  1. In Google Cloud Console, go to Branding
  2. Scroll to Authorized domains
  3. Add: n8n.cloud
  4. Click Save

Enable Required APIs

  1. Search for the API you need (e.g., "Google Drive API")
  2. Click on the API
  3. Click Enable

Repeat for each Google service: - Google Drive API - Google Sheets API - Gmail API - Google Docs API

Publish the App

  1. Go to Audience section
  2. Click Publish App
  3. Confirm publication

Completing the Connection

Sign In with Google

  1. Return to n8n workflow
  2. Click Sign in with Google
  3. Select your Google account
  4. See "Google hasn't verified this app" warning
  5. Click AdvancedGo to [app name]
  6. Grant all requested permissions
  7. Click Continue
  8. See "Connection successful" message

Testing the Google Drive Connection

  1. Select operation (e.g., "Watch for file created")
  2. Choose folder to watch from dropdown
  3. Click Fetch test event
  4. Upload a file to the selected Drive folder
  5. Return to n8n and re-run test
  6. File data appears in node output

Extending to Other Google Services

For additional Google nodes (Sheets, Docs, etc.):

  1. Enable the specific API:
  2. Go to Google Cloud Console
  3. Search for the API (e.g., "Google Sheets API")
  4. Click Enable

  5. Use the same OAuth credentials:

  6. No need to create new OAuth client
  7. Same credentials work for all Google services

  8. Connect in n8n:

  9. Select the Google node
  10. Choose existing Google credentials
  11. 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

  1. One setup covers all Google services: OAuth configuration done once enables Drive, Sheets, Docs, and Gmail.

  2. Project structure is required: Google uses projects to organize OAuth access and API permissions.

  3. External vs Internal matters: Choose External for personal Gmail accounts, Internal for Google Workspace.

  4. Each API must be enabled: Even with OAuth configured, individual APIs need explicit enabling.

  5. Authorized domain is critical: Add n8n.cloud to authorized domains for cloud-based n8n.

  6. Redirect URI must match exactly: Copy from n8n, paste into Google Cloud Console precisely.

  7. Test users required for External apps: Add your email to test users before testing.

  8. Publishing enables broader access: Publish the app to move beyond test user limitations.

  9. Verification warnings are normal: Self-created apps trigger warnings but are safe to use.

  10. 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.