🔁 How can I share a variable between two workflows in n8n?

Assuming your 2 workflows run independently of each other (i.e. one of them doesn’t call the other one), and the values you need to share are small/simple, there is a static worfklow data feature you could use.

The challenge is that the “global” data kept by $getWorkflowStaticData is scoped to a single workflow, so you would need to create a 3rd “common” workflow to wrap a set of “static data” in order to make the same data values available to both of your other workflows. That 3rd/common workflow would also handle updating the value. Your other 2 workflows would use the Execute Sub-Workflow node to access the common one.

The common workflow would be something like this:

Set a new value by passing something in:

Read the current value by passing nothing in.

2 Likes