Skip to content

Commit 881af14

Browse files
fix(agent): retry AI Agent node on transient LLM errors (Anthropic 529)
Anthropic returns 529 "Overloaded" under load; the agent run dies ~2s in and the user gets a hard error. n8n's engine-level retryOnFail does not apply to chat-model sub-nodes (the sub-node retry wrapper in get-input-connection-data.ts only covers tool invocations, see n8n#25136), and LangChain's AsyncCaller retry does not fire on the agent's streaming path. The reliable lever is retryOnFail on the AI Agent root node itself. - n8n-claw-agent.json + sub-agent-runner.json: AI Agent nodes get retryOnFail: true, maxTries: 3, waitBetweenTries: 5000 Trade-off: a retry re-runs the whole agent turn. If the failure hits mid-loop after a side-effecting tool call (memory save, reminder), that tool can execute twice. Rare and mild vs. a hard user-facing failure on every 529. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent d12a897 commit 881af14

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

workflows/n8n-claw-agent.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,7 +1249,10 @@
12491249
"position": [
12501250
2832,
12511251
-16
1252-
]
1252+
],
1253+
"retryOnFail": true,
1254+
"maxTries": 3,
1255+
"waitBetweenTries": 5000
12531256
},
12541257
{
12551258
"parameters": {
@@ -2021,4 +2024,4 @@
20212024
}
20222025
}
20232026
]
2024-
}
2027+
}

workflows/sub-agent-runner.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,10 @@
198198
"systemMessage": "={{ $json.systemPrompt }}",
199199
"maxIterations": 25
200200
}
201-
}
201+
},
202+
"retryOnFail": true,
203+
"maxTries": 3,
204+
"waitBetweenTries": 5000
202205
},
203206
{
204207
"id": "sub-claude",

0 commit comments

Comments
 (0)