Sub flow and evironment variables

Hi, maybe it's a stupid question.
Since a while, in the "edit subflow instance" window (the one you can access to by double clicking the subflow node itself) you can find this "Properties" tab:
image

where are present the environment variables you can set in the "edit subflow template" window (the one you have access to from within the subflow) It means this one
image

Going back to the previous "edit subflow instance" window I can even switch to the "Environment Variables" tab
image

Now, I'm not able to understand how this last evironment variables settings can be used within the subflow. Searching on the docs I didn't find anything (maybe it's not update, since even the imagines don't show this tab). I made several test but nothing.
Can you please give me some more details?
Thanks so much

https://nodered.org/docs/user-guide/environment-variables

I already read it, but I don't find the answer to my question. I don't see the need of settings the "Environment Variables" within the subflow instance (picture 3). It's just enough the variable added within the subflow template (pictures 1 and 2)

When you set them on the template, they will be set for all instances of the subflow.

Sometimes you may want to customise individual instances with their own values.

For example, you may have a subflow that subscribes to a sensors mqtt topic, parses the data and writes to a database. You could use an env var to set the mqtt topic to subscribe. Then each instance of the subflow can be configured with its own mqtt topic to use.

OK thanks.
Because I thought something similar, but by testing I saw that all environment variables, even if not set on the template, where already accessible within the subflow, so I couldn't figure out why this other settings.
Now it's clear :wink:

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