# How node-red execute nodes in a flow?

**URL:** <https://discourse.nodered.org/t/how-node-red-execute-nodes-in-a-flow/85845>\
**Category:** Core Development\
**Created:** [24 February 2024 06:04 UTC](https://discourse.nodered.org/t/how-node-red-execute-nodes-in-a-flow/85845 "2024-02-24T06:04:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RemyEE](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/remyee/32/88614_2.png) [@RemyEE](https://discourse.nodered.org/u/RemyEE)\
**Post date:** [24 February 2024 06:04 UTC](https://discourse.nodered.org/t/how-node-red-execute-nodes-in-a-flow/85845/1 "2024-02-24T06:04:06Z")

</div>

Node-red is amazing tool for programming. I really want to know deeply about it. But, JavaScript is not really my familiar programming language.

I am wondering how node-red save all the node inside a flow (I mean, which data structure did they used? It like a tree, but not really a tree, is it graph?) And after user press the "Deploy", which order keep all the node running, how it pass the pre-node parameter to another one?

I cloned the code, but as I has mention above, I am not good at JavaScript, so can anyone point me out which function should I take a look?

---

<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 February 2024 06:46 UTC](https://discourse.nodered.org/t/how-node-red-execute-nodes-in-a-flow/85845/2 "2024-02-24T06:46:54Z")

</div>

The flows are stored in a json file and can be found in the `~/.node-red` directory as 'flows.json'  
All the properties (x,y, parameters of the nodes, its wire connections) are stored in there.

This is not as easy as copying some function.

---

<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:** [24 February 2024 12:22 UTC](https://discourse.nodered.org/t/how-node-red-execute-nodes-in-a-flow/85845/3 "2024-02-24T12:22:19Z")

</div>

> [@RemyEE](#):
>
> I cloned the code

Which code? We don't really have enough information here to help you.

Generally, you don't need to concern yourself with the mechanics of Node-RED other than the basics. If you make a change, you need to deploy. That writes the changes to the appropriate files and restarts any sections of the flow that it needs to.

There are different types of deploy, the default forces all flows to restart. The others limit the restart which is useful because not everything in memory then gets reset.

The mechanics of how this works is interesting to some of us, especially those of us creating nodes, but mostly you rarely need to understand it.

---

<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:** [24 April 2024 12:23 UTC](https://discourse.nodered.org/t/how-node-red-execute-nodes-in-a-flow/85845/4 "2024-04-24T12:23:09Z")

</div>

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