Most of the teams who come to us asking for a "custom AI agent" do not need one yet. Some do. The hard part is telling the two apart before you have spent three months building workarounds in a visual editor, or three months building custom code you did not need.
This post is the framework I use on scoping calls. It is not anti-n8n. We use n8n where it fits. It is about where n8n stops being the cheapest option, and what moving off it looks like.
The short answer
Start with n8n (or Make, or Zapier) when the workflow is standard, the volume is modest, and a wrong answer is cheap to fix. Move to a custom agent when any one of these is true:
- The agent's output reaches customers or money without a human checking it.
- You need to prove it works, with an evaluation set and regression tests, before each change ships.
- Your logic has outgrown what a canvas shows clearly, roughly when people can no longer explain the flow from the diagram.
- Your monthly cost is driven by LLM calls and retries, not by the automation tool's subscription.
If none of these apply, stay on n8n. You will ship faster and spend less.
What n8n is good at
n8n is a workflow tool with real AI features: an AI Agent node, tool calling, memory and vector store nodes for basic retrieval. For a SaaS team it hits a sweet spot:
- Speed. A working internal workflow in a day, not a sprint.
- Integrations. Hundreds of prebuilt nodes, plus HTTP and code nodes when one is missing.
- Self-hosting. The Community Edition runs on your own server under n8n's Sustainable Use License, which keeps data in your infrastructure.
- Low cost to start. Cloud plans are priced per workflow execution rather than per step. Check current plans and prices on n8n.io/pricing before deciding.
For internal operations (routing leads, enriching CRM records, summarising tickets for a human, syncing data between systems) that combination is hard to beat, and we often recommend it.
Where n8n starts to hurt
The problems rarely show up in the first month. They show up when the workflow becomes important.
1. You cannot test it the way you test software
An AI step is non-deterministic. Changing a prompt, a model or a retrieval setting can quietly break answers that worked yesterday. In code you would run an evaluation set of real examples on every change and block the release if accuracy drops. In a visual tool, most teams test by clicking "execute" and eyeballing one output. That is fine for an internal summary. It is not fine for an agent that answers customers or touches invoices. We describe our method in How to Evaluate an AI Agent Before Production.
2. Logic outgrows the canvas
The warning signs are familiar: nested IF nodes, a code node that is now 300 lines, three near-copies of the same sub-workflow, and one person who understands how it all fits together. At that point you have custom software anyway. It just has no version history, no code review and no tests.
3. The real bill is the model, not the tool
This is the point most comparisons miss. The automation subscription is usually small. The LLM calls inside it are not. An agent that retries, calls tools in a loop or stuffs a long context into every request can cost far more in tokens than the tool itself. A custom build lets you control that directly: cache repeated context, route simple steps to a smaller model, cap tool-call loops and log cost per run. You can do some of this in n8n, but it is harder to see and harder to enforce. For build costs, see how much it costs to build an AI agent.
4. Guardrails and audit trails
If the agent can issue refunds, change account data or email customers, you need per-action permissions, a human approval step for high-risk actions and a log you can show an auditor. For teams selling into the EU, that log is becoming part of normal compliance work. Custom code makes these first-class instead of bolted on.
Side by side
| n8n (cloud or self-hosted) | Custom AI agent | |
|---|---|---|
| Time to first version | Hours to days | 2–4 weeks for a scoped build |
| Upfront cost | Low | Higher |
| Evaluation and regression tests | Manual, limited | Automated, runs on every change |
| Version control and review | Limited on lower tiers | Standard Git workflow |
| LLM cost control | Basic | Caching, model routing, loop caps, per-run cost logs |
| Guardrails and approvals | Possible, manual | Built into the action layer |
| Who can change it | Ops team, no engineers needed | Engineers or a partner |
| Best for | Internal, standard, modest-risk workflows | Customer-facing, high-volume or high-risk agents |
n8n vs LangGraph and other frameworks
"Custom" does not have to mean starting from nothing. Frameworks like LangGraph give you state, branching and human-in-the-loop steps in code, so you keep version control and tests. Whether to use a framework or a plain agent loop is its own decision, covered in LangGraph vs a Custom Agent Loop. The short version: n8n vs LangGraph is not a fair fight. One is a workflow tool your ops team can own. The other is a library your engineers own. Pick based on who will maintain it.
The hybrid that usually wins
The best setups are not either-or. They split the work:
- n8n stays as the glue. Triggers, scheduling, moving data between SaaS tools and notifications.
- The agent becomes a service. Reasoning, retrieval, tool calls and guardrails live in a small tested service behind an API.
- n8n calls that API with an HTTP node, like any other integration.
Your ops team keeps the flexibility they like. Your engineers get the tests, logs and cost controls they need. Nobody has to rewrite every automation.
How to migrate without breaking things
If you have decided to move a workflow off n8n, avoid a big-bang rewrite.
- Export real history. Pull a few hundred past executions, with inputs and the outputs people accepted. That is your first evaluation set.
- Build the agent service against that set. Do not ship until it matches or beats the current workflow on those examples.
- Run in shadow mode. Keep n8n live and send the same inputs to the new service. Compare outputs for a week or two.
- Cut over one path at a time. Swap the AI step in n8n for an HTTP call to the new service, and keep the old version as a fallback.
- Keep the evaluation set growing. Every bad answer in production becomes a new test case.
This is close to how we structure our workflow automation engagements: fixed scope, a measurable target, live in 2–4 weeks. For an example of pulling several systems into one reliable flow, see the multi-system reporting automation case study.
A quick decision checklist
Answer yes or no:
- Does the output reach a customer, or move money, without human review?
- Would a wrong answer cost more than an hour of someone's time to fix?
- Do you change prompts or models more than once a month?
- Is your LLM spend larger than your automation tool's subscription?
- Has anyone said "only one person understands that workflow"?
Zero or one yes: stay on n8n. Two or three: go hybrid and move the AI step into a tested service. Four or five: you need a custom agent.
Frequently asked questions
Is n8n good enough for AI agents?
For internal, standard, modest-risk workflows, yes. n8n's AI Agent node handles tool calling and memory well enough for many teams. It falls short when you need automated evaluation, strict guardrails, or tight control over LLM costs at volume.
When should I build a custom AI agent instead of using n8n?
When the agent's output reaches customers or money without review, when you need regression tests before each change, when the logic has outgrown the canvas, or when LLM costs, not the tool subscription, drive your bill.
Is self-hosted n8n free?
The Community Edition has no execution cap and runs on your own server under n8n's Sustainable Use License. You still pay for hosting, monitoring, upgrades and your team's time, and some features need a paid licence.
Can I use n8n and a custom agent together?
Yes, and it is often the best option. Keep n8n for triggers and integrations, and call a custom agent service through an HTTP node for the reasoning-heavy step.
How long does it take to move a workflow from n8n to a custom agent?
For a single scoped workflow, typically 2–4 weeks, including building an evaluation set from past executions and a shadow-mode period before cut-over.
Not sure which side of the line you are on? Take the Free Automation Scan and we will tell you which workflows to keep in n8n, which to move, and what a fixed-price build would look like.
Related: AI workflow automation · LangGraph vs a custom agent loop
Want a straight answer for your project?
Book a 30-minute call. I will tell you what I would do, and a fixed price if it makes sense.