Setting Up Google OAuth2 Credentials in n8n
Google Drive, Gmail & Google Calendar
This guide walks you through creating Google OAuth2 credentials for Google Drive, Gmail, and Google Calendar in n8n. One Google Cloud project and one set of OAuth credentials covers all three services.
Official Reference: n8n Docs — Google OAuth2 Single Service
Prerequisites
- A Google Cloud account
- Access to your n8n instance (self-hosted or cloud)
Overview
There are five steps to connecting your n8n credential to Google services:
- Create a Google Cloud Console project
- Enable APIs
- Configure your OAuth consent screen
- Create your Google OAuth client credentials
- Finish your n8n credential
Step 1: Create a Google Cloud Console Project
If you already have a project, skip to Step 2.
- Log in to your Google Cloud Console using your Google credentials.
- In the top menu, select the project dropdown in the top navigation and select New project, or go directly to the New Project page.
- Enter a Project name (e.g.
n8n Integrations) and select the Location for your project. - Select Create.
- Check the top navigation and make sure the project dropdown has your new project selected. If not, select the project you just created.

Step 2: Enable APIs
With your project created, enable the APIs you need for Google Drive, Gmail, and Google Calendar.
- Access your Google Cloud Console — Library. Make sure you’re in the correct project.

Go to APIs & Services → Library.
Search for and enable each of the following APIs (click into each one and hit Enable):
| n8n Node | API to Enable |
|—|—|
| Google Drive | Google Drive API |
| Gmail | Gmail API |
| Google Calendar | Google Calendar API |
- Select ENABLE for each API.
Step 3: Configure Your OAuth Consent Screen
If you haven’t used OAuth in your Google Cloud project before, you’ll need to configure the OAuth consent screen.
- Access your Google Cloud Console. Make sure you’re in the correct project.
- Open the left navigation menu and go to APIs & Services → OAuth consent screen.
- Google will redirect you to the Google Auth Platform overview page. Select Get started on the Overview tab to begin configuring OAuth consent.
App Information
- Enter an App name (e.g.
n8n) and User support email to include on the OAuth screen. - Select Next to continue.
Audience
- Select the audience type:
- Internal — for user access within your organization’s Google Workspace only
- External — for any user with a Google account
- Internal — for user access within your organization’s Google Workspace only
Refer to Google’s User type documentation for more information on user types.
- Select Next to continue.
Contact Information
- Select the Email addresses Google should use to contact you about changes to your project.
- Select Next to continue.
Agreement
- Read and accept Google’s User Data Policy.
- Select Continue and then select Create.
Add Authorized Domains
- In the left-hand menu, select Branding.
- In the Authorized domains section, select Add domain:
- If you’re using n8n Cloud: add
n8n.cloud - If you’re self-hosting: add the domain of your n8n instance (e.g.
yourdomain.com)
- If you’re using n8n Cloud: add
- Select Save at the bottom of the page.
Step 4: Create Your Google OAuth Client Credentials
Next, create the OAuth client credentials in Google.
- Access your Google Cloud Console.
- In the APIs & Services section, select Credentials.
- Select + Create Credentials → OAuth client ID.
- In the Application type dropdown, select Web application.
- Google automatically generates a Name. Update the name to something recognizable (e.g.
n8n OAuth Client).
Set the Redirect URI
If you’re self-hosting:
- From your n8n credential, copy the OAuth Redirect URL.
- Paste it into the Authorized redirect URIs in Google Console.
- The URL format is typically:
https://<your-n8n-domain>/rest/oauth2-credential/callback
- From your n8n credential, copy the OAuth Redirect URL.
If you’re using n8n Cloud:
- You can leave this field empty as the OAuth setup is pre-configured and the callback URL is fixed.
- You can leave this field empty as the OAuth setup is pre-configured and the callback URL is fixed.
Select Create.
You’ll see a modal with your Client ID and Client Secret — copy both and keep them safe.
Step 5: Finish Your n8n Credential
With the Google project and credentials fully configured, finish setting up your credentials in n8n. You’ll create three separate credentials — one for each service — but they all use the same Client ID and Client Secret.
Google Drive Credential
- In n8n, go to Credentials → Add Credential → Google Drive OAuth2 API.
- If self-hosted:
- Paste the Client ID from the Google OAuth client modal.
- Paste the Client Secret from the same modal.
- Paste the Client ID from the Google OAuth client modal.
- Select Sign in with Google to complete authentication.
- Choose your Google account, click through any “unverified app” warning (see Troubleshooting below), and grant access.
- Save the credential.
Gmail Credential
- In n8n, go to Credentials → Add Credential → Gmail OAuth2 API.
- Paste the same Client ID and Client Secret.
- Select Sign in with Google → authorize → Save.
Google Calendar Credential
- In n8n, go to Credentials → Add Credential → Google Calendar OAuth2 API.
- Paste the same Client ID and Client Secret.
- Select Sign in with Google → authorize → Save.
Troubleshooting
“Google hasn’t verified this app”
If using the OAuth authentication method, you might see the warning “Google hasn’t verified this app”. To handle this:
- If your app User Type is Internal: create OAuth credentials from the same account you want to authenticate.
- If your app User Type is External: add your email to the list of testers for the app:
- Go to the Audience page in Google Cloud Console.
- Add the email you’re signing in with to the list of Test users.
- Go to the Audience page in Google Cloud Console.
- When you see the warning screen, click Advanced → Go to app name to proceed.
Refer to Google Cloud documentation: Authorization errors for more details.
Google Cloud App Becoming Unauthorized (Token Expiry)
For Google Cloud apps with:
- Publishing status set to Testing
- User type set to External
Consent and tokens expire after seven days.
To prevent this from happening:
- Go to APIs & Services → OAuth consent screen in Google Cloud Console.
- Click Publish App to move the app out of Testing mode.
- You do not need to go through Google’s full verification process for your own personal use — just publishing it removes the 7-day token expiry.
To resolve expired tokens, reconnect the app in the n8n credentials modal by editing the credential and clicking Sign in with Google again.
URL Mismatch Errors
If you see an error indicating that you can’t sign in because the app doesn’t meet Google’s expectations:
- The actual cause is usually that the URLs don’t match between Google’s OAuth configuration and n8n.
- Review any links included in Google’s error message for details.
- If self-hosting, verify that the
N8N_EDITOR_BASE_URLandWEBHOOK_URLenvironment variables use fully qualified domains.
Quick Reference
| What | Where |
|---|---|
| Google Cloud Console | console.cloud.google.com |
| API Library | console.cloud.google.com/apis/library |
| OAuth Consent Screen | APIs & Services → OAuth consent screen |
| Credentials | APIs & Services → Credentials |
| n8n Docs (full reference) | Google OAuth2 Single Service |
Video Walkthrough
n8n provides a video walkthrough of this process on the official docs page.