# n8n Gmail Setup: How to Connect Gmail With Google OAuth *How-to — 2026-10-10 — by Mahmoud Zalt* Connect Gmail to n8n: enable the API in Google Cloud, build the OAuth client, paste the redirect URL, and avoid the testing-mode expiry trap. **Short answer.** **Connecting Gmail to n8n means building your own OAuth client in Google Cloud, not just clicking a connect button.** You create a Google Cloud project, enable the Gmail API, configure the OAuth consent screen, create a Web application OAuth client ID, paste n8n's OAuth Redirect URL into the Authorized redirect URIs field, then copy the Client ID and Client Secret back into n8n and sign in with Google. **About this guide.** This guide is based on publicly available information and n8n's own documentation, checked on 17 August 2026. Sistava is not affiliated with n8n. Interfaces and pricing change often, so confirm the current steps in their documentation before you rely on them. Gmail is the connection people expect to take two minutes and it usually takes forty. Not because n8n makes it hard, but because Google requires you to stand up your own OAuth application before it will hand any tool access to a mailbox. So the work happens in two browser tabs. Google Cloud Console is where the OAuth client is born, and n8n is where the credential lives. One value travels from n8n to Google, two values travel back, and the whole thing works or fails on whether those match exactly. Everything below follows the procedure n8n publishes for Google credentials. ## What can the n8n Gmail node actually do? It covers four resources, and knowing which one you need saves you configuring the wrong operation. n8n's Gmail node documentation lists Draft, Label, Message and Thread, each with its own set of operations. - **Message. **Add Label, Delete, Get, Get Many, Mark as Read, Mark as Unread, Remove Label, Reply and Send. This is the resource most workflows want. - **Thread. **Add Label, Delete, Get, Get Many, Remove Label, Reply, Trash and Untrash. Use this when the conversation matters, not the single message. - **Draft. **Create, Delete, Get and Get Many. The safest way to automate outbound mail while a human still approves it. - **Label. **Create, Delete, Get and Get Many, for workflows that sort a mailbox rather than write to it. There is also a separate Gmail trigger node, documented on its own page, for workflows that need to start when mail arrives rather than on a schedule. And the Gmail node can be attached to an agent as a tool, where n8n's documentation notes many parameters can be set automatically, or with information directed by AI. ## What do you set up in Google Cloud first? A project, the Gmail API enabled inside it, and a configured OAuth consent screen. n8n's Google credential documentation walks all three, and none can be skipped: Google will not issue a client ID for an API you have not enabled, and it will not complete a sign-in without a consent screen. One detail catches people out on the consent screen. Under Branding you add an authorized domain, and n8n's documentation says cloud users add n8n.cloud while self-hosted users add their own instance domain. Get that wrong and the sign-in fails at the last step with a message that does not obviously point back here. ### Connecting Gmail to n8n, end to end 1. **Create the Google Cloud project** — In Google Cloud Console, choose New project from the top navigation dropdown, give it a name and location, then Create. Confirm the new project is the one selected in the dropdown. 2. **Enable the Gmail API** — Go to APIs & Services, then Library, search for the Gmail API and select ENABLE. n8n's documentation notes that Docs, Sheets and Slides additionally need the Google Drive API, so enable everything your workflow will touch. 3. **Configure the OAuth consent screen** — Under APIs & Services, open OAuth consent screen and select Get started. Enter an App name and User support email, choose Internal or External as the audience, add contact emails, and accept Google's User Data Policy. 4. **Add the authorized domain** — Still on the consent screen, under Branding, add the authorized domain. n8n cloud users add n8n.cloud. Self-hosted users add the domain their own instance runs on. Save. 5. **Create the OAuth client ID** — Go to APIs & Services, then Credentials, select + Create credentials and then OAuth client ID. Choose Web application as the application type and give it a recognisable name. 6. **Paste the redirect URL** — Copy the OAuth Redirect URL shown in your n8n credential panel and paste it into Authorized redirect URIs in Google, then select Create. 7. **Copy the two values back into n8n** — From Google's OAuth client created dialog, copy the Client ID and the Client Secret into the matching fields on the n8n credential. 8. **Sign in and save** — Select Sign in with Google on the n8n credential, complete the Google flow, and save. n8n tests a credential when you save it, so a clean save is real feedback. ## Where does the OAuth redirect URL come from? From n8n, not from you. The credential panel in n8n displays an OAuth Redirect URL, and your only job is to copy it into Google's Authorized redirect URIs field without editing it. It is the address Google sends the browser back to once the user approves access. For a self-hosted instance you are still developing on, n8n's documentation says localhost redirects are acceptable, giving the example http://localhost:5678/rest/oauth2-credential/callback. That is convenient, and it is also the reason the credential breaks the day you move the instance to a real domain: the redirect URL changes and Google no longer recognises it. **Redirect URI mismatch is almost always literal.** When Google rejects the sign-in, the cause is usually a character rather than a concept: a trailing slash, http where the instance now serves https, or a domain that moved. Open the n8n credential, copy the URL again, and replace what is in Google rather than comparing them by eye. ## Why does the Gmail connection stop working after a week? Because the app is still in testing. n8n's Google credential documentation states that External apps in Testing mode expire after seven days, and you reconnect to refresh. If your Gmail workflow works beautifully and then dies the following Tuesday, this is the first thing to check. The related trap is access denied on the very first sign-in. For an app in External and Testing mode, n8n's documentation says you add the email addresses of the accounts you will use under Test users on the OAuth consent screen. An account that is not listed there cannot complete the flow, no matter how correct everything else is. Neither of these is an n8n behaviour. They are Google's rules for OAuth applications, and every tool that connects to Gmail this way inherits them. It is worth understanding once, because the same knowledge applies to Sheets, Drive, Calendar and anything else in the Google estate. Set-up work like this is exactly what we removed at Sistava. Rather than standing up an OAuth application, minding a consent screen and re-authorising it every week while you are still testing, you hire an AI Employee and tell it in plain English what you want handled. It has the tools connected already, it asks you when it is unsure, and there is no client secret for you to look after. ## What if the Gmail operation you need is missing? Use the HTTP Request node with the same credential. n8n's Gmail node documentation says that for operations the node does not support natively, you can call the Gmail API directly from the HTTP Request node using the Gmail credentials you already created. That is a genuinely good design decision on n8n's part, and it is the escape hatch worth remembering across their whole integration library. You are never limited to the operations someone chose to wrap, only to what the underlying API allows and what your OAuth scopes cover. **Lock down what a credential can reach.** n8n's credential documentation describes an Allowed HTTP Request Domains field that controls which domains a credential can be used against in HTTP Request nodes, with options for All, Specific Domains as a comma-separated list, or None to block it from HTTP Request use entirely. If a credential only ever needs to talk to Google, say so, and one careless workflow can no longer send it somewhere else. ## What else is worth knowing about n8n credentials? - **n8n tests a credential when you save it. **A save that goes through is a working connection, not just a stored form. - **Default names are unhelpful fast. **Credentials are named after the node by default, so rename them the moment you have two Gmail accounts in play. - **You can create a credential without a node. **n8n documents a Create button in the side menu and on the Overview page for making a credential first and picking the service it belongs to. - **Credentials can be set with expressions. **Toggling Expression on lets you choose a credential dynamically from workflow data, which is powerful and worth using carefully. - **Per-user OAuth credentials are an enterprise feature. **n8n documents fixed credentials as the default, with end-user credentials that resolve per person available on their Cloud Enterprise and self-hosted Enterprise versions. Take the naming point seriously if you automate mail for more than one inbox. A shared workspace where three credentials are all called after the same node is how a workflow ends up sending from the wrong address, and that particular mistake is visible to your customers. If the destination you had in mind was simply that email gets handled, rather than that a mail integration exists, that is the question Sistava answers. You hire an AI Employee for the role, it reads and drafts with access you grant and can revoke, and you correct it in plain English rather than reconfiguring a node. ## FAQ ### Do I need a Google Cloud project to connect Gmail to n8n? The path n8n documents for Google credentials has you create a Google Cloud project, enable the API you need, configure the OAuth consent screen, and create a Web application OAuth client ID. You then copy the Client ID and Client Secret into n8n and paste n8n's OAuth Redirect URL into Google's Authorized redirect URIs field. ### Why does n8n say redirect URI mismatch when I sign in with Google? The URL in Google's Authorized redirect URIs does not exactly match the OAuth Redirect URL shown in your n8n credential. Copy the value from n8n again and paste it over what is in Google rather than comparing them visually. This commonly breaks when a self-hosted instance moves from localhost to a real domain, or from http to https. ### Why did my Gmail credential stop working after seven days? n8n's Google credential documentation states that External apps left in Testing mode expire after seven days and need reconnecting to refresh. If the workflow ran fine and then failed about a week later, check the publishing status of your OAuth consent screen in Google Cloud Console. ### What can the n8n Gmail node do? n8n documents four resources. Message supports Add Label, Delete, Get, Get Many, Mark as Read, Mark as Unread, Remove Label, Reply and Send. Thread supports Add Label, Delete, Get, Get Many, Remove Label, Reply, Trash and Untrash. Draft supports Create, Delete, Get and Get Many. Label supports Create, Delete, Get and Get Many. ### Can n8n trigger a workflow when a new email arrives? Yes. n8n's Gmail node page references a separate Gmail trigger node, documented on its own page, for starting a workflow from mailbox activity rather than on a schedule. Check that page for the events it supports in your version. ### What if the Gmail action I need is not in the node? n8n's documentation points you at the HTTP Request node, which can call the Gmail API directly using the same Gmail credentials you already created. That covers operations the node does not wrap natively, within whatever your OAuth scopes permit. ## Sources - [n8n documentation, ](https://docs.n8n.io/integrations/builtin/credentials/google/oauth-single-service.md)Google OAuth2 single service credentials - [n8n documentation, ](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.gmail.md)Gmail node - [n8n documentation, ](https://docs.n8n.io/build/understand-workflows/create-and-edit-credentials.md)Create and edit credentials - [n8n documentation, ](https://docs.n8n.io/build-your-first-workflow.md)Build your first workflow - [n8n documentation, ](https://docs.n8n.io/sitemap.md)Documentation index **Tags:** n8n, gmail, oauth, google-cloud, workflow-automation