Skip to content
← All articles
10 min read

n8n vs custom code: when n8n is enough and when to write a service

n8n is enough while the workflow is short, the data is small, a failed run costs little and one person understands it. Write code when the flow carries money or orders, needs tests, strict retries and review, or has grown into a system. Below: limits, versioning, testing, secrets, ownership cost and a checklist.

What n8n does well, and why that matters

n8n is a workflow tool. You connect triggers and nodes on a canvas: a webhook, a schedule, an HTTP request, a database, a messenger. For glue between SaaS products it is hard to beat. A form submission lands in a table, a message goes to Telegram, a row is added to a CRM. You get this in an afternoon, and a non-developer can read the result.

That speed is the real value. When you do not yet know whether a process is worth automating, writing a service is premature. A workflow on a canvas is a cheap experiment. If the process dies, you delete it. If it lives, you learn what it actually needs, and that knowledge is what you carry into code later.

So the honest question is not which tool is better. It is which tool fits this process at this stage. The rest of the article gives criteria for answering it.

Where the limits of n8n show up

Limits rarely appear on day one. They appear when volume, importance or the number of people grows. Here are the places where we see teams hit the wall, using what the official n8n documentation says.

By default n8n runs executions inside the main process. For heavier loads it has queue mode: the main instance receives triggers and webhooks, Redis holds the queue, and separate workers run the executions against a shared database; the docs say running a distributed setup over SQLite is not supported, so you need a separate database such as PostgreSQL. That works, but it is now an architecture you operate: Redis, workers, a database, upgrades. Concurrency can be capped with a setting, and extra production executions wait in a first-in, first-out queue. Queued executions cannot be retried, so you must know what happens to a burst of webhooks.

  • Throughput and bursts: a spike of webhooks needs queue mode, Redis and workers, which you then run and monitor yourself.
  • Long and stateful processes: a multi-day approval or a saga with compensation is possible, but the state lives in execution data, not in your own tables.
  • Complex logic: branching with many exceptions turns into a canvas nobody can read. The Code node helps, but it is code without a normal project around it.
  • Code node limits: on self-hosted n8n you can enable external npm modules; on n8n Cloud you cannot import them. The Code node also has no direct file system or HTTP access.
  • Shared data model: when five workflows write to the same entities, there is no schema and no constraints, only conventions.

Versioning, review and environments

In a code project a change is a commit: it has an author, a diff, a review and a revert. A workflow is stored as a JSON document inside the n8n database. You can export it and commit the file, but the diff of a canvas is hard to review, and nothing stops a colleague from editing the production workflow in the browser at five in the evening.

n8n does have a Git-based mechanism: instances are linked to a Git repository. According to the docs it is available on the Business and Enterprise plans, and pushing and pulling is limited to instance owners and admins (project admins can push, not pull). If you run the free self-hosted edition, plan your own discipline: exports in Git, one person who deploys, a written rule about editing production.

With a service the same thing is routine. A pull request, CI, a staging environment, a deploy that can be rolled back. If you have ever needed to answer the question what changed last Tuesday and why the orders stopped, you know why this matters. We cover the deploy side in zero-downtime deploys for small teams.

Testing and error handling

A Go service is tested at several levels: unit tests for rules, integration tests against a real Postgres, contract tests against a recorded API response. A failing test blocks the release. A workflow on a canvas is usually tested by running it by hand with sample data. n8n lets you re-run and debug past executions with their data, which is useful, but it is not a regression suite that runs on every change. Our approach to the code side is in testing a Go backend.

For errors n8n offers an error workflow: you pick it in the workflow settings, it starts with an Error Trigger node and receives the execution ID, the message, the last node and the workflow name. A Stop and Error node lets you fail deliberately. This is a solid alert mechanism. What it does not give you for free is the delivery guarantee: deduplication, a retry policy with backoff, a dead-letter store, and a way to replay one failed event after a fix.

Those properties are the core of reliable integrations: idempotency and retries, queues and background jobs and signature checks on incoming webhooks. You can build them in n8n with care, node by node. In a service they are a shared library written once and tested once.

Secrets, access and the license

n8n stores credentials in its database, encrypted with a key. The docs describe N8N_ENCRYPTION_KEY as the key used to encrypt credentials; if you do not set it, n8n generates one on first start and keeps it in its user folder. Practical consequences: back up the key separately from the database, set it explicitly, and never lose it, because without it saved credentials cannot be decrypted. Anyone with editor access to the instance can build a workflow that uses a credential, so access control is part of your threat model.

In a service, secrets come from the environment or a secret manager, are never in the repository, and each integration gets its own narrowly scoped key. The surface is smaller: no editor UI, no community nodes from unknown authors running with access to your tokens. Community nodes are a real point to check before installing them.

The license is worth a read too. n8n is distributed under its own Sustainable Use License rather than a standard open-source one. As we read the license text, use for your own internal business purposes is allowed, while distributing the software or offering it to others is limited to free, non-commercial cases, and files marked .ee fall under a separate enterprise license. If you plan to embed n8n in a product you sell, or host it for customers, do not rely on our summary: check the current terms on the official n8n site and ask n8n or a lawyer.

