PHII Labs

AI Automation2 October 2026 · 9 min read

n8n vs custom AI agent: when n8n stops scaling

When n8n is enough and when it stops scaling: branching conversations, state, evaluation and the point where custom code costs less

Sergei · PHII Labs · Updated 2026-10-16

Workflow canvas on the left diverging into custom agent code on the right

n8n is the right tool for a linear workflow that pulls a lead from a form, enriches it, writes it to a CRM and notifies a human. It stops scaling when the work turns conversational. Branching, state and model evaluation are hard to follow on a canvas, and on n8n's hosted plans every incoming message becomes its own execution. Past that point, custom code costs less

We've built both. The real-estate inventory system we shipped has routing that would be a small n8n canvas if it were simpler, and it isn't. Below is where we draw the line, the failure modes that force it, and the decision table we use when a client walks in and asks, "Can you just do this in n8n?"

What is n8n actually good at?

n8n shines at straight-through processing: a trigger, a transformation, a destination, and no human decisions in the middle. Typical cases we're happy to call n8n territory include a Google Sheet row that becomes a HubSpot contact, a Property Finder enquiry that lands in a WhatsApp thread and a CRM, and a daily digest that pulls from several sources and emails the result. Each step is a fixed node, the data moves in one direction, and any failure shows up on the canvas

This is the work the tool was built for, and it's often the fastest right answer. For a one-directional job with five to fifteen nodes, an n8n flow is cheaper to build than the equivalent code, and easier for a non-engineer to inspect. Custom code there is overhead with no payoff

When does n8n stop scaling?

It stops scaling when the workflow stops being a flow and becomes a conversation. Three changes mark the boundary

State comes first. A linear flow carries each document through once. A conversational agent keeps a thread open. It remembers what the customer has already answered, which offer they saw, and whether they're qualified yet. That state has to live somewhere the flow can query mid-run, and every node that reads or writes it adds coupling you then debug from the canvas

Branching is second. Real lead qualification forks. An Arabic-speaking buyer on WhatsApp follows one path, a caller with a budget cap follows another, a tenant renewing follows a third. Each branch doubles the routing nodes, and the evaluator that picks the branch is itself a node that can misfire. The canvas turns into a maze

Evaluation is third. When an agent has to decide whether to escalate to a human, or whether an extraction is confident enough to file, the logic isn't something you can see in a node. It's a model call with a threshold, and the threshold needs iteration. Iterating on model output belongs in a code loop

What are the failure modes of an n8n agent?

The clearest signal is visual. When your canvas has more routing nodes than work nodes (more switches, conditionals and error handlers than steps that transform data), the flow has stopped being a pipeline and started pretending to be a program. n8n can express branching, but it does so as a sprawl that's hard to test, hard to version, and hard to explain to the next person who opens the editor

Testing is the problem nobody sees at first. With a linear flow, you run one happy-path sample and a couple of error samples and you're done. A branching conversational agent needs a test set of a hundred conversations with known outcomes, so a change to a prompt or a threshold doesn't silently break qualification. Building that test harness inside a canvas is painful. In code, it's a CI job that runs on every pull request

Pricing works differently from what many people assume. n8n's hosted plans include a fixed number of workflow executions a month, and one execution is one full run of a workflow, however many nodes it has (n8n pricing). The self-hosted Community edition is free; you pay for the server and for whoever keeps it running. Cost shows up in a conversational design, where each incoming message usually triggers its own run, so a ten-message qualification chat uses ten executions on a hosted plan. For a channel that answers hundreds of leads a day, that pushes you up the plan tiers, while the model tokens cost the same on either side.

The decision table: n8n or custom?

This is the table we use on scoping calls. Ask the six questions; the answers put the workflow on one side of the line or the other

Questionn8n (workflow tool)Custom agent
Does the data move one way, once?YesOverkill
Does the conversation branch and hold state across turns?Sprawl, hard to testNatural fit
Do you need a test suite run in CI before changes ship?Painful in canvasStandard practice
Is execution volume large enough that pricing matters?Hosted plan execution cap, or self-host the free Community editionPay per model call
Does it touch customer data or money where a bug is costly?Fine for low blast radiusOwn the failure surface
Will a second engineer need to reason about it in six months?Canvas can be readCode can be reviewed

