# Subflow help. What's what?

**URL:** https://discourse.nodered.org/t/subflow-help-whats-what/96214
**Category:** General
**Created:** [24 March 2025 11:39 UTC](https://discourse.nodered.org/t/subflow-help-whats-what/96214 "2025-03-24T11:39:29Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [24 March 2025 11:39 UTC](https://discourse.nodered.org/t/subflow-help-whats-what/96214/1 "2025-03-24T11:39:29Z")

</div>

Sorry folks, my brain is on holidays again.

 ![Screenshot from 2025-03-24 22-30-31](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/2/029ddbd23e96f2a8c4b4321115e50a392430cf8c.png)

What are the two things I'm pointing at?

And, I'm wanting to set a value (WaitTime) in the subflow, and have it parsed by a node.

 ![Screenshot from 2025-03-24 22-35-58](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/9/f93f12f48b35e5b14ecbcd8c41389e401147f7ec.png)

This is what I can scrape from previous askings of what/how to do it.

But that _fails_.  
I have it set to `1` (1 minute) and it fails after 16 seconds.

When I click on the _second_ button, I get an `environment` list, but none are set.  
Which is what I thought I did in the `edit subflow details` part.  
But that is appearing in the `properties` tab instead.

Yes, I'm confused.

Please.  
Someone.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [24 March 2025 11:58 UTC](https://discourse.nodered.org/t/subflow-help-whats-what/96214/2 "2025-03-24T11:58:25Z")

</div>

`$globalget` gets values from global context. It has nothing to do with env vars at all.

> [@Trying\_to\_learn](#):
>
> What are the two things I'm pointing at?

If you want to use the env var named `WaitTime` then set msg.delay to value of $.WaitTime then do the multiplication on the next line in the change node.

Your arrows have no heads.

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [24 March 2025 12:02 UTC](https://discourse.nodered.org/t/subflow-help-whats-what/96214/3 "2025-03-24T12:02:58Z")

</div>

Yeah, as I said: the brain is on holiday. 😉

I think I have worked out the problem, but.... there's another one behind the answer.

Trying to not make too much of a mess of this thread:

Can you explain the difference between those two _tabs_? The _cog_ and the _menu_ icons.

What is what? And how do I use their entries in the subflow?

I get the idea I can set _values_ (variables) used in the subflow and I define their values in the subflow's node.

Global, flow, I get. Sorry.

I seem to be missing something here.

Hope you can help.

Thanks.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [24 March 2025 12:07 UTC](https://discourse.nodered.org/t/subflow-help-whats-what/96214/4 "2025-03-24T12:07:46Z")

</div>

Items under the cog are what you pre-defined in the subflow template

Items under the env var list are freeform.

They are both accessed inside the subflow using either `$.name` or `env.get('name')`

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [24 March 2025 12:18 UTC](https://discourse.nodered.org/t/subflow-help-whats-what/96214/5 "2025-03-24T12:18:10Z")

</div>

Indulge my stupidity,

Ok, the cog ones are FIXED.... `const` - if you will.

the others...... That does me.

(to digress back to the original problem)  
I was trying the `J:` trick I was shown for `change` nodes - and the like.  
`J: `  
_ARGH_..... brain failure. - again!.

I got the value needed and did the _maths_ in the next (function) node.

So back at the user end of things, I double click on the `subflow` and I get the two options for _FIXED_ and _variable_ .... variables.

Clicking on the cog - keeping it for this subflow - I get my `WaitTime` field.  
But then if I click on the second one I get a blank screen titled _environment variables_......

😕 Where does this fit in to the subflow's world?

Again: Sorry. It is not fun having a brain that when you ask it a question, one time you get a reply with useful stuff. The next time - same question - you get back either a blank or rubbish.

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [24 March 2025 13:09 UTC](https://discourse.nodered.org/t/subflow-help-whats-what/96214/6 "2025-03-24T13:09:54Z")

</div>

What is `$globalget` ?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/2/e26117a5c6743b1b92a658865cdefc728fd3f68e.png)

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [24 March 2025 13:12 UTC](https://discourse.nodered.org/t/subflow-help-whats-what/96214/7 "2025-03-24T13:12:52Z")

</div>

Thanks.

I worked that bit out and _cheated_ by doing some of it in the next `function` node.

Where I'm now kinda stuck is what this _second_ tab is on the `subflow` which shows/lists _variables_ for the subflow.

So I'm at the top level of the editor. So where/how do these variables come into working with the subflow's code?

As opposed to the ones defined in the `cog` tab. (Which I do understand.) (or I hope I do)  
😉

What's the `environment variable` one for?

---

<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: [22 June 2025 13:13 UTC](https://discourse.nodered.org/t/subflow-help-whats-what/96214/8 "2025-06-22T13:13:17Z")

</div>

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