Cost of ownership without numbers

Comparing cost by the price of a subscription is misleading. Think in categories. For n8n: the hosting or cloud plan, the time to maintain the instance (updates, backups, queue mode if you need it), the time of whoever understands the canvases, and the cost of an incident in a flow that nobody tested. For a service: the initial development, hosting that is usually modest, and the ongoing work of changing and supporting code.

The curve differs. n8n is cheap at the start and its cost grows with the number and importance of workflows, mostly as hidden operations work and fear of touching things. A service is more expensive at the start and is flatter afterwards, because changes are reviewed, tested and deployed in a standard way. Where the lines cross depends on the process, and we will not invent a number for it.

A useful test: ask how long it would take a new person to safely change the flow. If the answer is only the author knows, the cost is already higher than it looks. If you also have no monitoring, see monitoring after launch.

A checklist: stay on n8n or write a Go service

Use these criteria on the specific process, not on the tool in general. Count the points in each column. Several points in the code column on one critical flow are enough to move that flow, while the rest of your automations can stay where they are.

A hybrid is normal and often best. Keep n8n for notifications, internal reports and prototypes, and move the money path, the order sync or the customer-facing API into a service. n8n can still call that service over HTTP, so the migration can happen one flow at a time.

  • Stay on n8n: the flow has a few steps, one owner understands it, a lost or delayed run costs little, volume is small and steady.
  • Stay on n8n: it is internal glue between SaaS tools, an alert, a report or a prototype that may be thrown away.
  • Stay on n8n: you can fix failures by hand and nobody is harmed if a run is replayed twice.
  • Write a service: the flow moves money, stock or customer orders and must not duplicate or lose events.
  • Write a service: you need automated tests, code review, staging and a rollback you trust.
  • Write a service: several flows share one data model, or the logic has many branches and exceptions.
  • Write a service: load comes in bursts, you need strict ordering, rate limits to partner APIs or long-lived state.
  • Write a service: security rules require a limited access surface, audit trails and no third-party nodes near tokens.

When you do not need a developer, and when you do

You do not need a contractor if the automation is a handful of steps, you or your team can maintain it, and a failure is an inconvenience. Install n8n, keep the encryption key and a backup, export workflows to Git, and move on. Paying for a service you do not need is its own kind of waste. If your task is closer to a broad process review, start with the business process automation guide rather than with tools.

A developer becomes useful when you notice the signals: the same flow breaks every few weeks, nobody dares to change it, duplicates appear, the flow is on the critical path of sales or fulfilment, or you cannot say what changed before the last failure. At that point rewriting only the critical flow as a small Go service is usually enough; see why Go for a backend and the broader picture in API design for integrations.

If you want an outside view, an integration service review can map your existing workflows, point out which ones are fine and which ones deserve code. A good outcome of such a review is sometimes: leave everything as it is.

Questions

FAQ

Didn't find an answer — ask on the call or in Telegram.

n8n vs custom code: which is better?

Neither wins in general: it depends on the specific flow. n8n is better for short, low-risk flows and prototypes you want in hours. Custom code is better when a flow carries money or orders, needs tests, review and strict retries, or has grown complex. Many teams keep both and move only the critical flows into a service.

When is n8n not enough?

When bursts of load need queue mode and workers you must run, when the logic becomes too tangled to read on a canvas, when you need automated tests and code review, or when a duplicated or lost run is costly. Those are signals to move that flow into code.

Can n8n replace a backend developer?

For glue between SaaS tools, often yes. For a product backend with its own data model, user access, billing or a public API, no. n8n is a good orchestrator, but it is not a place to keep a domain model with constraints and tests.

Is n8n free to use for business?

n8n is distributed under its own Sustainable Use License, not a standard open-source one. Its text allows use for your own internal business purposes, but limits distributing the software or offering it to others. Check the current terms on the official n8n website before embedding or reselling it.

How do you test and version n8n workflows?

You can export workflows as JSON to Git and re-run past executions with their data to debug. Git-based environments are documented for the Business and Enterprise plans. There is no built-in regression suite like unit tests, so teams add checks by hand.

How do you migrate from n8n to a Go service?

Move one flow at a time. Write the service for the critical flow, expose it over HTTP, and let the existing workflow call it. Keep the old flow running in parallel, compare results, then switch it off. Everything else can stay in n8n.

Related service

CRM, ERP and API integrations built for your workflows

When teams copy data between systems by hand, delays and mistakes become part of the process. We automate the exchange and make its status visible to the people running it.

Learn about the service
Other articles
Contact

Shall we discuss your task?

Thirty minutes on a call — and you understand the architecture, timeline and engagement format. No obligations.

Or message us on Telegram →Follow our Telegram channel →

Enter your Telegram or email so we can reply.

We reply within 15 minutes.