n8n · tool · fg-0341

n8n AI node fails with UND_ERR_HEADERS_TIMEOUT when a local model takes over five minutes

{ "name": "HeadersTimeoutError", "code": "UND_ERR_HEADERS_TIMEOUT" }

Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100

Cause

Before 2.5.0 the HTTP client used by AI nodes had a fixed 300 second header timeout. From 2.5.0 the limit comes from N8N_AI_TIMEOUT_MAX, which defaults to one hour.

Fix

Upgrade to 2.5.0 or later and set N8N_AI_TIMEOUT_MAX in milliseconds if you need more than one hour.

Apply

N8N_AI_TIMEOUT_MAX=7200000

Affects: n8n before 2.5.0 with AI nodes against slow or local models

Sources

Have your agent know this before it fails

claude mcp add --transport http footgun https://getfootgun.com/api/mcp