error fix
n8n Expression Error: Fix Missing Fields, Unexecuted Nodes, and Branch Problems
An n8n expression error usually means the expression references missing data, an unexecuted node, an invalid path, or syntax that does not fit n8n's expression format.
Independent third-party notes. n8n is a trademark of its owner and is referenced only for compatibility and troubleshooting context.
Quick Answer
An n8n expression error usually means the expression references missing data, an unexecuted node, an invalid path, or syntax that does not fit n8n's expression format.
Problem Pattern
The expression worked for one item or branch but fails when data shape changes or a referenced node did not execute.
Key Facts
- Expression role
- Expressions are JavaScript-like snippets inside node parameters.
- Missing data
- n8n documents errors when an expression cannot retrieve referenced data.
- Unexecuted node
- A referenced node may not have run on the current path.
- Syntax issue
- Invalid expression syntax can fail before workflow logic runs.
Recommended Steps
- Read the exact expression error and identify the referenced node or field.
- Confirm the referenced node executed on the current branch.
- Inspect the input item JSON at the node where the expression runs.
- Replace fragile paths with safer checks where needed.
- Use a Code node for complex transformations that are too large for inline expressions.
Verification
- The expression previews the expected value.
- The workflow works on both expected and empty/missing input cases.
- No referenced node is unexecuted on the tested branch.
Warnings
- Expressions can behave differently across branches if some nodes do not execute.
- Copying expressions between workflows without matching node names and data shapes often breaks.
Common Mistakes
- Referencing a node that did not run because an IF branch went the other way.
- Assuming every item has the same nested JSON shape.
- Leaving a trailing dot or malformed expression syntax.
- Using an expression for complex transformation better handled by Code.
Examples
Referenced node name correct: yes
Referenced node executed on this branch: yes
Input item has expected field: yes
Expression preview works: yes
Empty value case handled: yes FAQ
Why does an expression fail only on one branch?
The referenced node may not execute on that branch, or the item data shape may differ after branching.
When should I use a Code node instead?
Use Code when the transformation needs loops, complex conditionals, reshaping arrays, or defensive checks that are hard to read inline.