A8gent
All articles

Technical

Referenced node is unexecuted: 3 Causes and the Fix for Each in n8n

An expression is asking for the output of a node that produced nothing in this execution. Either it sits on a branch that was skipped, it has not run yet, or you tested one step on its own. Each has a one-line test, and two of them are fixed with .isExecuted.

A8gentAutomation practiceNovember 17, 202610 min read
Contents
  1. The Short Answer
  2. What n8n Is Checking
  3. Cause 1: The Node Is on a Branch That Was Skipped
  4. Cause 2: The Node Has Not Run Yet
  5. Cause 3: You Tested a Single Step
  6. Errors That Look Similar but Are Not This One
  7. How to Stop It Coming Back
  8. Sources
  9. FAQ

The Short Answer

"Referenced node is unexecuted" means an expression such as {{ $('Get Customer').item.json.email }} points at a node that has not produced any output in the current execution. n8n cannot return data that does not exist, so it stops.

The quickest reliable fix is to check before you read:

{{ $('Get Customer').isExecuted ? $('Get Customer').first().json.email : '' }}

That is a patch. The cause is one of three things, and which one you have decides whether the patch is the right long-term answer:

  1. The node is on an If or Switch branch that was skipped for this run.
  2. The node has not run yet at the point the expression is evaluated, because it is on a parallel branch or not upstream at all.
  3. You tested a single step in the editor and the upstream node has no data from a previous run.

What n8n Is Checking

The n8n expressions documentation lists this as a variation of "Can't get data for expression" and gives the full text you see in the error panel:

An expression references the node '<node-name>', but it hasn't been executed yet. Either change the expression, or re-wire your workflow to make sure that node executes first.

The check itself is simple. When an expression uses $('Node Name'), n8n looks for that node's results in the data for the current execution. In a manual run it also accepts pinned data on that node. If it finds neither, it throws. You can see this in the n8n source, in workflow-data-proxy.ts.

The wording has changed between versions, which makes searching for it confusing. These are all the same error:

Where you see itText
Error title, as documentedReferenced node is unexecuted
Error title, current sourceNode '<node-name>' hasn't been executed
Detail, as documentedAn expression references the node '<node-name>', but it hasn't been executed yet. Either change the expression, or re-wire your workflow to make sure that node executes first.
Detail, current sourceAn expression references this node, but the node is unexecuted. Consider re-wiring your nodes or checking for execution first

The current detail text goes on to suggest the fix itself: $if( $("node-name").isExecuted, <action_if_executed>, "").

Whichever wording you get, write down the node name in it. Every test below starts from that node.

Cause 1: The Node Is on a Branch That Was Skipped

This is the shape that produces most reports. An If node splits the flow. The true branch calls an API, the false branch does not. Both branches then feed one shared node, often an Edit Fields node that gathers values for the rest of the workflow, and that node references the API call by name.

When an item goes down the true branch, everything works. When it goes down the false branch, the API node never runs, and the shared node asks for data that was never created. A community thread with exactly this layout shows the error and the reply that resolved it: a node that never runs cannot be referenced, so check .isExecuted first.

How to confirm it: open the failed execution. If the node named in the error has no output, and there is an If or Switch node upstream of it, this is your cause. Run the workflow again with input that takes the other branch and the error disappears.

Fix A: guard the expression. isExecuted is the check the n8n docs give for this error:

{{ $('Enrich Lead').isExecuted ? $('Enrich Lead').first().json.company : 'unknown' }}

Use this when the shared node needs one or two optional values. Note the example uses .first() rather than .item. The docs list .first(), .last() and .all() as the methods that read a node's output by position, which is the safer choice when the current item did not pass through that node.

Fix B: make the branches agree. Add an Edit Fields node at the end of each branch and have both write the same field names: the real value on one side, a default on the other. The shared node then reads {{ $json.company }} from whatever arrived and never names a branch-specific node. This is more nodes, but the logic is visible on the canvas instead of hidden in an expression, and it does not break when someone renames a node.

Prefer Fix B when more than a couple of fields are involved. A shared node with six guarded ternaries is hard to read and easy to get wrong.

Cause 2: The Node Has Not Run Yet

Here the node is not skipped. It just has not had its turn. That happens in two layouts.

Parallel branches. A trigger fans out to two branches. A node on the first branch references a node on the second. The n8n execution order documentation explains why that fails: for workflows created from n8n 1.0, n8n executes each branch in turn, completing one branch before starting another, ordered by position on the canvas from topmost to bottommost. So when the top branch runs, nothing on the lower branch exists yet.

No connection at all. The referenced node is somewhere on the canvas but there is no path from it to the node with the expression. It may run later, or never.

How to confirm it: trace the wires backwards from the failing node. If you cannot reach the named node by following connections upstream, this is your cause. For parallel branches, check which one is higher on the canvas.

The fix is to re-wire, as the error text says. There are two clean ways:

  • Put the nodes in series. If node B needs node A's output, connect A before B on the same path rather than running them side by side.
  • Bring the branches together with a Merge node. The n8n docs describe the Merge node as combining data from multiple streams once data of all streams is available. Place the node that needs both sets of data after the Merge.

