How to get a Google API key (OAuth) for n8n

Last updated: June 10, 2026 ~10 min n8n setup guide

Connecting Gmail, Google Sheets, or Google Calendar to an n8n automation is the step that trips most people up — not because it's hard, but because Google's setup has a few moving parts that have to line up exactly. This guide walks the whole path and calls out the three things that cause 90% of the errors.

Quick clarification: for these Google nodes, n8n doesn't use a simple "API key" string. It uses OAuth2 — a Client ID and Client Secret you create, plus a one-time sign-in with your Google account. Same outcome ("connect Google"), slightly different mechanics.
Video walkthrough coming soon — watch on YouTube
The short version
  1. In Google Cloud Console, create a project
  2. Enable the API you need (Gmail / Sheets / Calendar)
  3. Configure the OAuth consent screen and add yourself as a Test user
  4. Create an OAuth client ID (type: Web application)
  5. Paste n8n's redirect URL into the client, then copy the Client ID + Secret into n8n and sign in

1. Create a Google Cloud project

Go to console.cloud.google.com and sign in with the Google account that owns the Gmail/Sheets/Calendar you want to automate. At the top, open the project dropdown and click New Project. Name it something like n8n-automations and create it. Make sure that new project is selected for the next steps.

2. Enable the API you need

Go to APIs & Services → Library and enable the specific API that matches your n8n node:

Search for it, click it, and press Enable. If your workflow touches more than one (e.g. Gmail and Sheets), enable each one. Forgetting this is a common cause of "API has not been used / is disabled" errors later.

3. Configure the OAuth consent screen

Go to APIs & Services → OAuth consent screen (Google sometimes labels parts of this "Branding" and "Audience"). Choose External as the user type, then fill in the basics: an app name, your support email, and a developer contact email. You can skip the optional fields.

Gotcha #1 — Test users. While the app is in Testing mode (the normal state for a private automation), only accounts you list as Test users can authorize it. Add the Google account you'll connect with as a Test user. Skip this and sign-in fails with "access blocked / app not verified."

4. Create the OAuth client ID

Go to APIs & Services → Credentials → Create Credentials → OAuth client ID. For Application type, choose Web application and give it a name (e.g. n8n). Don't close this screen yet — you'll add the redirect URL in the next step.

5. Match the redirect URL between n8n and Google

This is the step that connects the two systems, and it has to match exactly.

  1. In n8n, start a new credential for your node — e.g. Gmail OAuth2 API (or Google Sheets OAuth2 API, etc.). n8n will display an OAuth Redirect URL. Copy it.
  2. Back in Google Cloud, paste that URL into the Authorized redirect URIs field of your OAuth client, then save.
  3. Google now shows your Client ID and Client Secret. Copy both.
Gotcha #2 — exact match. The redirect URL in Google must be character-for-character identical to the one n8n shows. A mismatch (extra slash, http vs https, wrong domain) gives a redirect_uri_mismatch error. Copy-paste it; don't type it.

6. Finish the connection in n8n

  1. Paste the Client ID and Client Secret into the n8n credential.
  2. Click Sign in with Google and choose the account you added as a Test user.
  3. You'll likely see "Google hasn't verified this app." That's expected for a private app — click AdvancedGo to (your app) → allow the requested permissions.
  4. n8n confirms the account is connected. Open your node, run Test step, and you should see live data.
Gotcha #3 — scopes. n8n requests exactly the permissions (scopes) the node needs during that sign-in — read/send mail for Gmail, read/write rows for Sheets, and so on. Approve them on the consent screen. If you later add a node that needs more access, you may need to re-connect so the new scope is granted.

Official reference

Google reorganizes the Cloud Console fairly often, so if a screen looks different, trust the source: Google's Cloud Console and n8n's own Google OAuth2 credential docs, which list the exact steps per node.

FAQ

I get "access blocked / app not verified." What's wrong?

While your app is in Testing mode, only listed Test users can sign in. Add your Google account as a Test user on the OAuth consent screen, then retry. The "hasn't verified this app" warning itself is normal for a private app — click Advanced and continue.

I get redirect_uri_mismatch.

The redirect URL in your Google OAuth client doesn't exactly match the one n8n shows. Copy n8n's OAuth Redirect URL and paste it into Authorized redirect URIs — no typos, no extra characters.

Do I need an "API key" or OAuth?

For Gmail, Sheets, and Calendar nodes, n8n uses OAuth2 — a Client ID and Secret, not a plain API key string. You create an OAuth client and sign in with your Google account.

Want us to set it up for you?

We build AI lead-gen and CRM automations in n8n — and handle the Google wiring, scopes, and credentials so you don't have to.

Book a Free Strategy Call

← Back to all guides