Subflows & environment variables?

I'm using subflows and their instance environment variables. How can I pass or override the instance environment variable values from another node? It looks like I could set them to reference other environment variables but how do I externally set those variables?

Env Vars cannot be dynamically changed. They are read-only when the flow starts.

The process object is not available in the Function node.

1 Like

How do you recommend I proceed? I am basically trying to cleanup flows by putting repeatable patterns into subflows. But those subflows require values to operate correctly. Sometimes I can hard code those values. Other times I need to calculate those values (ex. with a function node).

I could embed them in an arbitrary portion of the message passed to the subflow (ex. msg.subflow). It just seems like subflow environment variables were the way to go.

Thanks in advance

It is up to individual nodes as to whether a particular property can be set by the messages it receives. So how you proceed will depend on the specific details of what you want to do and what nodes you want to configure in this way.

Env Vars were never about dynamically changing the configuration after a flow has been deployed. There is no mechanism to change a node's configuration without a deploy to ensure the change takes effect.

Thanks for the quick response. Seems like my needs correspond to this thread:

I guess I'll just put data I need to transfer into subflows under msg.subflow until a common mechanism or standard arises. Thanks again