# Best way to organize large flows?

**URL:** <https://discourse.nodered.org/t/best-way-to-organize-large-flows/96517>\
**Category:** General\
**Created:** [11 April 2025 12:05 UTC](https://discourse.nodered.org/t/best-way-to-organize-large-flows/96517 "2025-04-11T12:05:06Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sanders](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sanders/32/100055_2.png) [@Sanders](https://discourse.nodered.org/u/Sanders)\
**Post date:** [11 April 2025 12:05 UTC](https://discourse.nodered.org/t/best-way-to-organize-large-flows/96517/1 "2025-04-11T12:05:06Z")

</div>

Hi all,  
My project is starting to get messy with a lot of flows. Any tips on how to keep things clean and organized in Node-RED?

Thanks!

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [11 April 2025 13:04 UTC](https://discourse.nodered.org/t/best-way-to-organize-large-flows/96517/2 "2025-04-11T13:04:02Z")

</div>

A few suggestions

- Split them up into tabs with names that explain the purpose
- If you have lots of groups of repeated nodes, look at using subflows to make a single templated versoin
- if flows are running off the screen you can drag them to stacked in narrower columns to make them easier to read without scrolling
- Link nodes can also help, but you need to be careful as it can also make things a little harder to follow.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [11 April 2025 13:15 UTC](https://discourse.nodered.org/t/best-way-to-organize-large-flows/96517/3 "2025-04-11T13:15:34Z")

</div>

Welcome to the forum @Sanders

> [@Sanders](#):
>
> how to keep things clean and organized

1. Group nodes together which have an identifiable common function.
2. Use group labels and fill colours.
3. Move groups onto their own flow tab and call with link nodes.
4. Link nodes can be used within a tab too, avoiding visible crossed wires.
5. Avoid wires running behind nodes.
6. Generally aim for the flow to run left to right, top to bottom.
7. It might help if you reduce some nodes to a small square in the editor by hiding the node's label.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/c/dc26ca36707bee80ff85326681b23ae2d1a59f2a.jpeg)

ps There is a free online course in the newly established Node-red Academy "Node-red Advanced" which looks like it covers managing your flows' appearances

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [11 April 2025 16:23 UTC](https://discourse.nodered.org/t/best-way-to-organize-large-flows/96517/4 "2025-04-11T16:23:30Z")

</div>

I separate the flow tabs by function, Process I/O, Control Logic, and UI  
So, for example, for my home automation, I have tabs for the I/O, which is temperature sensors, relay outputs, etc and send the values to meaningful topics in MQTT, so I have topic `home/bedroom/temperature` for example, and for the required power output I have `home/bedroom/power`.

Then I have tabs containing the control logic, time scheduling and so on, which get and send all their data via MQTT.

Finally there are tabs containing the dashboard nodes for the user interface. Again, these communicate with the rest of the system using MQTT.

One advantage of using this sort of design is that if, for example, you decide to change the type of sensor reading the temperature then that only affects that one flow and has little or no effect on the logic and GUI.  
Also, you could move the dashboard flows to node-red running on a different computer in your network and only have to change the MQTT configuration so that the dashboard flows get their data from the correct machine.

In the jargon, this is known as using a Unified Name Space or UNS.

---

<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:** [12 April 2025 10:03 UTC](https://discourse.nodered.org/t/best-way-to-organize-large-flows/96517/5 "2025-04-12T10:03:48Z")

</div>

This is a problem with all visual programming tools to be honest.

My personal opinion is that it is worth reviewing distinct chunks of your flows to see whether it is worth compressing multiple nodes into some JavaScript code in a function node. Of course, this somewhat depends on your level of JavaScript knowledge. There might be other ways to compress multiple nodes into a smaller number of specialist nodes as well.

It is also, of course, worth reviewing you flows to see if any can be simplified. Are there areas of your flows that have grown in an evolutionary fashion? Are there areas of your flows that have evolved as your knowledge of Node-RED has improved?

Other than that, reducing spaghetti is important.

(Oops - I didn't manage to post this when I wrote it yesterday!)

---

<div class="post-metadata">

**Author:** ![MikeW](https://avatars.discourse-cdn.com/v4/letter/m/7ba0ec/32.png) [@MikeW](https://discourse.nodered.org/u/MikeW)\
**Post date:** [21 April 2025 03:53 UTC](https://discourse.nodered.org/t/best-way-to-organize-large-flows/96517/6 "2025-04-21T03:53:50Z")

</div>

Hi

I find this challenging as well. And appreciate the hints. One thing I'm also looking for is any advice on how to manage individual flows (ie in a tab) with GitHub using the project feature. I'd like to be able to control and share the configuration of individual flows.  
Cheers, Mike

---

<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:** [21 April 2025 08:02 UTC](https://discourse.nodered.org/t/best-way-to-organize-large-flows/96517/7 "2025-04-21T08:02:40Z")

</div>

Another trick with `link` nodes is to name them too.  
This helps you remember where they are going/what they are used for.

Also, if they are staying on the same `TAB`, make them small.  
That is:

 ![Screenshot from 2025-04-21 17-58-36](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/7/a7f91385a19eddd1f0da5dbfda9f7114fc6dfff6.png)  
to name it, but _HIDE_ the name.

If it goes to another `TAB`, leave it showing the name.

If both, leave it as default.

To me, that helps me see when a `LINK` is staying _local_ or going to another tab.

`COMMENT` nodes are also handy to put in `GROUPS` to explain what the group does.

Document what is expected at the input message structure and the output structures too.

I'm guilty of NOT doing that and have cursed myself many times.  
So I would strongly suggest you try to get into the habit of doing it.

All the best.

# P.S.

(Sorry)

`DEBUG` nodes: Name them but do NOT leave too many active by default.  
(_Long story behind that. I won't bore you with the details. But it could cause headaches if you leave them active_)

---

<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:** [21 April 2025 09:10 UTC](https://discourse.nodered.org/t/best-way-to-organize-large-flows/96517/8 "2025-04-21T09:10:45Z")

</div>

AS I use so many link nodes in more complex flows, I always try to name them. I often turn on the name as well. Names should be descriptive as well.

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

> [@Trying\_to\_learn](#):
>
> `COMMENT` nodes are also handy to put in `GROUPS`

Don't forget that groups also have labels, I always use these.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/4/6482bdecaa917858e038b3a3d32e132a126f7808.png)

Background colours are also useful though I always make them partially transparent.

---

<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:** [21 April 2025 09:12 UTC](https://discourse.nodered.org/t/best-way-to-organize-large-flows/96517/9 "2025-04-21T09:12:39Z")

</div>

(Sorry)

But the _TITLE_ is somewhat limited.

The _COMMENT_ node allows you to enter a lot of information as I explained in the post.

Though I do agree that TITLES are also handy.

---

<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:** [21 April 2025 09:23 UTC](https://discourse.nodered.org/t/best-way-to-organize-large-flows/96517/10 "2025-04-21T09:23:47Z")

</div>

> [@Trying\_to\_learn](#):
>
> But the _TITLE_ is somewhat limited.

Don't forget that you can use " \n " (with spaces around) to generate a new line. This is the same as a comment node. You also have a full markdown notes section. So really the features in the group are no different to a comment node. Other than less ability to reposition.

---

<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:** [21 April 2025 09:24 UTC](https://discourse.nodered.org/t/best-way-to-organize-large-flows/96517/11 "2025-04-21T09:24:50Z")

</div>

> [@Trying\_to\_learn](#):
>
> The _COMMENT_ node allows you to enter a lot of information as I explained in the post

The `group` has the same capability...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/f/df321212bbbe20b67f61dd4cb67ff8ff465b4a26.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:** [21 April 2025 09:24 UTC](https://discourse.nodered.org/t/best-way-to-organize-large-flows/96517/12 "2025-04-21T09:24:59Z")

</div>

Yes, but if you want to write the in/out structure of messages..... A comment node would be better.

---

<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:** [21 April 2025 09:25 UTC](https://discourse.nodered.org/t/best-way-to-organize-large-flows/96517/13 "2025-04-21T09:25:48Z")

</div>

Ok, I have (again) shown my ignorance in that area.

Just the `comment` node seems more..... _intuitive_ that there is stuff to be read.

---

<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:** [21 April 2025 09:26 UTC](https://discourse.nodered.org/t/best-way-to-organize-large-flows/96517/14 "2025-04-21T09:26:43Z")

</div>

Without a doubt, both are useful. I like group titles because of their neatness. I use comment nodes - as you say - where you need to position a note next to something specific.

And just to prove the point. 🙂

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/e/eee7539f26c71cbdfbf788fd989f42c1d18eb020.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:** [21 April 2025 09:28 UTC](https://discourse.nodered.org/t/best-way-to-organize-large-flows/96517/15 "2025-04-21T09:28:18Z")

</div>

Oh, side note on the `comment` node.

@Sanders

_We've_ taken on a bit of a discussion on `titles` vs `comment` nodes.

I mentioned them and now - in retrospect - admit I missed a point.

If I use a `comment` node and just have a title, well: all well and good.

But if I want to add extra/more stuff in the `text` area, in the _name_ of the `comment` node I add a `*` at the end of the name.

To me: this indicates there is more to be read in that node.

Example:  
(very basic one)

```auto
[{"id":"b4ce0bb76b5c7574","type":"comment","z":"b8111f78dd481d81","name":"Example 1","info":"","x":770,"y":750,"wires":[]},{"id":"1289fd11a74aaede","type":"comment","z":"b8111f78dd481d81","name":"Example 2 *","info":"This is extra text that isn't shown,\nbut may be of interest or importance\n","x":970,"y":750,"wires":[]}]

```

---

<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:** [21 April 2025 09:30 UTC](https://discourse.nodered.org/t/best-way-to-organize-large-flows/96517/16 "2025-04-21T09:30:46Z")

</div>

If using a lot of descriptions, you might find the doc-red plugin useful as it provides visual indicators.

---

<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:** [20 July 2025 09:31 UTC](https://discourse.nodered.org/t/best-way-to-organize-large-flows/96517/17 "2025-07-20T09:31:06Z")

</div>

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