# Flow variables in subflows

**URL:** <https://discourse.nodered.org/t/flow-variables-in-subflows/65938>\
**Category:** General\
**Created:** [2 August 2022 16:09 UTC](https://discourse.nodered.org/t/flow-variables-in-subflows/65938 "2022-08-02T16:09:55Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Giu-seppe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/giu-seppe/32/40489_2.png) [@Giu-seppe](https://discourse.nodered.org/u/Giu-seppe)\
**Post date:** [2 August 2022 16:09 UTC](https://discourse.nodered.org/t/flow-variables-in-subflows/65938/1 "2022-08-02T16:09:55Z")

</div>

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.

Thanks in advance

---

_[View the full topic](https://discourse.nodered.org/t/flow-variables-in-subflows/65938)._
