Debugging HTTP 429 Rate Limit Cascades in Self-Hosted n8n AI Agents via CLI
Описание и применение
Решение проблемы зависания CLI при 429‑ответах от LLM‑API в n8n: проверка вебхука, анализ базы, настройка повторов и обёртка скрипта с экспоненциальным откатом.
Задача
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