Hello everybody,
I would like to create a subflows that use their own internal variables in multiple subflow nodes
These are the characteristics:
the variables must be read and written in more nodes of the subflow.
if two subflows are positioned within the same flow, they must not read the variables of the other subflows.
I tried using the flow variables with the flow.set and flow.get functions but by placing two subflows in the same flow they access the same variables.
I also use env.set and env.get functions (I'm not sure these features exist)
I'm sure I'm missing something, but I can't figure out what.
I've accomplished similar by adding the variable to the msg object as a separate msg.part and then extract it inside the subflow. That said I'm trying to figure out a similar use case to yours on a different flow where the msg object is getting reset prior to the injection into the subflow (I've used a join workaround to reattach my variable msg.part right before the subflow but would like a simpler solution if you figure one out)
My understanding is that each instance of a subflow will have its own flow context. If a subflow is used twice then the flow contexts should be separate between them.
Each subflow instance gets its own flow context. If you have an example flow that shows that not working as described, please share so we can investigate