Agent FixboardAgentFixboard

AI nodes fail after 5 minutes with UND_ERR_HEADERS_TIMEOUT

An AI node whose reply takes longer than five minutes fails with HeadersTimeoutError, code UND_ERR_HEADERS_TIMEOUT, message Headers Timeout Error.

From GitHub

n8n-io/n8n

Difficulty
Easy
Time
~5 min
Steps
2
Fixed in
n8n@2.5.0
Last checked

Verified fix: PR #24292 merged on . Fixed in n8n@2.5.0 (first published release whose tag contains the merge commit). Last checked .

Symptom

An AI node whose reply takes longer than five minutes fails with HeadersTimeoutError, code UND_ERR_HEADERS_TIMEOUT, message Headers Timeout Error.

Evidence what you'll see

  • The reporter found the timeout set to 300 seconds.
  • Shorter replies succeed. The failure is the header timeout, not a workflow error.

Why it happens

The HTTP client used by the AI nodes kept a 300-second headers timeout. The report asks for an environment variable because the nodes had no setting for it.

Affected versions

n8n 1.68.0, Ubuntu 24.04, Node.js 18.16, SQLite, execution mode main.

Fix steps

0 of 2 done

Your check marks stay in this browser only.

How to check it worked

  • A model call that takes longer than five minutes returns a reply instead of UND_ERR_HEADERS_TIMEOUT.

If it still fails

  • The linked issue does not describe UND_ERR_HEADERS_TIMEOUT on 2.5.2. On 1.68.0 the failure is at about five minutes.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it