Deprecated syntax ($items) in n8n
Why $items() is deprecated and how to migrate to the new syntax
What is this issue?
The $items() function was used in older n8n versions to access items from other nodes. In n8n v2, this syntax is deprecated in favor of $input.all() and $('NodeName').all() which are more explicit and less error-prone.
Deprecated patterns detected:
•$items('NodeName') - accessing items from a specific node•$items() - accessing items from the previous node•return items - returning the items array in runOnceForEachItem mode•$node['Name'].data - legacy node data access
Why is this dangerous?
Future incompatibility
Deprecated syntax may stop working entirely in future n8n versions, breaking your workflows.
Unexpected behavior
The old syntax has subtle differences that can cause bugs, especially with branching logic.
Missing features
New expressions like filtering and first/last item access are only available with the new syntax.
Debugging difficulty
Mixing old and new syntax makes code harder to understand and maintain.
How to fix it
- 1
Replace $items()
Change $items() to $input.all() to get all items from the previous node.
- 2
Replace $items('NodeName')
Change $items('NodeName') to $('NodeName').all() for accessing items from a specific node.
- 3
Update return statements
In runOnceForEachItem mode, use 'return $input.item' instead of 'return items'.
- 4
Replace $node legacy access
Change $node['Name'].data to $('Name').first().json for accessing node output data.
Scan your workflow now
Upload your n8n workflow JSON and instantly detect deprecated syntax that needs migration.