I’m running into a frustrating issue with Google OAuth and my self-hosted n8n instance, and I haven’t been able to find a clear fix.
What’s happening
I created a Google OAuth2 credential in my Google Cloud project to let n8n connect to my personal Google account (for Drive/Sheets access).
The app is in Testing mode, and I’ve added myself as a test user.
When I connect the credential, it works at first—but then:
About every hour, I get logged out of all my Google services (Gmail, Calendar, Drive, etc.).
The OAuth credential in n8n shows as Disconnected, and my workflows fail.
The logouts happen most often on my phone (mobile Gmail/Drive apps), and occasionally in my desktop browser too.
What I’ve tried
Added myself as a test user and accepted the “unverified app” warning.
Made sure to use access_type=offline and prompt=consent so refresh tokens are issued.
Revoked the OAuth token entirely on my Google Account Security page to cut off n8n.
Even after revoking the token, I still get logged out of my Google services roughly every hour.
Re-logging into Google services after each forced logout (but the cycle continues).
What I suspect
Initially, I thought this was just Google’s risk engine flagging an unverified app using sensitive scopes (Drive access) and revoking the refresh token. But since the logouts continue even after the app/token was revoked, I think there may be something else at play (account security settings, session policy, or another underlying cause).
My questions
Is this behavior expected when an app is in Testing mode with sensitive scopes?
Why would my account still get logged out every hour after revoking the app/token?
Do I need to publish the app (move out of Testing) before tokens stop causing session invalidation?
Alternatively, would switching to a Google service account solve this issue for Drive access on a free account?
Has anyone else run into this “hourly forced logout” problem with self-hosted n8n + Google OAuth?
Goal
I just want to run n8n automations against Google Drive reliably without being booted from my Gmail/Drive/Calendar sessions every hour.
Any guidance or confirmation from others who’ve seen this would be greatly appreciated!per right.
If your question hasn’t been asked before, please follow the template below. Skip the questions that are not relevant to you.
Describe the problem/error/question
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Share the output returned by the last node
Information on your n8n setup
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system: