# Subflows and variables

**URL:** https://discourse.nodered.org/t/subflows-and-variables/47948
**Category:** General
**Created:** [2 July 2021 16:20 UTC](https://discourse.nodered.org/t/subflows-and-variables/47948 "2021-07-02T16:20:44Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Egonic](https://avatars.discourse-cdn.com/v4/letter/e/5e9695/32.png) [@Egonic](https://discourse.nodered.org/u/Egonic)
#### Post date: [2 July 2021 16:20 UTC](https://discourse.nodered.org/t/subflows-and-variables/47948/1 "2021-07-02T16:20:44Z")

</div>

Hello Everyone

I am trying to use subflows and am getting more away from understanding it than before.  
I am trying to reuse certain function over and over but what I am failing to do is to pass in the environmental variable and pass it out again. How are you supposed to do it. for example I want to create a timer and reuse it for multiple instances. i dont know how to configure it in the subflow and then how do I use it again.  
Should i use globals instead but will this make it hard to reuse?  
I am using node-red version 1.3.4

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/1/71bee2490ca3df92754a77c7b85f730035be9833.png)

---

<div class="post-metadata">

### Author: ![molesworth](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/molesworth/32/11748_2.png) [@molesworth](https://discourse.nodered.org/u/molesworth)
#### Post date: [2 July 2021 19:36 UTC](https://discourse.nodered.org/t/subflows-and-variables/47948/3 "2021-07-02T19:36:49Z")

</div>

Should that be "set" rather than "get" at line 8?

---

<div class="post-metadata">

### Author: ![Egonic](https://avatars.discourse-cdn.com/v4/letter/e/5e9695/32.png) [@Egonic](https://discourse.nodered.org/u/Egonic)
#### Post date: [5 July 2021 14:08 UTC](https://discourse.nodered.org/t/subflows-and-variables/47948/4 "2021-07-05T14:08:15Z")

</div>

yes it should. Thanks. i will look into it again

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [3 September 2021 14:08 UTC](https://discourse.nodered.org/t/subflows-and-variables/47948/5 "2021-09-03T14:08:54Z")

</div>

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