Gmail Trigger: Built-in Google OAuth token expired/revoked

Describe the problem/error/question

My Gmail Trigger node stopped working. The built-in Google OAuth authorization (using “Sign in with Google” on n8n Cloud) has become invalid. The workflow was working previously but now fails on every poll.

I didn’t change password or revoked app access. After re-authenticating via “Sign in with Google” the trigger works, but I don’t understand why it stopped working or if it will stop again.

What is the error message (if any)?

The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.

Full error:

{
  "errorMessage": "The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.",
  "errorDetails": {
    "rawErrorMessage": [
      "The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."
    ],
    "httpCode": "EAUTH"
  }
}

Please share your workflow

Not relevant - this is a credential/authentication issue, not a workflow logic issue. The Gmail Trigger node fails before any workflow execution.

Share the output returned by the last node

N/A - the trigger itself fails to authenticate.

Information on your n8n setup

  • n8n version: 1.99.1

  • Database: N/A (Cloud)

  • n8n EXECUTIONS_PROCESS setting: N/A (Cloud)

  • Running n8n via: n8n Cloud

  • Operating system: N/A (Cloud)


hello @albertocabasvidani

Not sure, but maybe the previous credentials is expired. Usually, an API token is valid only for a specific time

Is this the case also with Gmail nodes in n8n Cloud?

That would be an issue, how can I know when a Gmail trigger stops working?
In this case, I didn’t receive any error notification, the trigger didn’t trigger at all.

Hi @albertocabasvidani,

What @barn4k referred to is correct. When using gmail oauth, you need to re-auth after some time again as the tokens expires and does not auto refresh. Ideally you need to use a Service Account which never expires, however this will only work on a Google Workspace account which is a paid service for businesses. Public gmail.com accounts are not supported for service accounts.

However if gmail.com is your only option, to get notified when your gmail node fails due to a token expiry, I would advise you to create a workflow and set the Error Trigger. Remember to point your workflow to the error workflow so it can catch errors. Then use something like Telegram to send you errors to your phone.

If this is still a problem, then I would highly recommend signing up for a MailRelay account (provides 80 000 free emails a month) and send emails like this. MailRelay provides an API which you can call via the http node. I ran into a similar issue and decided to switch from gmail to this option.

Transactional emails like notifications etc should generally be sent using a bulk emailing service instead of gmail as Google will likely rate limit you on top.