Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

The Token That Expired on a Holiday: Credential Expiry in n8n

说明与用途

n8n 工作流因 OAuth 令牌过期而停止写入数据,但仍显示成功。解决方案包括跟踪凭据到期、区分身份验证失败与临时错误,并制定重新授权的操作手册。

问题

An n8n workflow stopped performing its job because an OAuth token and its refresh token had expired, yet the workflow continued to report successful executions.

结果

Implementing credential expiry tracking, distinct error handling for auth failures, and a documented re‑authorization runbook prevented silent workflow failures and reduced outage resolution time from hours to minutes.

工作流

  • 1. Record credential name, expiry date, and owner in a central spreadsheet. 2. In the workflow, after the HTTP node, check the status code. 3. If status is 401/403, branch to an alert node that sends a message naming the credential and provider, and mark the run as failed. 4. If status is 429/500, branch to a retry loop. 5. Ensure the error workflow alerts include the authentication failure message. 6. Maintain a runbook that documents how to re‑authorize the credential, including account owner, login location, required scopes, and verification steps.

证据

The workflow was fine. The credential was not

来源

The OAuth token had expired. The refresh token had expired too, silently, weeks earlier

来源

The fix starts with treating every credential as something with a known expiry date

来源

Never let an authentication failure travel down the same path as a transient failure

来源

  • 记录日期: 2026-11-01T12:43:51.601Z