How n8n Works: Nodes, Triggers and the Execution Model
How the n8n execution model works: triggers, items, per-item node runs, execution order, pinned data, sub-workflows and what happens when a run waits.
Executive Summary: The n8n execution model is simpler than the canvas suggests. A trigger creates an execution, data moves between nodes as a list of JSON items, and most nodes run once per item. Branches run one at a time in canvas order, sub-workflows behave like function calls, and long waits move the execution out of memory. I walk through one execution from start to finish, covering triggers, items, execution order, node settings and where the execution actually runs, so your team can predict behaviour instead of guessing.
A workflow that worked perfectly in the editor sends 40 Slack messages in production instead of one. Nobody changed anything. The engineer who built it swears it only has five nodes.
This kind of surprise almost always comes from the same place: a gap between how people imagine the canvas works and how the n8n execution model actually works. Once you understand the model, the 40 messages make complete sense. More importantly, you can predict them before they happen.
This article follows a single execution from the moment a trigger fires to the moment the run is saved. It assumes you have built a few workflows already. If you are still deciding whether n8n is right for you, start with What is n8n? first.
Step 1: A Trigger Creates an Execution
Every production run in n8n starts with a trigger node. Triggers come in a few families, and each one starts work in a different way.
| Trigger type | Examples | How it starts a run |
|---|---|---|
| Webhook | Webhook, Form, Chat Trigger | An inbound HTTP request |
| Schedule | Schedule Trigger | A cron-style timer inside n8n |
| Polling | Many app triggers, such as a new row in a sheet | n8n checks the service at an interval and starts a run for new data |
| Event-based app triggers | Triggers that register a webhook with the service | The service pushes events to n8n |
| Internal | Execute Workflow Trigger, Error Trigger | Another workflow, or a failure elsewhere |
Production triggers only listen when a workflow is published. Since n8n 2.0, publishing is an explicit step that replaces the old active toggle. As a result, saving work in progress no longer changes what runs in production, which removes a whole class of accidental deployments.
When a trigger fires, n8n creates an execution record. That record holds the input, the output of every node and the final status. Everything that follows happens inside that single execution.
Step 2: Data Moves as Items
The core of the n8n execution model is the item, so this is the step to read twice. Every connection between two nodes carries an array of items, and each item is an object with a json property and, optionally, a binary property.
[
{ "json": { "id": 101, "email": "a@example.com" } },
{ "json": { "id": 102, "email": "b@example.com" } }
]
Most nodes then run once for each incoming item. If an HTTP Request node returns 40 records, the next Slack node sends 40 messages. There is no loop on the canvas, because the loop is built into the model. That is the explanation for the opening story.
This design is powerful. For example, you can fetch a list, transform each record and write each one to a database without writing any iteration logic. However, it means you must always know how many items are flowing into a node, especially one that costs money or sends notifications.
Shaping items with the Code node
The Code node makes item handling explicit. In “Run Once for All Items” mode, you receive every item and return a new array. This snippet fans a single webhook payload out into one item per order:
// Code node, mode: Run Once for All Items
const orders = $input.first().json.body.orders ?? [];
return orders.map(order => ({
json: {
id: order.id,
total: order.qty * order.price,
},
}));
Send it a body with three orders, and the next node runs three times. Send it an empty list, and the next node does not run at all, because zero items means zero executions of downstream nodes.
Item linking
n8n also tracks which input item produced which output item. This is called item linking, or paired items. It is what lets an expression such as {{ $('Webhook').item.json.body.customerId }} find the matching upstream value for the current item. When you build items manually in a Code node and lose that link, expressions that reference earlier nodes can fail with item-linking errors. The fix is to keep a reference to the source item or to fetch the value before the Code node.
Step 3: Execution Order Across Branches
Branching is where intuition about the n8n execution model breaks most often. An IF or Switch node splits items into separate outputs, and each output can lead to its own chain of nodes.
For workflows created in n8n 1.0 and later, n8n runs one branch to completion before it starts the next. It orders branches by their position on the canvas, from top to bottom, and left to right when two branches sit at the same height. The execution order documentation describes this rule and the older behaviour for legacy workflows.
Two practical consequences follow. First, moving a node on the canvas can change the order in which side effects happen. Second, a Merge node waits for its inputs, so it is the right tool when one branch depends on the result of another. If order matters to the business, make it explicit with a Merge node or a sequential chain instead of relying on layout.
Step 4: Node Settings Change the Model
Every node has a Settings tab. A few options there change how the n8n execution model treats that node.
- Execute Once makes the node run a single time using only the first item. It is useful for a summary notification after a batch.
- Always Output Data forces the node to emit an empty item when it would otherwise output nothing, so downstream nodes still run.
- Retry On Fail retries the node a set number of times with a wait between attempts. It is the first defence against flaky APIs.
- On Error decides what happens when the node fails: stop the workflow, continue with the error as regular output, or route the error to a separate error output.
The error output is the most underused option. It turns failures into data that you can log, alert on or retry, instead of a red execution that someone notices days later. I cover the full error handling pattern later in this series.
Step 5: Sub-Workflows Are Function Calls
As workflows grow, the Execute Workflow node lets one workflow call another. The child workflow starts with an Execute Workflow Trigger, receives items from the parent, and returns the items produced by its last node.
In the n8n execution model, think of this as a function call. The parent can wait for the result or continue immediately. Sub-workflows give you reuse, smaller canvases and clearer ownership, much like splitting a large service into modules. That design advice from my post on microservices architecture trade-offs applies here too: split along responsibilities, not just to make the canvas tidier.
n8n 2.0 fixed an important edge case. Previously, if a child workflow paused for a webhook, a form or a human approval, the parent received the wrong data. Now the parent receives the child’s real output after it resumes, which makes approval steps inside sub-workflows reliable.
Step 6: Waiting Without Holding Memory
Some workflows need to pause: wait two days before a follow-up, or wait for someone to click an approval link. The Wait node and the “send and wait” operations on many app nodes handle this.
Short waits keep the execution in memory. Longer waits, above 65 seconds according to the n8n 2.0 breaking changes guide, move the execution to the database and resume it later. Consequently, a paused workflow does not tie up a process, and it survives restarts as long as the database does.
Step 7: Where the Execution Actually Runs
By default, one n8n process does everything: serves the editor, receives webhooks, runs schedules and executes workflows. That is fine for small instances.
Two mechanisms change this picture. First, task runners execute Code node scripts in a separate, sandboxed process, and they are on by default since 2.0. Second, queue mode moves executions onto worker processes, with Redis passing jobs from the main instance to the workers. The main process then focuses on triggers and the editor while workers do the heavy lifting.
When the run finishes, the n8n execution model has one last step: it stores the execution data in the database. That record is what you see in the Executions list, and it is also what fills your disk if you never configure pruning.
Common Misreadings of the n8n Execution Model
A few misunderstandings come up in almost every workflow review I do. Each one has a simple correction.
| Assumption | What actually happens |
|---|---|
| “The Slack node runs once at the end.” | It runs once per incoming item unless you aggregate first or enable Execute Once. |
| “Branches run in parallel.” | They run one after another, in canvas order, within a single execution. |
| “An empty result is an error.” | Zero items is a valid state. Downstream nodes simply do not run. |
| “Retry on fail retries the workflow.” | It retries only that node, with the same input items. |
| “Saving deploys my change.” | Since 2.0, only publishing changes what production runs. |
None of these are bugs. They are design choices in the n8n execution model, and each one is reasonable once you know it. The problems start when a team learns them from an incident rather than from a review.
Testing the Model in Your Own Instance
The fastest way to internalise the n8n execution model is to watch it. Three habits help.
- Pin data. Pin a realistic payload on the trigger node, then rerun downstream nodes without calling external services each time.
- Read item counts. The editor shows how many items each node received and produced. Check them before every publish.
- Inspect production executions. Open a failed run from the Executions list and step through each node’s input and output.
The webhook trigger deserves its own article, because it is how most production workflows start. That is the next article in this series.
Frequently Asked Questions
Does every n8n node run once per item?
Most do. Exceptions include nodes in a “run once for all items” mode, nodes with Execute Once enabled and nodes that aggregate items, such as Merge or Aggregate.
Why did my workflow stop with no error?
Usually because a node output zero items. With no items, downstream nodes do not run. Enable Always Output Data on that node if later steps must run anyway.
What is an execution in n8n?
An execution is one complete run of a workflow, from trigger to finish, including every node’s input and output. n8n Cloud also uses executions as its billing unit.
Predictable Beats Clever
The n8n execution model rewards teams that think in items, not in boxes on a canvas. Know how many items reach each node, make order explicit where it matters, and route errors into data. Do that, and the 40 Slack messages become a test case you catch before publishing rather than an incident.
Last updated on 29 November 2026