I’m debating between two ways to route tasks in my n8n AI workflows. I’d love to hear your experience on:
-
Text Classification + Switch Node: Using an LLM to categorize intent first, then routing via standard nodes.
-
Multi-AI Agent (Agent as a Tool): A Master Agent that calls sub-agents as tools
I’d love to hear your experiences and “war stories” on which one works better
إعجابَين (2)
I’ve only tested one side of this, so take it as partial.
I built a classify-then-route pipeline: Basic LLM Chain with a Structured Output Parser outputs a category, then a Switch node branches on it into category-specific actions (different reply email, different internal notification, same log to Sheets). No sub-agents, no agent-as-tool — just one classification call followed by static routing.
What I found built into that approach:
- Reasoning quality was more sensitive to prompt structure than I expected. I rewrote the category definitions twice — putting context first and decision criteria last noticeably firmed up which category it picked on ambiguous input.
- Retry lives on the node, not custom logic —
Basic LLM Chain’s built-in Retry On Fail, 3 attempts. Wanted a longer wait between tries (10s) but 5000ms is a hard cap n8n enforces on that setting, not something you can raise.
- One trap that cost me a rebuild: whichever action node runs per branch (
Gmail, in my case) can overwrite the item data flowing through it. If you need the original classification result downstream of the send, branch before the action node touches the item, not after.
No experience with the multi-agent side of your question, so I can’t speak to how it compares on cost or reliability at scale. If a single classification call is enough signal for routing, the classify-then-Switch approach held up for a five-category split with a decent retry layer.
Hey u/Phat_Truong, thanks for sharing! Great experiment. I went through something similar because I wanted to understand whether agents actually perform better than a deterministic workflow for document classification.
My setup was pretty simple:
Document comes in → Classify document → Upload it to the correct Google Drive folder
Here’s what I found:
-
Cost: The deterministic approach was significantly cheaper. The agent went through multiple thinking cycles, which caused a lot of unnecessary token usage for such a simple task.
-
Reliability: The agent hallucinated once so badly that it decided to create a new folder called “Restaurants” instead of putting the document into “Others.” That made me pretty sceptical about using an agent for this particular task.
-
Speed: Both approaches were pretty much equal.
For me, the takeaway is that deterministic workflows make the most sense when you understand the process upfront. If you know which documents are likely to come in, you can define clear rules and keep LLM usage to a minimum.
Agents really earn their place when there’s a black box somewhere in the process, for example, when you don’t know what kind of documents will come in or what decisions need to be made beforehand. That’s where an agent can be really useful because it can interpret the incoming data and decide how to process it.