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

In Workflow 1, I create a variable like:

Name: status_active

Value: true

Then in Workflow 2, I want to check if status_active is true or not.

What’s the best way to store and access such variables between workflows in n8n?

I prefer a no-code or low-code solution — for example using:

Data Stores

Google Sheets

Webhooks

If there’s a simple example (like with Set + Get nodes), that would be really helpful!

Thanks in advance!

Hi @Arman_Shamyan Welcome to n8n :n8n: community :tada:


There are common approaches to share data between workflows without heavy code:

Execute Workflow (Sub-workflow) Node:
If you have a parent workflow that needs to call another (child) workflow, you can use the “Execute Workflow” node. This lets you pass data as input to the child workflow and then receive a response.
Example:


External Data Storage Solutions:
Alternatively, you could store shared data in an external data store such as a Google Sheet, database, or even via webhooks. This method is useful if the workflows run independently and not in a parent/child relationship.

  • Data Stores or Google Sheets: Store the variable in an external location and then have your workflows read and write to that location.
  • Webhooks: One workflow could update a value through a webhook call that the other workflow listens to.

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

Thank you so much ))))