Debugging HTTP 429 Rate Limit Cascades in Self-Hosted n8n AI Agents via CLI
Description and use
Fix CLI hangs caused by 429 rate limits in n8n by probing, querying the execution DB, configuring node retries, adding an error trigger, and wrapping calls in a bash script with exponential backoff.
Problem
Automated n8n workflows that call LLM APIs stall when upstream services return HTTP 429, causing CLI clients to hang without clear error feedback.
Outcome
Implemented deterministic backoff and error handling in n8n workflows, eliminating CLI hangs caused by upstream 429s and providing clear telemetry.
Workflow
- 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.
Evidence
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.
- Record date: 2026-09-14T06:00:30.405Z