Your n8n workflow ran fine for eight months. Then a supplier changed their invoice layout, and a blank total slid through to finance. The workflow did exactly what it was told.
That's the problem. Workflow automation is great at jobs you can describe in advance. It struggles once a step needs judgment.
Save this as a checklist. You get six signs you've hit that line, a hybrid pattern, and a test for when to stay on n8n.
What n8n does well
Start with the honest part. n8n is the right default for a lot of work.
It's good at three things.
- Deterministic steps. A webhook fires and a row lands in a sheet. Same input, same output.
- Cheap runs. Most steps are plain API calls. No model tokens, no bill that grows with volume.
- Visible logic. Anyone can open the canvas and see what happens. That matters when the builder leaves.
Self-hosting is an option too, so the data can stay on your own servers. For ops teams, that often settles the first security review before it starts.
n8n handles loud failures well. You can attach an error workflow that starts from an Error Trigger node and alerts you in Slack.
It ships AI pieces too. The AI Agent node connects a chat model and tools inside a workflow.
Those nodes sit on LangChain's JavaScript framework. So n8n can call a model. What you need to decide is whether a canvas is still the right home once judgment becomes the core of the job.
6 signs you've outgrown workflow automation
None of these alone means you should rebuild. Two or three together usually do.
1. Judgment steps keep growing
You started with one IF node. Now you have a Switch with eleven branches, and a new case lands every week. When the rules keep growing because the world won't sit still, the step needs reasoning, not more branches.
2. Inputs stopped being structured
Forms and API payloads are easy. Emails, PDFs, call notes, and screenshots are not. If half your nodes clean up input before the work starts, you're hand-writing a brittle parser on a canvas.
3. Retries need a reason, not a timer
A blind retry works for a 30s timeout. It fails when the API rejects the payload because a field is wrong. If someone has to read the error and change the request, that retry needs reasoning.
4. Nobody owns the outcome
Workflows that touch money, customers, or contracts need a named owner for exceptions. If "who reviews what fell out?" gets the answer "whoever sees the alert," the flow has no owner. A custom build forces you to design one.
5. You can't answer "why did it do that?"
An execution log shows which nodes ran. It doesn't show why a model picked option B, or what context it saw.
Once an auditor or a client asks, you need decision traces as well as run history. Those traces have to be designed in from the start.
6. The cost curve bent the wrong way
Every model call inside a workflow is a cost you pay per run. Once a flow loops through a model several times per item, you need per-task budgets and a kill switch. A canvas makes that hard to see and harder to cap.
The hybrid pattern: n8n at the edges, the agent in the middle
You rarely need to rip n8n out. Keep it doing what it does best, and move only the judgment into code you own.
- n8n is the trigger. A Webhook node, a schedule, or an app trigger starts the run.
- The agent is the judgment step. n8n calls your agent service with a typed payload. The agent decides and returns a typed result with a confidence score.
- n8n is the sink. It writes the result to the CRM or ticket queue. Low-confidence results go to a person.
The contract between the two matters most. Keep it small and versioned, so either side can change without breaking the other.
{
"contract": "invoice-triage.v1",
"request": {
"run_id": "n8n-exec-48213",
"source": "email",
"attachments": ["invoice.pdf"],
"budget_usd": 0.05
},
"response": {
"decision": "approve | flag | reject",
"confidence": 0.0,
"reasons": ["string"],
"trace_id": "string",
"needs_human": true
}
}Two fields do most of the work. The budget_usd field caps what one run may spend. The needs_human field lets n8n route an item to a person without knowing anything about the model.
Failure rules that keep the hybrid honest
- If the agent times out, n8n treats it like any failed node and fires the error workflow.
- If confidence falls below your threshold, the item goes to a person, never straight to the sink.
- If the run hits its budget, the agent stops and returns needs_human: true.
- Every response carries a trace_id, so a reviewer can open the full decision later.
Write these rules down before you write a prompt. They decide whether the hybrid is safe to leave running overnight.
Where the agent side lives in production
Once the judgment step is your own service, you need to run it like production software. That means tasks, approvals, cost, and an audit trail in one place.
One open-source example is Mission Control, our agent control plane (GitHub).
Its README lists a task board that moves work through inbox, assignment, execution, and review. It also lists token use and cost views, approvals, and audits.
In the hybrid pattern, that looks like this.
- n8n posts the item to your agent service, which opens a task.
- The agent works the task, and every tool call and cost lands in the activity stream.
- Risky actions wait for an approval record before the task can reach done.
- n8n picks up the finished result and writes it to the sink.
The README is clear that Mission Control is alpha software. APIs may change between releases, so adopt it with care.
You don't need our tool to get the benefit. You need one place where each agent task has an owner, a budget, and a trail. Build that first, whatever you build it with. A shared spreadsheet with an owner column beats a dashboard nobody opens.
The historical Tool Suite case study lists snapshots, airdrops, and royalty payments as separate tools. Small parts with sharp contracts are easier to swap.
When to stay on n8n
Stay on n8n if this describes your flow.
- The inputs are structured and come from systems you control.
- The rules fit on one screen and rarely change.
- A failed run is loud, cheap, and safe to rerun.
- Nobody needs to explain a decision later, because the flow doesn't make one.
- Volume is high and per-run cost matters more than nuance.
n8n also lets you test and evaluate AI workflows in the tool. If one model call in a simple flow passes those checks, keep it there.
Moving that call into custom code adds a service to run and a contract to maintain. If a clean n8n flow does the job, keep it. Our AI automation services page covers how automation work gets scoped when it doesn't.
How to decide in one afternoon
Run this checklist on the last 30 failed or escalated runs of your noisiest flow.
For each failed or escalated run, tag one cause:
[ ] rule gap new case the branches didn't cover
[ ] messy input unstructured or changed format
[ ] bad retry retried without fixing the cause
[ ] no owner nobody acted on the alert
[ ] can't explain nobody could say why it decided
[ ] cost spike a loop or model call ran away
Mostly rule gap + messy input => add an agent judgment step
Mostly no owner + can't explain => fix ownership and tracing first
Mostly cost spike => add budgets before adding AI
Mostly none of these => stay on n8nThat count is your baseline. It shows whether an agent will help, or if no tool will fix an ownership gap. If the answer is a custom agent, see our AI agent development page.
FAQ
Is n8n good enough for AI agents?
Yes, for simple agents with a short tool list and a clear success check. n8n has an AI Agent node that connects a chat model and tools. It gets harder once you need custom state, per-task budgets, or decision traces an auditor can read.
When should I replace n8n with custom code?
Replace only the step that needs judgment, not the whole flow. Keep n8n for triggers, mapping, and writes to your other systems. Move the reasoning into a service you own, with a typed contract between the two.
Do custom AI agents cost more to run than n8n workflows?
Usually yes, per run, because model calls cost money and plain API calls don't. Agents pay off when they replace review time or catch errors a rule would miss. Set a budget per run and measure it against the work it replaces.
How do I audit what an AI agent decided?
Log every decision with its inputs, the tools it called, its cost, and the reason it gave. A run log that only shows which steps ran isn't enough. A control plane like Mission Control keeps that trail next to the task itself.
Build the judgment step with us
Try the checklist above on your noisiest flow and bring us the count. An export of the flow and one bad run help too. We'll tell you which step needs an agent and which steps should stay as they are.