There's a shortcut that covers all six questions. Count the nodes. When routing and error-handling nodes outnumber the nodes that transform data, the workflow has crossed into agent territory. That's the point to stop extending the canvas and start writing code

How much does each approach cost in Dubai?

n8n is cheaper to start and a custom agent is cheaper to run. Where they cross depends on conversation volume and how many edge cases you have. For a linear intake flow handling a few hundred records a month, n8n is the right spend. For a WhatsApp qualification bot answering several hundred leads a day, with Arabic and English branches and a human-escalation loop, recurring execution costs and the testing burden push the total toward a custom build

We put the build-side AED numbers for both paths in how much AI automation costs in Dubai, and the ongoing model, hosting and retainer costs in what AI systems cost to run after launch. The running-cost line is where the two curves cross. What a custom build with us includes is on AI automation services in Dubai

In the inventory CRM we shipped, the routing that decides which agent sees a lead and whether a change needs human approval sits in about a hundred and fifty lines of code, versioned and tested. The same logic as an n8n canvas would take two screens of nodes and a debugging session every time someone touched it

Sergei · PHII Labs

Can n8n and custom code share one system?

Yes, and it's the setup we increasingly recommend over an either-or. Use n8n for the parts that are linear (the integrations, the schedules, the CRM writes, the notifications) and let a custom service own the parts that branch, hold state, or evaluate model output

In a typical split, n8n watches the webhook and the queue, calls the custom conversation service when a message arrives, and writes the final outcome back to the CRM. The custom service owns the conversation logic, the escalation decision and the test set. One rule draws the boundary. State and branching live in code, and plumbing lives in n8n

This matches how we think about agent systems overall, where ingest and act work fine as workflow nodes and reason and route are better as tested code

When does the crossover happen for a Dubai business?

Look at the failure surface. A Dubai brokerage with portal leads from Property Finder and Bayut and bilingual WhatsApp qualification is running a decision-heavy, stateful workload where every conversation branches. That's custom-agent territory, and it's also where the agency-vs-custom decision lands. Customer-facing, multi-system work justifies the bigger build

Wherever your conversations touch personal data (buyer names, phone numbers, an Emirates ID on a document), the storage and deletion paths fall under the UAE PDPL (Federal Decree-Law No. 45 of 2021), whichever side of the line you pick. A canvas and a codebase both need a data-flow map. That's a requirement of the system, not of the tool.

The takeaway

Use n8n for the linear plumbing, and reach for a custom agent once conversations branch, hold state, or need evaluation you can test. The most reliable boundary is node count: when routing nodes outnumber work nodes, the canvas is no longer worth it. The cheapest path is usually both, with n8n for the integrations and tested code for the conversation

If you're not sure which side your workflow falls on, tell us about the workflow and we'll come back with a fixed-price estimate the same day

We build this for UAE businessesAI automation services in Dubai: agents and workflows

Questions people ask

Is n8n good enough for AI automation?

For linear workflows — intake, enrich, write to CRM, notify — n8n is often the fastest correct answer. It stops scaling when conversations branch, state gets complex, or you need model evaluation loops

When do you outgrow n8n?

When the workflow needs multi-turn reasoning, per-tenant configuration, sub-second latency at volume, or tests you can run in CI. The signal: your canvas has more routing nodes than work nodes

Is a custom AI agent more expensive than n8n?

Up front, yes; over time it depends. A custom build costs more to start but carries no per-execution pricing and handles edge cases n8n flows paper over. Self-hosted n8n Community edition is free, so its cost is the server and the upkeep

Can n8n and custom code coexist?

Yes, and often should: n8n handles integrations and schedules while a custom service owns the conversation logic. The boundary is where state and branching live

Sources

Find out what AI tells your buyers about you

We ask six AI engines 10 questions your buyers ask, then send you their answers and how to fix each problem. On WhatsApp, within 48 hours

10 questions like these

  • Best dental clinic near JLT?
  • Who does teeth whitening in Dubai Marina?
  • Dentist open late in JLT?
  • + 7 more

in each of 6 AI engines

  • ChatGPT
  • Gemini
  • Claude
  • Perplexity
  • Google AI
  • Grok

Example: a dental clinic