Do not solve this one by dragging the lower branch above the upper one. It works today and breaks the next time someone tidies the canvas. Do not use .isExecuted here either: it would silently return your fallback value on every run, because the other branch really has not run at that point.

Cause 3: You Tested a Single Step

If the error only appears in the editor and production runs are fine, the workflow is probably correct and the test was incomplete. Running a single step evaluates its expressions against whatever data the editor already holds. If the referenced node has not been run in this editing session, there is nothing to read.

The n8n docs give the troubleshooting step for exactly this: test the workflow up to the named node. They also note that the related error appears if you test a step that is not connected to another node at all.

How to confirm it: look at the named node on the canvas. If it shows no output from a recent run, that is the whole story.

The fix:

  • Run the workflow from the trigger, or run the named node first, then test your step again.
  • If the upstream node is slow, costs money per call, or depends on an event you cannot easily repeat, pin its output. In manual executions n8n treats pinned data on the referenced node as its output, so the expression resolves without calling the service again.

One trap: a workflow that passes in the editor because you happened to run both branches during testing can still fail in production for the reason in Cause 1. After fixing a test-only error, run the whole workflow once for each branch.

Errors That Look Similar but Are Not This One

n8n has a family of expression errors about referenced nodes. They need different fixes, so check you have the right one. The texts below are from the n8n source and the item linking errors documentation.

MessageWhat it meansFix
Referenced node doesn't existNo node with that name is in the workflow, usually after a rename or a typo.Correct the name inside $('...').
No path back to referenced nodeThe node exists but there is no connection back to it from here.Wire the node in upstream. Other nodes can sit in between.
'<node-name>' is on another branchThe node ran, but the current item came through a different branch, so .item cannot match it.Use .first(), .last() or .all()[index], or set the Merge node to Combine mode.
Multiple matching items for expression.item found more than one possible source item, typically after Aggregate, Summarize or Merge.Use .first(), .last() or .all()[index].

The third and fourth are covered in detail in our guide to Can't get data for expression, which is the parent error of this whole group.

How to Stop It Coming Back

Reference the previous node, not a distant one, when you can. $json reads the item that just arrived. It cannot be "unexecuted". The further back an expression reaches by name, the more ways a branch or a rename can break it. Carry the values you need forward with an Edit Fields node instead. This is the same discipline as good data mapping in any integration tool.

Give every branch the same output shape. If an If node splits the flow and the branches rejoin, make each branch end with the same field names. The node after the join should not need to know which branch ran.

Test every branch before you publish. This error is almost always a path nobody ran. For each If and Switch node, run the workflow once with input for every output. Pinned data on the trigger makes this quick.

Set an error workflow. In Workflow Settings, choose a workflow that starts with the Error Trigger node so a failed production run tells you which node failed, rather than waiting to be noticed. See error handling for the pattern.

Branching, merging and referencing data across nodes is where most first n8n builds go wrong, and it gets harder once an AI Agent node is deciding which tools run. Our n8n AI Agents course works through these layouts step by step, and the n8n AI Agent tutorial is a free place to start. If you are still choosing a platform, our n8n review covers where it fits.

Sources

Checked against n8n's documentation, source code and community forum on 17 November 2026.

FAQ

What does "Referenced node is unexecuted" mean in n8n?
An expression in the failing node refers to another node by name, and that node has no output in the current execution. It was either skipped by an If or Switch branch, has not run yet, or was never run in the editor before you tested the step. The full error text names the node.
How do I check whether a node has executed in an n8n expression?
Use the isExecuted property: $('Node Name').isExecuted returns true if the node has run in this execution. Combine it with a fallback, for example {{ $('Node Name').isExecuted ? $('Node Name').first().json.field : '' }}.
Why does the error only happen for some items or some runs?
Because the referenced node sits behind a condition. Runs that take the branch containing the node work, and runs that take the other branch fail. Open a failed execution and check which output of the If or Switch node was used.
Why does it work in production but fail when I test a step?
Testing one step uses the data the editor already has. If the referenced node has not been run in the editor, there is nothing to read. Run the workflow up to the named node first, or pin data on that node.
Is "Node hasn't been executed" the same error?
Yes. Current n8n source titles the error Node '<name>' hasn't been executed, while the documentation and older versions call it Referenced node is unexecuted. The check and the fixes are identical.
Should I always wrap references in isExecuted to be safe?
No. It is right for optional data from a branch that may be skipped. It is wrong when the node should always have run, because the guard will hide a wiring mistake and quietly pass an empty value downstream. In that case re-wire the workflow so the node is upstream.

If this resonated

Module 02 is the long version of this post.

Eval set, refusal pattern, kill switch. Build it in a weekend.

All postsLast verified 2026-11-17

Done for you

Want this built for your business?

Tell us the workflow. We scope, build, and ship the agent with guardrails and the numbers to prove it worked. The scoping call is free.

Free scoping call. You own the code.

Request a scoping call