Home › Blog › n8n Google Credentials Expire Every 7 Days: Why It Happens and How to Fix It

n8n Google Credentials Expire Every 7 Days: Why It Happens and How to Fix It

By Auroxa Tech · Updated · 9 min read

n8n Google Credentials Expire Every 7 Days?

If n8n’s Gmail, Google Sheets or Drive nodes fail with “invalid_grant: Token has been expired or revoked” a week after connecting, the cause is almost always Google’s Testing status: External OAuth apps get refresh tokens that expire after seven days. Set the app’s publishing status to In production, reconnect once, and add an error workflow for the next failure.

Why your Google credential stops working after a week

The pattern is easy to spot on the n8n Community. In a January 2026 thread, a self-hosted user’s YouTube, Drive and Sheets workflow kept failing with “invalid_grant” and “Token has been expired or revoked,” and had to be signed in again by hand each time. In an April 2025 thread, another user had already switched the app to production and still saw the same error (both community reports). The workflow logic is fine. The credential behind it stopped working.

Google documents the reason. Its OAuth 2.0 overview says a Google Cloud project with an External user type and a publishing status of “Testing” is issued a refresh token that expires in 7 days, unless the app asks only for basic sign-in scopes (email, profile, openid). Gmail, Sheets and Drive scopes are not on that short list, so every n8n credential for them expires a week after you click Sign in with Google. Google’s Manage App Audience help page repeats it: authorizations by a test user “expire seven days from the time of consent.”

Most people land in Testing without choosing it. n8n’s Google OAuth2 setup guide walks you through creating your own Google Cloud project and notes that if you select External, the app defaults to Testing mode. Its troubleshooting section names the result: for External apps in Testing, consent and tokens expire after seven days, and the fix it gives is to reconnect in the credentials modal. That reconnect works, but only for another seven days. The steps below end the cycle.

What you seeLikely causeFix (step n)
Fails about 7 days after each reconnectOAuth app is External and in TestingMove to In production or Personal (steps 2 and 3)
Still fails after switching to productionOld token was issued while in TestingReconnect once after the switch (step 4)
Fails right after someone changed the Google passwordGmail scopes revoke tokens on password changeReconnect, then avoid shared logins (step 6)
Fails after many reconnects or several credentials100 refresh tokens per account per client limitUse one credential per account (step 6)
“admin_policy_enforced” or “invalid_rapt” in the errorWorkspace admin rules or session controlAsk the Workspace admin (step 6)
Failure goes unnoticed for daysNo alert when a run failsAdd an error workflow (step 7)

Before you change anything

  • Check where n8n runs. n8n’s docs say that on n8n Cloud you can use managed sign-in for Gmail, Sheets, Drive and other Google nodes, with no Google Cloud project of your own. On self-hosted n8n you always use your own project, and its settings decide the expiry.
  • Find the Google Cloud project. Open the credential in n8n, note the Client ID, and find the matching OAuth client in the Google Cloud console. Several old test projects are common; change the right one.
  • Write down which workflows use the credential. Every workflow using it failed while it was expired, and you will want to check each one afterwards.
  • Read the full error. Open a failed execution and copy the message. “Token has been expired or revoked” points to this guide; “admin_policy_enforced” or “invalid_rapt” point to a Workspace admin setting instead.
  • Don’t delete and recreate the credential each week. Each new connection creates another refresh token, and Google limits how many one account can hold for the same client.

How to fix it, step by step

Step 1: Confirm the seven-day pattern

Open the workflow’s Executions list and find the first failed run after the last time someone reconnected the credential. If the gap is about a week, and the error is “invalid_grant” with “Token has been expired or revoked,” Testing mode is almost certainly the cause. If failures come at random times, or the same day as a password change, skip to step 6.

Step 2: Check the app’s user type and publishing status

In the Google Cloud console, open the project and go to the OAuth consent screen settings, then Audience. You will see the user type, External, Internal or Personal, and for External apps a publishing status of Testing or In production, plus the list of test users. Google’s help page says Testing allows up to 100 test users and that their authorizations expire after seven days. External plus Testing is the combination that causes the weekly failure.

Step 3: Pick the right fix for your account

There are three ways out, and Google’s Manage App Audience page describes each. If the credential uses a Google Workspace account and the project belongs to that Workspace organization, the Internal user type limits the app to your organization’s accounts and avoids the test-user expiry; your Workspace admin may need to allow access to Gmail and Drive scopes. If only you will ever connect it, the Personal user type restricts the app to the account that created it and, per Google, is not subject to the seven-day test-user token expiry; note that Personal can’t be changed to another type later. Otherwise, click Publish app to move an External app to In production.

