Google cridentials keeps disconnecting

my workflow usually gives error and i keep having to re-authenticate again. to solve, i have to go into my Credentials and sign in with Google.

any idea what i can do to make it work without “Sign in with Google?”

Hi @hasti

Any app left in Testing mode automatically has its refresh tokens revoked every 7 days. Once that 7-day timer hits, n8n loses access, and you are forced to manually click that “Sign in with Google” button all over again.
you don’t actually need to get the app officially verified by Google for personal use. You just need to push it out of testing.

  1. Go to Google Cloud ConsoleAPIs & ServicesOAuth consent screen

  2. Under Publishing status, click PUBLISH APP

  3. Confirm the dialog — your status changes from “Testing” to “In production”

  4. Go back to n8n and re-authenticate one final time (click “Sign in with Google”)

Google may show a “Google hasn’t verified this app” warning — click Advanced → Go to [Your App Name] (unsafe) to proceed.
This is safe because you are both the developer and the user.

Hey @hasti,
Welcome to the community!

You can avoid this error by either of the below ways

  • Fix OAuth token expiring (most common)
  1. Open Google Cloud Console → APIs & Services → OAuth consent screen

  2. If status is Testing, click Publish App (switch to In production)

  3. Go back to n8n → Credentials → your Google OAuth credential

  4. Click Sign in with Google one last time to generate a non-expiring refresh token

Or

  • Alternative to “Sign in with Google” (use Service Account)
  1. In Google Cloud Console → create a Service Account

  2. Generate/download the JSON key

  3. Share the needed Drive/Sheets files/folders with the service account email (…@…iam.gserviceaccount.com)

  4. In n8n → Credntials create Google Service Account credential using the JSON key and use that credential in your nodes

Welcome to the community @hasti

Best Solution: Use Service Account Authentication

Instead of OAuth2 (which requires periodic re-authentication), switch to Service Account authentication for Google services. This provides:

  • No expiring tokens

  • No manual re-authentication needed

  • More reliable for automated workflows

Steps to set up:

  1. Go to Google Cloud Console

  2. Create a Service Account for your project

  3. Download the JSON key file

  4. In n8n, create a new credential using “Service Account” instead of OAuth2

  5. Upload the JSON key file

  6. Update your workflow nodes to use the new Service Account credential

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.