Describe the problem/error/question
I’m trying to set a variable at the beginning of my workflow, then update its value later, and finally reuse the updated version in downstream nodes — all within the same workflow execution.
For example: I initialize an array, append new values to it in multiple places, and want to access the final version at the end.
I’ve tried using:
this.setVariable()
/this.getVariable()
$variables.set()
/$variables.get()
- Passing data manually via JSON from node to node (not scalable)
But so far, none of these approaches worked consistently.
What’s the correct way to store and update data throughout a single workflow execution across multiple nodes?
What is the error message (if any)?
When I try $variables.set()
or $variables.get()
, I get:
$variables is not defined
Please share your workflow
Share the output returned by the last node
Expected: The final updated value of the variable (e.g. updated array)
Actual: Can’t access or modify the variable reliably across nodes
Information on your n8n setup
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system: