Hi, I use AI Agent node and I got problem. When one tool dont return any result, the whole agent stop running. Is there a way to make it continue or skip that tool instead of stop all workflow?
@Asha_Naon open the tool node thats failing → Settings tab (top right of the tool config panel) → set On Error to “Continue (Using Error Output)”. now when that tool throws, the agent gets the error as the tool response instead of the whole workflow dying.
in the node JSON it looks like:
{
"parameters": { },
"type": "n8n-nodes-base.yourToolNode",
"typeVersion": 1,
"position": [600, 300],
"onError": "continueErrorOutput",
"name": "Your Tool"
}
after that the agent sees something like “tool returned error: …” and can route around it (apologize to the user, try a different tool, etc). which tool is the one breaking? might be worth tuning its inputs too so it doesnt fail in the first place
Hi @Asha_Naon
The problem is that the n8n AI Agent currently treats any tool failure or empty result as a “fatal crash.” Instead of the AI saying “I couldn’t find anything,” the entire workflow simply stops running. Unfortunately, the standard “Continue on Error” setting doesn’t work here because the crash happens inside the tool, not the agent itself.
The most reliable fix is to stop using direct tool nodes and instead use the “Call n8n Workflow” tool. By putting your tool’s logic into a separate sub-workflow, you can turn on “Continue on Fail” for the specific nodes that are glitchy. This ensures the sub-workflow always finishes and sends some kind of response back to the agent, preventing the main workflow from dying.
Another key trick is to stop letting your tools “fail” in the technical sense. Instead of letting a node turn red and throw an error, configure it to return a successful message that contains a “soft error,” such as a JSON object saying {"success": false, "error": "No data found"}. This tricks n8n into thinking the tool worked perfectly, while giving the AI the actual information it needs to know that the search failed.
Finally, you need to tell the AI how to handle these “soft errors” in its System Prompt. Explicitly instruct the agent that if it sees a “success: false” message or an empty result, it should not give up. Tell it to either try a different search term, attempt to fix the input, or simply explain the situation to the user in plain English.
You can use below system prompt as an example and modify it according to your use case
"You are a helpful assistant. IMPORTANT: When calling tools, if a tool returns a response where 'success' is false, do NOT stop the workflow. Instead, read the 'error' and 'suggestion' fields. Use that information to either: 1) Attempt the call again with corrected parameters, or 2) Explain the specific issue to the user in a friendly way."
What AI model are you using? Sometimes, the AI model will play a big part too
hi @Asha_Naon , welcome to our community! I’m Jay and I’m Vietnamese verified n8n creator.
I ran into a very similar issue before, and in my case it turned out to be a bug in the AI Agent node v3.1. Whenever one of the tools failed or returned nothing, the whole agent would just stop instead of continuing.
I was able to work around it by downgrading the AI Agent node back to version 2.2. With v2.2, the agent kept running even if some tool calls failed or didn’t produce any output.
Here is how I downgraded the node version:
-
Open your workflow and copy the AI Agent node.
-
Paste it into a text editor (VS Code, Notepad, etc.) so you can see the JSON.
-
Find the
"typeVersion"field for that node and change it from3.1to2.2. -
Copy the edited JSON and paste it back into n8n to replace the old node.
After that, the workflow will use AI Agent v2.2 again, and tool failures should no longer completely stop the agent.
If you want, I can also share a minimal example workflow that reproduces the behavior on 3.1 and shows it working again on 2.2.
Or you can copy here.
thank you so much, it finnally work
Setting the tool node On Error to Continue (Using Error Output) is the right fix to stop the whole agent dying. One thing to add though, because it creates a new trap.
Once the tool continues on error, the failure becomes invisible. The agent routes around it, the run finishes green, and you never know that tool has been failing every time. So wire the error output to something that records it: a Set node logging the tool name and error to a sheet, or a quick notify on repeated failures. That way “continue” does not turn into “silently broken for two weeks.”
Worth also fixing why the tool returns nothing in the first place, since a tool that fails every run is usually an input or auth problem, not something to just skip past.