Solution skill
AI nodes timeout after 5m
Complete solution
N8n: AI nodes timeout after 5m. The verified fix is Fix: Community patch by Piggeldi2013 worked as a stopgap; on 2.5.0+ set N8N_AI_TIMEOUT_MAX to a higher value instead. Use this when you hit the symptoms above in n8n; not for unrelated n8n errors or general setup questions.
TL;DR
Fix: Community patch by Piggeldi2013 worked as a stopgap; on 2.5.0+ set N8NAITIMEOUT_MAX to a higher value instead.
The error
Issue n8n-io/n8n#11886 (closed, 51 comments): ### Bug Description When using AI nodes with local model, sometimes they take more than 5 mins to respond, which causes fetch to timeout (i looked through the code and past changes, and it seems to be set to 300 seconds aka 5 mins). Because of this, all AI nodes are basically unusuable for anyone with local models. Could this be an env variable so that we can configure it to be whatever we need it to be? This is the error that all AI nodes give when the model takes more than 5 mins to respond: { "name": "HeadersTimeoutError", "code": "UND_ERR_HEADERS_TIMEOUT", "message": "Headers Timeout ErrorFix
- Community patch by Piggeldi2013 worked as a stopgap; on 2.5.0+ set N8NAITIMEOUT_MAX to a higher value instead.
Success check: the symptom above is gone and the original operation completes.
When to use
- You hit this exact symptom in n8n.
- You want the verified fix without digging through the thread.
When not to use
- A different error in n8n, even a similar-looking one.
- General n8n setup or credential questions.
Compatibility
- N8n (n8n-io/n8n)
Variant phrasings
- How to fix "AI nodes timeout after 5m" in n8n
- n8n: AI nodes timeout after 5m
Source
- https://github.com/n8n-io/n8n/issues/11886
Evidence
In gh:n8n-io/n8n#11886 (https://github.com/n8n-io/n8n/issues/11886), someone reported: Issue n8n-io/n8n#11886 (closed, 51 comments): ### Bug Description When using AI nodes with local model, sometimes they take more than 5 mins to respond, which causes fetch to timeout (i looked through the code and past changes, and it seems to be set to 300 seconds aka 5 mins). Because of this, all AI nodes are basically unusuable for anyone with local models. Could this be an env variable so that we can configure it to be whatever we need it to be? This is the error that all AI nodes give when the model takes more than 5 mins to respond: { "name": "HeadersTimeoutError", "code": "UNDERRHEADERSTIMEOUT", "message": "Headers Timeout Error The verified resolution from the thread: AI nodes (Ollama/local models) timing out after 5 minutes: the internal fetch timeout was hard-coded at 300s. Contributor aalises: the fix was released in v2.5.0, which also adds the N8NAITIMEOUTMAX environment variable to raise the limit. Community patch by Piggeldi2013 worked as a stopgap; on 2.5.0+ set N8NAITIMEOUT_MAX to a higher value instead.
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_D1OoHQI6fx1vp82hpBK6pQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">AI nodes timeout after 5m <span>— Vectle</span></a>