n8n vs trigger.dev: When a Workflow Needs Real Code
n8n and trigger.dev solve different shapes of problem. Four signals tell you a workflow has outgrown a visual builder, and most production setups end up running both.
TL;DR
n8n and trigger.dev are not competitors so much as answers to differently shaped problems. n8n is a visual workflow builder that fits integration-shaped work, where the job is connecting services and the team benefits from seeing and editing the flow, and it wins on self-hosting, unlimited executions and breadth of connectors. trigger.dev is a code-first framework for background jobs written in TypeScript, and it fits when the workflow is long-running, needs durable execution that survives restarts, needs genuine version control and testing, or needs observability beyond a failure notification. Four signals mark the boundary: run duration, version control, testability, and observability. Any one of them is enough to move that piece into code. In practice most production setups run both, with n8n owning the integration surface and calling trigger.dev for the parts that must not be fragile.
They solve differently shaped problems
We wrote about choosing between n8n, Make and Zapier previously. That comparison stops exactly where this one starts, because all three are visual builders and the real question here is when none of them is the right shape.
The distinction that matters is whether the work is integration-shaped or code-shaped.
Integration-shaped work is mostly plumbing. A form is submitted, so create a CRM record, notify a channel, add a row, send an email. The logic is thin and the value is in the connections. A visual canvas is genuinely the best representation of that, because the picture is the documentation and a non-developer can look at it and understand what happens.
Code-shaped work has thin plumbing and thick logic. It loops, it branches on conditions that are awkward to draw, it runs long enough that failure mid-way matters, and it needs to be tested before it touches real data. Drawing that on a canvas produces a diagram nobody can read and nobody can test.
Where n8n is the right answer
n8n is the default for most business automation, and that is not a compromise.
It wins on self-hosting, which matters when data cannot leave your infrastructure for regulatory or contractual reasons, and it removes per-task pricing entirely: unlimited executions on hardware you already pay for. For a workflow that fires thousands of times a day, that difference is the whole business case.
It wins on team visibility. A canvas your operations lead can open, follow and edit is worth more than elegance. Automation that only one developer understands becomes a liability the moment that developer is on holiday.
And it wins on breadth. Hundreds of integrations already exist, with authentication handled. Writing that glue yourself is work that produces no differentiated value.
Four signals that a workflow has outgrown the canvas
You do not migrate a whole automation estate. You notice a specific workflow straining, and one of these four signals is usually enough.
Duration. The workflow runs long enough that a timeout or a mid-run failure is a business problem rather than an annoyance. Anything waiting on a slow external system, processing a large batch, or resuming after a restart lands here.
Version control. You need code review, a diff of what changed and why, and the ability to roll back. Visual builders can export JSON, but reviewing a workflow diff as JSON is not code review, it is archaeology.
Testability. You need to run the workflow against test data before it touches production. If your only test environment is production with a flag, this signal is already firing.
Observability. You need to know which step failed, on which input, how many times it retried, and how long each step took. "The workflow errored" is not enough to operate on.
Where trigger.dev takes over
trigger.dev is a framework for writing background jobs in TypeScript, and what it buys is exactly the four things above.
Durable execution is the headline. A job checkpoints its progress, so a restart resumes where it stopped instead of replaying completed steps. For anything long-running or expensive, that is the difference between a retry being safe and a retry being a second charge on a customer's card.
The rest follows from it being code. It lives in your repository, goes through pull requests, gets tested in CI, and produces structured logs per step. Prompt versioning and evaluation harnesses for AI steps are ordinary code concerns rather than things you bolt on.
The cost is honest and worth stating: it is code, so it needs a developer. Your operations lead can no longer open a canvas and see what happens. You trade visibility for durability, which is a good trade for the workflows that need it and a bad one for the workflows that do not.
The comparison, condensed
| Factor | n8n | trigger.dev |
|---|---|---|
| Shape of work | Integration-shaped, thin logic | Code-shaped, thick logic |
| Who can edit it | Anyone who can read a canvas | A developer |
| Long-running jobs | Runs them; durability is the weak point | Durable execution with checkpointing |
| Version control | JSON export, awkward to review | Native, it is a repository |
| Testing | Limited, often against production | Standard test tooling and CI |
| Self-hosting | Yes, unlimited executions | Yes, plus a managed cloud option |
| Integration breadth | Hundreds of ready connectors | You write the client, or call one |
Running both is the normal answer
The framing that helps most clients is that these are layers, not alternatives.
n8n owns the integration surface: the triggers from forms, CRMs and webhooks, the routing between services, the notifications. It stays visible, and the operations team keeps a live map of the process without reading code.
trigger.dev owns the parts that must not be fragile. When n8n reaches a step that is long-running, expensive, or needs to be tested before it runs for real, it calls a trigger.dev job and waits for a result. The boundary is a single node on the canvas.
That split gives you both properties: the team can still see the process end to end, and the risky twenty percent lives in reviewed, tested, observable code.
How to decide in practice
Ask three questions about the specific workflow, not about your stack.
- If this fails halfway through, is that expensive? Money, duplicated customer-facing actions, corrupted data. If yes, it needs durable execution.
- Would I be comfortable if this shipped without review or tests? If no, it needs to live in a repository.
- Does anyone outside engineering need to understand or change it? If yes, keep the visible parts visible and push only the risky step into code.
Most workflows answer no, yes, yes and stay in n8n. The ones that answer yes to the first question are the ones worth moving, and usually only in part.
If you want that assessment done on your actual processes rather than in the abstract, that is what the audit at the front of a workflow automation engagement is for. We map what you run today before recommending anything, because the tool is the last decision, not the first.
Frequently asked questions
-
Is trigger.dev a replacement for n8n?
No, and treating it as one leads to bad architecture. n8n is a visual workflow builder for integration-shaped work, where the value is connecting services and letting a team see and edit the flow. trigger.dev is a framework for writing background jobs in TypeScript, where the value is version control, testing, and durable long-running execution. Replacing n8n with trigger.dev means turning every simple integration into a code deployment, which is slower for the eighty percent of workflows that were fine visually. Most production setups run both, with a clear boundary between them.
-
When should I stop using a visual workflow tool?
Four signals, and one is usually enough. The workflow runs long enough that a timeout or a mid-run failure is a real business problem. You need genuine version control, meaning code review and the ability to see what changed and roll back. You need to test the workflow before it touches production data. Or you need observability past "it failed", such as knowing which step, on which input, how many times. Visual builders can approximate all four; a code-first framework treats them as the default.
-
Can n8n handle long-running jobs?
It can run them, but durability is the weak point. n8n executes a workflow as a run that has to survive the process; a job that waits hours for an external system, or that needs to resume exactly where it stopped after a restart, is asking for something the model does not naturally provide. trigger.dev is built for exactly this, with durable execution that checkpoints progress and resumes without replaying completed steps. If your workflow is measured in minutes, n8n is fine. If it is measured in hours and cannot afford to start over, it is not.
-
Which is better for AI agent workflows?
It depends on how much the agent is trusted to do. For a single classification or drafting step inside a larger integration flow, n8n is the pragmatic answer and keeps the whole thing visible to the team. For an agent that loops, calls tools, retries, and runs long enough to need checkpointing, trigger.dev fits better because prompt versioning, an evaluation harness and step-level retries are code concerns. The dividing question is whether the AI is one step in a workflow or the workflow itself.
-
Can you use both together?
Yes, and it is the setup we reach for most often. n8n handles the integration surface: triggers from a form, a CRM, a webhook, and the routing between services that a non-developer can inspect. When a step needs durability, real testing or heavy logic, n8n calls a trigger.dev job and gets a result back. The team keeps a visual map of the process, and the parts that would be fragile in a visual builder live in reviewed, tested code.
Want the playbook before your competitors do?
We document every technique we apply on engagements. New posts on GEO, AEO, and web performance ship monthly. No fluff, just methods.
More articles
- n8nWorkflow Automation
AI Automation for Small Business: Automate the Simple Processes First
A process-first playbook for small businesses: a 3-question test to pick the right task, three starter AI automations end to end, and where they go wrong.
Read article - n8nWorkflow Automation
n8n vs Make vs Zapier: Which Automation Tool to Choose in 2026
n8n vs Make vs Zapier compared head to head: choose the right automation tool by budget, hosting, team skill, and run volume, with the one-line decision rule for each platform.
Read article