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

Stop Retrying a Dead Provider: The Cooldown Rule for n8n Fallback Chains

说明与用途

在 n8n 中,回退链会不断重试已宕机的提供商,浪费成本和时间。引入冷却规则后,连续失败后跳过该提供商,减少无效请求并加速队列。

问题

When a provider in an n8n fallback chain goes down, the chain keeps retrying it for every job, wasting cost and time.

结果

Implementing a cooldown rule reduces wasted requests from a dead provider from 50 to 3 per job, saving cost and speeding the queue.

工作流

  • Honor Retry-After header and add jitter to backoff
  • Track consecutive failures per provider and set a cooldown_until timestamp after N failures
  • Use a Code node to skip providers in cooldown without probing
  • Reset consecutive_failures on success, re-arm cooldown on subsequent failures
  • Validate fallback output against schema and brief to avoid silent degradation

证据

When a provider rate-limits you, it often tells you how long to wait in a Retry-After header. Use it — it's the provider telling you the cheapest wait, and ignoring it is how a rate limit becomes a ban.

来源

After N consecutive failures from one provider — I use three — mark it cooled-down for a window (ten minutes is my default) and skip it entirely.

来源

Mock a provider that always 500s, then run ten jobs through the chain and count requests at the mock. Without cooldown: fifty requests, ten per job, all wasted. With cooldown: three requests for the first job, then zero for the next nine until the window expires.

来源

  • 记录日期: 2026-10-21T15:56:15.374Z