β οΈ Disclaimer: This guide is for educational and personal learning purposes only. It is not intended for business or commercial use.
Connect Google Cloud to n8n once and reuse the credential across Google Sheets, Gmail, Drive, and more. The process is slightly involved β but this guide breaks it down into clear, numbered steps.
| Phase | Steps | What You'll Do |
|---|---|---|
| Google Cloud | 1β18 | Create a project and configure OAuth |
| n8n | 19β21 | Create the credential and grab the redirect URL |
| Back to Google Cloud | 22β23 | Add redirect URLs and generate Client ID & Secret |
| Finish in n8n | 24β32 | Paste credentials, add test users, and connect |
Search "Google Cloud Console" in your browser.
Click on the official Google Cloud Console link from the search results.
Click the project selector dropdown at the top of the page.
Click "New Project" from the project selector panel.
Enter any name you like for your project.
Hit the Create button to finish creating your project.
Open the project selector again and select the project you just created.
Click the three-line (hamburger) icon in the upper-left corner.
Navigate to APIs & Services β OAuth consent screen.
Click the button to begin setting up the consent screen.
Fill in the required fields:
- App name:
n8n - Support email: your personal Gmail address (recommended)
Choose External so you can authorize your own Google account to use the app.
Enter an email address for developer contact. You can reuse the same address from Step 11. Multiple emails are allowed.
Check the checkbox to agree to Google's API terms.
Click Submit to save your consent screen configuration.
You'll land on this confirmation screen:
Click "Create OAuth Client" to proceed.
From the Application type dropdown, select Web application.
Enter any name you like (e.g. n8n OAuth Client). Don't click Create yet β you need the redirect URL from n8n first.
Log into n8n, go to Credentials, and click "Create credential".
Type "Google OAuth2 API" in the search bar and select it.
You'll see this page β pay close attention here, this is where most people get confused:
There are 3 important fields on this screen:
| Field | What It Is |
|---|---|
| Redirect URL | Auto-generated by n8n. Format: https://yourdomain.com/rest/oauth2-credential/callback |
| Client ID | Generated in Google Cloud after creating the OAuth client |
| Client Secret | Generated in Google Cloud after creating the OAuth client |
Back in Google Cloud, scroll to Authorized redirect URIs and fill in two boxes:
- Box 1 (Authorized JavaScript origins): paste only the domain part β
https://yourdomain.comorhttps://yourdomain.com:PORTif a port is shown in your n8n redirect URL - Box 2 (Authorized redirect URIs): paste the full redirect URL from n8n exactly as shown
π‘ Note:
example.comis used as a placeholder. Replace it with your actual n8n domain. Be careful not to include/rest/oauth2-credential/callbackin Box 1.
Click Create to generate your Client ID and Client Secret. Save both β you'll need them in the next step.
Go back to n8n and paste your Client ID and Client Secret into their respective fields.
Back in Google Cloud, click on the "Audience" tab.
Scroll down and click "Add users".
Add the Gmail accounts you'll use to access Google services through n8n. You can add up to 100 accounts. All addresses must end in @gmail.com.
Type each email, press Enter, then click Save.
If your email appears in the list, it was saved successfully β
Enter the API scope URL for the Google service you want to connect. Common examples:
https://mail.google.com/
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/spreadsheets
https://www.googleapis.com
Sign in using the Gmail account you added as a test user in Step 27.
Back in n8n, scroll down and click "Sign in with Google".
N.B. The acount that you will use to sign into n8n must remain signed in your device. If it is not, then you have to first sign in the acoount into your device first.
You may see a warning screen. This is expected for apps in testing mode β just click "Continue".
When prompted, check "Select all" to grant the necessary permissions, then continue.
Once you sign in, n8n will automatically test the connection. A successful test means your Google credential is live and ready to use.
π Note: This guide uses Gmail as the example, but the exact same steps apply to Google Sheets, Drive, Calendar, and all other Google services.
You only need to do this once. After that, you can reuse this credential across all your n8n workflows.
Got stuck? Open a GitHub Discussion β I'll do my best to help.
If this guide saved you time, please give it a β to help others find it!
Built by Jawad Β· Educational use only Β· Open source