How to Stop n8n Credentials From Expiring Every Week

If you’ve been hitting that annoying “credentials expired” error every week with Google nodes, you’re not alone. This isn’t a bug in your workflow, it’s how OAuth2 tokens work by default. They expire after 7 days, and you end up manually re-authenticating over and over.

Why This Happens

Quick breakdown:

  • Access token - the actual key n8n uses to talk to Google services. Expires after 1 hour.

  • Refresh token - a long-term key that automatically fetches new access tokens without you logging in again.

The issue? When your Google Cloud app is in “Testing” mode, refresh tokens get revoked after 7 days. That’s the root cause.

The Fix

  1. Go to Google Cloud Console → OAuth Consent Screen

  2. Navigate to the Audience tab

  3. Click Publish App (push to production from Testing)

That’s it. You don’t need to submit for Google verification if you’re only using it for yourself. You’ll see a warning screen during auth (“Google hasn’t verified this app”), just click Advanced → Go to App (unsafe) to bypass it.

Quick Checklist

  • Make sure your redirect URL is exactly: https://[YOUR-N8N-DOMAIN]/rest/oauth2-credential/callback or the localhost

  • If you add new scopes later (like adding Gmail to existing Drive credentials), you’ll need to re-authenticate once to get a fresh refresh token that covers all scopes.

After this, your workflows should run without the weekly re-auth dance.

Source Link: How to fix n8n credentials from expiring

Thanks for sharing! I ran into this as well. Strange that in my case the token still expires even after the app is published.

It looks like this issue has affected a lot of self-hosted users. As a workaround, I now use Google service account credentials in some cases, which never expire. I also put together a tutorial on this in case anyone finds it helpful.

Solid writeup — the Testing-mode 7-day revocation is the one that catches everyone, and publishing the consent screen is the correct fix.

Worth adding for anyone landing here later: Google is just the loudest case, not the only one. Most OAuth credentials in n8n die on their own clock, and n8n won’t warn you before any of them:

  • Microsoft / Outlook: refresh dies after ~90 days idle (and on n8n Cloud it often stops ~1h in)
  • Meta / Facebook long-lived tokens: ~60 days
  • Xero: refresh expires 60 days after its last use

Same trap every time — nothing errors until the token is already dead, and you find out when the workflow has silently stopped. What helped me was seeing the expiry dates in advance instead of after; I keep a small free browser tool for exactly that linked on my profile if it’s useful to anyone here.

Publishing the consent screen (per the OP) is still the real fix for Google — this just means the next one doesn’t surprise you.