Get invalid token error and wait node stucks

hello, I have a common problem that is not yet resolved or explained, the wait node get stuck because the webhook call fails on error : invalid token.

What is the error message (if any)? INVALID TOKEN

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 2.17.7
  • Database (default: SQLite): POSTGRESQL 16
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): GCP CLOUD RUN
  • Operating system:

good day @inssaf
you need to make sure your cloud run service is configured with minimum instances set to at least 1 so it never scales to zero and loses the execution state. also check that you have a persistent external database properly connected (which you do with postgresql 16, good) and that your N8N_EDITOR_BASE_URL and WEBHOOK_URL environment variables are correctly set to your public cloud run url, because if n8n generates the resume url pointing to the wrong host the token will always fail. those two env vars are the most common culprit in cloud run deployments.

I usually use this docs for help

Hello @inssaf toggle the workflow off and on in the UI to force a re registration of the webhook.

Since you are on Cloud Run, ensure your N8N_HOST and WEBHOOK_URL environment variables are correctly set to your public domain to ensure the generated external URL is correct.

thank you @tamy.santos and @Brighto , the cloud run is configured to scale to 1, and n8n_host , webhook_url , n8n_editor_base_url are well set. In fact this used to work for me for a long time ! I unpublished then republished the workflow and didn’t work :((

In this case, I’d also check the resume URL generated by the Wait node in the execution data. If the URL/domain changes between the moment the Wait node is created and the moment the webhook resumes, n8n may reject the token as invalid. On Cloud Run, I’d also make sure you are not redeploying/restarting the service while executions are waiting, and that all instances use the same database/encryption key configuration. If possible, test with a very short Wait duration first to confirm whether the token fails immediately or only after Cloud Run scaling/restart behavior.

@inssaf can you edit your workflow’s JSON to add the missing webhookId to your Wait node to test if this works?

it already has it, it’s not missing

problem solved !! all I had to do is change “url”: "{{$execution.resumeUrl}}?decision=approve to “url”: "{{$execution.resumeUrl}}&decision=approve in the teams adaptive card