# What is the purpose of starting the 'global' flow in the source code when starting Flows

**URL:** <https://discourse.nodered.org/t/what-is-the-purpose-of-starting-the-global-flow-in-the-source-code-when-starting-flows/84073>\
**Category:** Core Development\
**Created:** [28 December 2023 01:59 UTC](https://discourse.nodered.org/t/what-is-the-purpose-of-starting-the-global-flow-in-the-source-code-when-starting-flows/84073 "2023-12-28T01:59:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![KY.W](https://avatars.discourse-cdn.com/v4/letter/k/8baadc/32.png) [@KY.W](https://discourse.nodered.org/u/KY.W)\
**Post date:** [28 December 2023 01:59 UTC](https://discourse.nodered.org/t/what-is-the-purpose-of-starting-the-global-flow-in-the-source-code-when-starting-flows/84073/1 "2023-12-28T01:59:46Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/4/540f20c5bd5a900a486e7b885da146c3ddb0accb.png)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [28 December 2023 11:56 UTC](https://discourse.nodered.org/t/what-is-the-purpose-of-starting-the-global-flow-in-the-source-code-when-starting-flows/84073/2 "2023-12-28T11:56:38Z")

</div>

Never seen or done that. Might help if you shared where you saw it?

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [28 December 2023 12:01 UTC](https://discourse.nodered.org/t/what-is-the-purpose-of-starting-the-global-flow-in-the-source-code-when-starting-flows/84073/3 "2023-12-28T12:01:09Z")

</div>

Here:

> <https://github.com/node-red/node-red/blob/0e8d3127944a91f39fb49bcb4b388b184ce11edd/packages/node_modules/%40node-red/runtime/lib/flows/index.js#L355-L359>

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [28 December 2023 12:06 UTC](https://discourse.nodered.org/t/what-is-the-purpose-of-starting-the-global-flow-in-the-source-code-when-starting-flows/84073/4 "2023-12-28T12:06:51Z")

</div>

Thanks. One for core devs to answer then I think?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [28 December 2023 20:43 UTC](https://discourse.nodered.org/t/what-is-the-purpose-of-starting-the-global-flow-in-the-source-code-when-starting-flows/84073/5 "2023-12-28T20:43:21Z")

</div>

@KY.W

The 'global' flow contains any configuration nodes that are not scoped to an individual flow.

---

<div class="post-metadata">

**Author:** ![KY.W](https://avatars.discourse-cdn.com/v4/letter/k/8baadc/32.png) [@KY.W](https://discourse.nodered.org/u/KY.W)\
**Post date:** [29 December 2023 07:36 UTC](https://discourse.nodered.org/t/what-is-the-purpose-of-starting-the-global-flow-in-the-source-code-when-starting-flows/84073/6 "2023-12-29T07:36:54Z")

</div>

> [@knolleary](#):
>
> The 'global' flow contains any configuration nodes that are not scoped to an individual flow.

Thank you very much for your answer. I would also like to ask: In what scenarios will this 'global' Flow be used?

---

<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:** [29 December 2023 09:38 UTC](https://discourse.nodered.org/t/what-is-the-purpose-of-starting-the-global-flow-in-the-source-code-when-starting-flows/84073/7 "2023-12-29T09:38:39Z")

</div>

> [@KY.W](#):
>
> In what scenarios will this 'global' Flow be used?

Every node (including config nodes) are a unit of code that needs to be initialised and executed.

So to answer your question, any node that requires a config node will first need the config nodes to be initialised & if the scope of the config is not altered, that will be executed in the global flow.

Note: a config node will, by default, be added to the global flow, but that can be changed by the flow developer if they wish (the scope of the config node can be changed on the editor panel)

---

<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:** [27 February 2024 09:39 UTC](https://discourse.nodered.org/t/what-is-the-purpose-of-starting-the-global-flow-in-the-source-code-when-starting-flows/84073/8 "2024-02-27T09:39:20Z")

</div>

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