n8n or code your AI agent writes: the cost was never the writing
There is a new version of an old question doing the rounds: why pay for an automation platform when an AI coding agent — Claude Code, OpenAI's Codex — will write the integration in an afternoon? The uncomfortable part for the platforms is that it is a fair question. The afternoon script is real. Point an agent at "pull new Stripe charges, enrich them, post to our ledger and Slack," and it will produce working code before lunch.
The trap is thinking the script is the deliverable. It is not, and it never was. The cost of an integration was never mostly the writing.
What you are actually buying from n8n
Strip away the visual editor and n8n is a pile of operational scaffolding that has nothing to do with your business logic and everything to do with keeping an integration alive in production. That scaffolding is the product.
| Concern | n8n gives you | The bare AI-written script leaves you to build |
|---|---|---|
| Connectors & auth | Hundreds of prebuilt integrations with OAuth handled, including token refresh | Each API client, and the token refresh nobody remembers until it silently expires |
| Failure handling | Retries, backoff, and error workflows as configuration | Your own retry logic, idempotency, and dead-letter path |
| Observability | Every execution stored and inspectable, input and output | Logging, and somewhere to read it |
| Secrets | A credential store separate from the workflow | A decision about where the API key lives that is not "in the source" |
| Runtime | Schedulers, webhooks and a queue that is always on | A host, a process manager, and a webhook endpoint you operate |
| Change later | A flow a non-developer can read and edit | A codebase only a developer can touch |
None of that is the logic. All of it is the reason the integration still works in six months.
What the AI-written code actually gives you
The other column is not empty, and AI made it stronger. Bespoke code has no node that "cannot quite do that" and no platform to be locked into. It lives in your own repository and infrastructure, inside your data boundary, testable in CI and reviewable in a pull request like anything else. For logic that is genuinely yours — a pricing rule, a matching algorithm, a transformation no connector models — code is the honest answer.
What changed is the price of producing it. The old "custom code is expensive to write and maintain" objection has lost half its force: an agent writes the first version fast, will write the tests if you ask, and explains itself in the PR. That is real, and it moves the line.
The honest reframe
It moves the line; it does not erase it. The comparison was never "visual versus code." It is "buy the runtime and the plumbing, or build and operate them yourself." AI collapsed the cost of the first draft. It did not collapse the cost of running the thing for two years.
A naive generated script is the tell. It has no retries, so it drops the one webhook that arrived during a deploy. It logs nothing, so when a record goes missing there is no way to see what happened. It puts the API key in the source because nobody told the agent where secrets live. And it dies silently the first time an API returns 429 or an OAuth token hits its expiry — exactly the boring, unglamorous work n8n front-loads for you. An agent can write all of that scaffolding too, if you ask for it specifically and know to ask. But then someone owns that scaffolding forever, and "who operates this in six months" is the actual question underneath the whole comparison.
When the code your agent writes is the right call
- •The logic is too custom, stateful, or performance-sensitive for a chain of nodes.
- •Throughput or latency needs outgrow what an off-the-shelf workflow runtime does efficiently. (This is about efficiency, not n8n's bill: self-hosted n8n has no per-execution meter, so "the meter hurts" is a Cloud-plan argument, not a reason to write code on its own.)
- •It has to live inside existing infrastructure — your repo, your queue, your observability — rather than beside it.
- •Data cannot leave your boundary for a third-party SaaS.
- •You already have engineers who operate code: monitoring, on-call, and CI are not new things you are taking on.
When n8n (or any automation platform) is the right call
- •It is standard connector glue: move data between systems that already have nodes.
- •A non-developer in operations needs to see what it does and change it without a deploy.
- •You want retries, execution history and a credential store out of the box, not as a project.
- •Volume is low to moderate and speed to a first working flow matters more than squeezing efficiency.
- •You do not want to own another always-on runtime — and self-hosting n8n's free Community Edition (no execution limits) is scaffolding you are happy to run once for everything.
The hybrid almost everyone misses
These are not exclusive. The strongest pattern we deploy is n8n for the orchestration, connectors and operational layer, with the hard, bespoke logic in a Code node or a small service it calls — so the platform handles auth, retries and history while your code does the part that is actually yours. And the AI agent is useful on both sides of the line: generating the custom service, and generating n8n custom nodes and workflows.
How we decide
The question is no longer "can AI write it." It can. The question is who operates it in six months, and where it has to live. If the answer is "someone in ops, who needs to see it and change it," that is n8n, and the AI agent helps build the awkward node. If the answer is "our engineers, in our infrastructure, where the monitoring and the on-call already exist," that is code, and the agent makes it cheap to produce. We build both, and the reason we are usually called is the same either way — and the same reason teams bring us in once they have exhausted the AI-assisted path: not to write the automation, that part is cheap now, but to make it one that still runs, and that someone can still change, long after the afternoon it was written.
Deciding between a platform and bespoke automation?
We build business automation both ways — n8n, Make and Zapier where a platform fits, bespoke code where it does not — and, either way, make it something that still runs and that someone can still change. €65/hour, fixed-scope quotes for projects.