Google oauth 2.0 credentials

Hi!

I’ve followed the documentation and created a new Google OAuth2 Credential to connect n8n to Gmail, Drive, and Calendar APIs. Everything works fine – the connection is active, and I can successfully use the integration. However, the issue is that the connection only lasts 60 minutes because no refresh token is generated.

Here’s what I’ve done so far:

  1. My app is in testing mode, so I expect the connection to last for 7 days (which would be sufficient for now).
  2. I created a new OAuth 2.0 Client in Google Cloud Console and ensured I’m using the correct Redirect URI: https://oauth.n8n.cloud/oauth2/callback.
  3. I’ve enabled all necessary APIs and added the correct scopes (Gmail, Drive, Calendar, etc.).
  4. The connection works without issues, but no refresh token is generated, and the connection expires after 60 minutes.

I’ve havent been able to check if access_type=offline and prompt=consent is included from n8n, as I’ve seen mentioned in other posts here in the community n8n should handle this automatically as i understand.

Is there something I might have missed? Or could this be related to how n8n handles credentials in testing mode?

Thanks for your help!

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Fyi, Problem solved :slight_smile:

But how! :nerd_face:

Ohh sorry…

I just deleted the hole project in google cloud console. And configured my Google Cloud project credentials as seen in the screenshot.