AI coding agents such as Claude Code and Codex help teams write automation as ordinary code. That is a script with tests, started by a timer on a server. The secrets sit in a vault, and a health check raises an alarm when a run is missing. When developers maintain a workflow that is mostly code, this can be easier to review and test than a canvas full of code nodes. It does not make n8n obsolete. Webhooks, simple integrations and workflows that non-developers need to read still fit a visual tool well. So the more useful question is which job belongs where.
An example: an electrical wholesaler in Perugia with 40 employees uses n8n for its workflows. New orders from the web shop arrive in n8n through a webhook and go into the ERP, the software for orders, stock and invoices. Every night, a large workflow with many code nodes reconciles stock levels between the ERP and the web shop. Chiara from order processing looks in n8n when an order is missing. The external developer wants to rewrite everything as scripts with Claude Code.
Key takeaways
- Coding agents are now routine for developers. In JetBrains' 2026 survey of more than 15,000 professional developers, 90% used AI coding agents at work at least weekly.
- Agents can change the effort of writing and changing code. They do not remove the work of operating it. A script on a server still needs an owner, monitoring, secrets handling and a recovery plan.
- We found no survey that measures how many teams move workflows from n8n to code. There are individual accounts, and n8n reported strong growth in 2025. So treat "everyone is leaving n8n" as a claim that is not established as a fact.
- A practical split looks like this: n8n for incoming events and short integrations, code for scheduled jobs with much logic, tests or file and server access.
- Move a workflow only when you change it anyway, and run the new job in parallel ("shadow mode") until the results match.
01 / 09
Why does this question come up now?
Two things changed at the same time. First, coding agents became normal tools. JetBrains reports that 90% of the professional developers in its 2026 Developer Ecosystem Survey used coding agents at work at least weekly and 68% daily. So if your developer suggests working with an agent, that is normal today.
According to the same survey, Claude Code reached around 39% adoption at work in May to July 2026, up from 18% in January 2026. Stack Overflow's 2026 survey found that 73% of respondents who use AI coding assistants or agents use them daily.
Second, coding agents work well with plain text files, tests and a terminal. An agent can read a Python script, change it, run the tests and show a readable diff, meaning a view of what changed between the old and the new version. A large n8n workflow is stored as JSON with code embedded in nodes. An agent can edit it, but reviewing and testing the change is harder. The more code a workflow contains, the more this matters. For the nightly stock reconciliation in Perugia with its many code nodes, it matters more than for the short webhook for new orders.
02 / 09
Is the trend real?
The evidence confirms the parts, but not the whole pattern.
| Evidence | What it shows | What it does not show |
|---|---|---|
| Developer surveys (JetBrains, Stack Overflow, 2026) | Coding agents are used daily by most developers who use them | How many teams replace workflow tools with code |
| Practitioner accounts, for example a user who moved CRM syncs, emails and lead scoring from n8n to Cloudflare Workflows (forum post, December 2025) | Real reasons: Git versioning, unit tests, operating effort | That the move is common, or that it paid off |
| Vendors such as Trigger.dev publish rules and an MCP server so coding agents can write and deploy background jobs | The "agent writes the job as code" pattern is supported | Independent adoption figures |
| In its Series C announcement (October 2025), n8n reported 6x user growth and 10x revenue growth that year; SAP announced an embedded n8n environment in Joule Studio in May 2026 | n8n grew strongly in 2025 and gained a large distribution partner in 2026 | That n8n fits every workflow |
n8n is also moving towards coding agents. In April 2026, n8n announced a public preview in which its MCP server builds and updates workflows from Claude Code, Codex and other clients. So your developer can also edit n8n workflows with an agent.
n8n also offers Git-based environments on its Business and Enterprise plans. Enterprise adds external secret stores. So a vault or Git alone is not a reason to leave n8n.
03 / 09
What does "automation as code" mean in practice?
The pattern we use has five parts, and none of them is new. A coding agent helps with drafting and changing the code and configuration for all five.
| Part | Typical choice | Purpose |
|---|---|---|
| Job | A Python or TypeScript script with tests, in Git | The logic, reviewable as a diff |
| Schedule | A systemd timer or cron on a server, or a managed job runner | Runs the job at fixed times |
| Secrets | A vault such as Azure Key Vault, AWS Secrets Manager or 1Password | No tokens in files or environment variables on disk |
| Infrastructure | Terraform or OpenTofu | Server, permissions and vault access are reproducible |
| Monitoring | A heartbeat service such as Healthchecks | Alarm when a run fails, takes too long or does not happen |
For our invented example business, the wholesaler in Perugia, that would mean the stock reconciliation is a script that starts at the same time every night. The secrets for the ERP and the web shop sit in the vault instead of in the script. And if the run is missing one night, an alarm arrives in the morning.
Note what the AI agent does here. It writes and changes the code, but it does not run the business process itself. The job follows fixed rules and does not ask an AI model to choose actions at runtime. That is a different pattern from scheduled AI agents that decide at runtime, such as Claude Code routines. Such agents can be useful, but they are harder to test and to audit.
04 / 09
When does a workflow belong in n8n, and when in code?
This is the rule we wrote down for a client project in October 2026, after an inventory of about two dozen active n8n workflows:
| Fits n8n | Fits a job in code |
|---|---|
| Incoming events: CRM webhooks, form submissions, email triggers | Scheduled reconciliations with much logic, for example hourly or nightly syncs between two systems |
| Short integrations with little code | Workflows that are mostly code nodes |
| Flows that non-developers need to read or adjust | Jobs that need tests, file system or server access |
| Prototypes and processes that still change every week | Jobs that need their own proof of every run |
Put your own workflows next to this rule. At the invented wholesaler in Perugia from our example, the webhook for new orders fits n8n, because it is short and Chiara has to be able to read it. The nightly stock reconciliation with its many code nodes fits a job in code better.
Two more questions often decide the case.
- Who maintains it? If nobody on your side reads code, a visual workflow is easier to hand over. If only one person maintains the code, that is a continuity risk. In Perugia, that would be the external developer alone. Plan a second person or a supplier with a documented handover.
- Who carries operations? A server is your responsibility, with updates, backups, logs and alarms. n8n Cloud removes part of this. A script on your own server adds that part back.
Got a workflow like this?
Tell me about it. Honest take and a rough price, usually within a day.
05 / 09
How do you lower the risk of a move?
We do not rebuild a working workflow because of a rule. A workflow moves when it needs a larger change anyway. Then we proceed like this:
- Write the job with the agent, including tests. Give the agent the exported workflow, the expected inputs and outputs, and known edge cases. Ask for tests before the switch.
- Run in shadow mode. The new job runs next to n8n on the same schedule but writes nothing. It only records what it would do.
- Compare the results. A small comparison script checks the shadow results against what n8n actually did. Switch only after several test runs that match, including at least one edge case.
- Have the change reviewed. Every change gets a second review before it goes live. In our projects a second AI model checks the diff, and a person approves the switch.
- Switch and keep the alarm. Turn on the job's write mode, deactivate the n8n workflow, and check that the heartbeat arrives.
In the client project for which we wrote down the rule above, four scheduled jobs moved this way in October 2026, each after matching shadow runs. Webhook workflows stayed in n8n.
06 / 09
What are the risks of code-first automation?
Even after a clean move, things can go wrong, just in other places than in n8n.
- Silent failures still exist. A heartbeat tells you that a job ran. It does not tell you whether the business result is correct. Suppose the stock reconciliation in Perugia runs on time every night, but because of a bug it does not transfer some of the items. The alarm stays silent, and Chiara only notices when a customer orders something that is no longer in stock. So you still need checks such as "expected records arrived", as described in our article on n8n maintenance and monitoring.
- Retries are your job. If a run breaks off and starts again, it must not carry out the same action twice. A script does not take care of that by itself. The details are below in "For your IT team".
- Terraform state can contain secrets. The file in which your IT team records how the servers are set up can also contain secret values such as passwords. More on this below as well.
- Fast to write is not the same as reviewed. An agent produces plausible code quickly. Without tests, review and a shadow run, it produces plausible errors just as quickly.
07 / 09
For your IT team
A serverless function or a script does not retry safely by itself. AWS points out that retried code must tolerate repeated events without duplicate actions. The same applies to n8n retries.
The Terraform state is the file in which Terraform records what it has set up. AWS warns that sensitive values can appear in plain text in the state file. Protect and encrypt this file.
08 / 09
Take the decision list
Before you move a workflow, answer these questions in writing:
- Is the workflow mostly code, and does it run on a schedule?
- Does it need a larger change in the next weeks anyway?
- Who reviews changes, and who takes over if that person is away?
- Where do the secrets live, and who can read them?
- How do you notice a missing run, and how do you notice a wrong result?
- What did the shadow run show, and who approved the switch?
09 / 09
Related decisions
- n8n implementation and workflow operations
- Maintain n8n workflows with business-level monitoring
- Credentials and access rights in n8n
- MCP servers for business
If you want to know which of your workflows should stay in n8n and which should move, start with a list of the workflows, their schedules and their recent errors. Discuss it with modernagents.



