Google credentials expire every week in self-hosted n8n

Describe the problem/error/question

I have an 0auth2 credential from Google that I save in n8n so that I can read google calendar entries. Every 7 days, it expires. I want to keep the app in the testing stage (i.e. I do not want to publish it). Is there any way to bypass this? I didn’t seem to have this issue in the cloud hosted version of n8n. I’m hosting this on railway.

What is the error message (if any)?

Screen Shot 2024-02-28 at 1.51.13 PM

“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “459ec3f8752409778e3fcbc05ec484080ce6f13f7a7cf8a589a64e3544d4aec6”
“nodes”: [
“parameters”: {
“operation”: “getAll”,
“calendar”: {
“__rl”: true,
“value”: “[email protected]”,
“mode”: “list”,
“cachedResultName”: “[email protected]
“returnAll”: true,
“options”: {
“timeMin”: “={{ $json.timestamp.slice(0,10) + "T00:00:00-08:00" }}”,
“timeMax”: “={{ $json.timestamp.slice(0,10) + "T23:59:59-08:00" }}”
“id”: “faa7fa88-2b6a-4283-a52b-917e51ddaf57”,
“name”: “X Calendar”,
“type”: “n8n-nodes-base.googleCalendar”,
“typeVersion”: 1,
“position”: [
“credentials”: {
“googleCalendarOAuth2Api”: {
“id”: “x”,
“name”: “[email protected]
“connections”: {},
“pinData”: {}

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

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

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:

hello @ckmoocow

That’s not an issue. It’s normal behavior for the refresh tokens in Google APIs for test apps. Check this post for more details

Yeah, I saw that documentation. It’s weird that I didn’t bump into this when I was on the n8n cloud version though. My automation ran for 2-3 weeks w/o me needing to reauthenticate. Is setting app to production literally the only way to make this go away? What if I don’t have all of the verifications needed to publish?

Hey @ckmoocow,

On Cloud we have a published app which operates differently. You can move your Google app to production and it will change this but you may need to go through verification.

@Jon Ah, so the Cloud version of n8n actually does something behind the scenes to re-login or refresh the credentials to circumvent the 7 day limit for google projects in testing mode?

Hey @ckmoocow,

If you are using the managed oauth on Cloud (clicking the sign in with Google button) then you will be using our app which isn’t a testing mode app.


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