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

Debugging HTTP 429 Rate Limit Cascades in Self-Hosted n8n AI Agents via CLI

说明与用途

通过探测、查询执行数据库、配置节点重试、添加错误触发器以及使用带指数退避的 Bash 脚本包装调用,解决 n8n 中因 429 限流导致的 CLI 卡死问题。

问题

Automated n8n workflows that call LLM APIs stall when upstream services return HTTP 429, causing CLI clients to hang without clear error feedback.

结果

Implemented deterministic backoff and error handling in n8n workflows, eliminating CLI hangs caused by upstream 429s and providing clear telemetry.

工作流

  • 1. Probe webhook with curl to capture latency and status.
  • 2. Query n8n execution database (Postgres or SQLite) to identify failed node and error message.
  • 3. Configure LLM node: set Max Tries=3, Wait Between Tries=2000ms.
  • 4. Add Error Trigger node to format failures into JSON and return via Webhook Response.
  • 5. Wrap CLI calls in a bash script that retries with exponential backoff and respects Retry-After.
  • 6. Verify by simulating a rate limit and observing retry logs and final success message.

证据

If your local CLI caller is waiting synchronously on a webhook trigger, n8n leaves the HTTP socket open until the execution completes or the runner engine times out.

来源

Configure the LLM node settings explicitly: set Max Tries to 3 and Wait Between Tries to 2000 (ms).

来源

Here is a lightweight, drop-in bash wrapper you can use in place of raw curl or CLI agent tool triggers.

来源

  • 记录日期: 2026-09-14T06:00:30.405Z