Variables in n8n

I am a new user of n8n and have set up n8n locally on my laptop for testing and evaluation. I am learning and trying to explore capabilities of this tool.

I am trying to use variables in the n8n (self hosted version). I am getting a message
" Available on the Enterprise plan

Variables can be used to store and access data across workflows. Reference them in n8n using the prefix $vars (e.g. $vars.myVariable). Variables are immutable and cannot be modified within your workflows."

Can I not use variables on the version installed on my laptop?

What is the error message (if any)?

Information on your n8n setup

  • n8n version:
  • Database (default:): SQL DB
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Desktop App
  • Operating system: Windows 11

Hi, the clue here is “across” workflows. Inside a workflow you do whatever. Also nothing stops you from using external data stores to share data between flows

Does it mean i cannot define and use variables within my workflow?

You need to be on an enterprise plan / startup plan to use the global variables feature.

If it’s just a variable for a single workflow, I suggest an Edit Fields node.

Otherwise you could get variables from a DB if you know how to set that up.

The only difference I guess would be is that you can’t use some of the ways you access data as described in these “Global” variables.

Hi, to get a better understanding I recommend to follow the tutorials (at least level1). It will become clear.

I am trying to define my environment specific variables e.g. connection for my DEV, STG and PROD databases. So based on the context my agent interacts with specific databases and avoid changing the workflow everytime

Yes, there is a feature request for this regarding creddentials. For other options, you could have an object and do a lookup local or search in a dB for config. The other point is where the selection criteria would come from. Webhook info? Environment variables?

2 Likes

I have few more questions, shall I create a new topic for the same?

Hi, I think so yes, it would be easier for other people to find similar issues. Thanks.

Can you please mark a solution if your question was answered thank you

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.