Publishing has a catch the forum answers often skip. One September 2025 reply calls it just flipping a switch with no verification (community answer), but Google’s page says an app in production may need verification before it can request sensitive or restricted scopes, and until then users see an “unverified app” screen and the app is capped at 100 new users over its lifetime. For an internal automation that only your own account connects to, the usual result is a warning screen you click through once. Gmail and Drive scopes can be classed as restricted, so if Google asks for verification, read its requirements before you agree to anything.

Step 4: Reconnect the credential once

Changing the status doesn’t extend the token you already have; it was issued under Testing rules. Open the credential in n8n, click Sign in with Google (or Reconnect), finish the consent screen, and save. In the April 2025 thread, a member gave exactly this advice: after changing to production, renew the token one last time (community answer). Run each workflow that uses the credential once by hand to confirm it works.

Step 5: Use a service account where n8n supports it

For Sheets, Drive, Docs and some other nodes, n8n also accepts a Google service account, a robot account with its own key that has no consent screen and no user token to expire. n8n’s service account guide has two limits to know. Gmail is marked with a warning and n8n recommends OAuth2 for it. And service accounts created after April 15, 2025 can’t open files in a personal My Drive, only shared drives or files shared directly with the service account’s email address. One January 2026 commenter switched to a service account after a published app kept expiring (community report). It works well for a Sheet you share with it; it is not a fix for Gmail.

Step 6: If it still expires, check Google’s other reasons

Google’s OAuth overview lists the other reasons a refresh token stops working: the user removed the app’s access in their Google account, the token went unused for six months, the user changed their password while the app had Gmail scopes, an admin restricted the service (error admin_policy_enforced), or a Workspace session-control policy requires sign-in again (error subtype invalid_rapt). It also sets a limit of 100 refresh tokens per Google account for each OAuth client, and a new one silently cancels the oldest. If several n8n credentials, or several n8n instances, connect the same account through one client, they can push each other out. Keep one credential per Google account and share it between workflows.

Step 7: Add an error workflow so you hear about it

Google’s documentation tells developers to expect that a refresh token might stop working, so plan for the next failure. n8n’s error handling docs explain how: create a workflow that starts with the Error Trigger node and sends you an email or chat message, then select it under Error workflow in each workflow’s settings. One error workflow can cover all of them. A credential that expires on a Friday then costs you a notification, not a week of missing leads.

What these steps can’t do

  • They can’t recover runs that failed while the credential was expired. A polling trigger such as Gmail or Sheets may pick up older items on the next poll, but check the source data for anything missed.
  • They can’t skip Google’s verification. If your app needs it for restricted Gmail or Drive scopes, that process is Google’s, and its requirements decide the timeline.
  • They don’t change n8n Cloud’s managed sign-in. In a January 2026 thread, a Cloud user’s managed Gmail credential failed until they reconnected, and the cause was never confirmed (community report); that case is one for n8n support.
  • They can’t override a Workspace admin’s policy. Session limits and restricted services are set by the admin, who is the only one who can change them.

If your webhooks are the problem instead, n8n webhook works in test, not production covers that, and n8n vs Make vs Zapier compares the tools if you are deciding whether to stay on self-hosted n8n.

Our workflow automation service sets up and maintains n8n workflows with Google credentials that don’t need a weekly reconnect, plus an alert on every workflow. If yours keep expiring, send us the error text and where your n8n runs.

Frequently asked questions

Why do my n8n Google credentials expire every 7 days?

Because the Google Cloud project behind them is set to the External user type with a publishing status of Testing. Google issues refresh tokens that expire after seven days in that mode for any scopes beyond basic sign-in, which includes Gmail, Sheets and Drive.

How do I stop n8n Google OAuth tokens from expiring?

In the Google Cloud console, publish the app to In production, or use the Internal user type for a Workspace organization or the Personal type for a single account. Then reconnect the credential in n8n once, because the old token was issued under Testing rules.

What does “invalid_grant: Token has been expired or revoked” mean?

It means Google refused the stored refresh token. The usual cause in n8n is the seven-day Testing limit; others include a password change on an account with Gmail access, removed app access, six months without use, or the 100-token limit per account and client.

Do I need Google verification to publish my n8n app?

Possibly. Google says apps in production may need verification before requesting sensitive or restricted scopes, and shows an unverified-app screen until then, with a lifetime cap of 100 new users. For an app only your own account uses, the warning screen is usually what you see.

Can I use a Google service account in n8n instead?

For Sheets, Drive, Docs and some other nodes, yes, and it has no user token to expire. n8n recommends OAuth2 for Gmail, and newer service accounts can only reach shared drives or files shared with their email address.

Sources

Want help with this?

Read about Workflow automation, or book a session to talk it through.