# Ability to structure flows

**URL:** <https://discourse.nodered.org/t/ability-to-structure-flows/44138>\
**Category:** General\
**Created:** [14 April 2021 01:24 UTC](https://discourse.nodered.org/t/ability-to-structure-flows/44138 "2021-04-14T01:24:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickgrealy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nickgrealy/32/40269_2.png) [@nickgrealy](https://discourse.nodered.org/u/nickgrealy)\
**Post date:** [14 April 2021 01:24 UTC](https://discourse.nodered.org/t/ability-to-structure-flows/44138/1 "2021-04-14T01:24:18Z")

</div>

Hi all,

Just coming from an existing tooling background, and was wondering if there's any way to structure the flows in the "Info \> Flows" section, using "folders".

Something like this (excuse the copy&paste job):  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/5/45fd588becd59e70789810f3f5723f142b985499.png)

I've seen all the documentation around adding multiple flows under a single flow - which is nice, but not what I'm looking for.

Will continue searching plugins - even happy to have a crack at writing my own.

Kind regards,  
Nick

Related

- [Documenting flows : Node-RED](https://nodered.org/docs/developing-flows/documenting-flows)
- [Vertical flow view - #12 by Steve-Mcl](https://discourse.nodered.org/t/vertical-flow-view/5487/12)

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [14 April 2021 06:41 UTC](https://discourse.nodered.org/t/ability-to-structure-flows/44138/2 "2021-04-14T06:41:16Z")

</div>

You cannot group your Tabs as suggested in your screenshot.

The Outline is just a tree-like representation of your editor workspace. IMO, the term "flow" is a bit misleading for new users, because in the editor "Tabs" are named flows, too. In general, a flow is a bunch of nodes connected by wires.

You can, however, use the _Groups feature_ to group nodes together. Groups are represented in the outline by an additional tree node under your Tab node, and help a lot for the usability of the outline view. Otherwise nodes are just listed in one level under the Tab, which can be quite large.

You can also _name_ your groups for better readability in the Outline.

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

---

<div class="post-metadata">

**Author:** ![nickgrealy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nickgrealy/32/40269_2.png) [@nickgrealy](https://discourse.nodered.org/u/nickgrealy)\
**Post date:** [14 April 2021 16:54 UTC](https://discourse.nodered.org/t/ability-to-structure-flows/44138/3 "2021-04-14T16:54:25Z")

</div>

Hi @kuema ,

Thanks for the response. Groups is really great for readability in the Outline view - that's exactly the navigation I wanted. (this is my second day using node-red, so thanks for introducing me to Groups 👍 ).

However, as you suggested, I'm ideally wanting to structure/group Tabs under the Outline Flows.

I'm currently using a pseudo naming standard to replicate folders. e.g.

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

The reasoning behind having structured/grouped Tabs, was to:

- Reduce team member commit conflicts (e.g. I assume Tabs handled as separate files on the backend... ?)
- Improve the readability of complex Tabs (by de-composing them into smaller units)
- Improve readability in the Outline

I'll continue looking around (still early days for me)...

Found these:

- [node-red-contrib-multiproject (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-multiproject) (outdated project / no longer working?) - similar functionality, uses an "invisible" node to group Flows (Tabs?)
- [Folders of tabs](https://discourse.nodered.org/t/folders-of-tabs/738) - old feature request for same behaviour

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [14 April 2021 16:56 UTC](https://discourse.nodered.org/t/ability-to-structure-flows/44138/4 "2021-04-14T16:56:29Z")

</div>

> [@nickgrealy](#):
>
> I assume Tabs handled as separate files on the backend... ?)

bad assumption - currently there is only ONE flow file... made up of multiple tabs etc.

---

<div class="post-metadata">

**Author:** ![nickgrealy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nickgrealy/32/40269_2.png) [@nickgrealy](https://discourse.nodered.org/u/nickgrealy)\
**Post date:** [14 April 2021 23:16 UTC](https://discourse.nodered.org/t/ability-to-structure-flows/44138/5 "2021-04-14T23:16:00Z")

</div>

Hi @dceejay , indeed. Just checked a vanilla project with two Tabs = there's only one `flows_*.json` file.

Looks like there's no logical grouping (/ordering?) by Tab within the `flows_*.json` file either, which I imagine would make it very difficult to sort out merge conflicts (specifically for [GIT Projects](https://nodered.org/docs/user-guide/projects/))?

More investigation required (by me) - thanks for the input.

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [15 April 2021 06:11 UTC](https://discourse.nodered.org/t/ability-to-structure-flows/44138/6 "2021-04-15T06:11:48Z")

</div>

It's hard to have people working concurrently in one Node-RED instance to start with. It's even harder with larger projects. Though it has some safeguards to prevent overwriting changes of others (the "merge" popup), it wasn't (initially) designed for multiple users at the same time.

To best option is sticking to a set of tabs for each user. Or you could setup different instances for parts of your project.  
That's what we did at work, we split our logical features over multiple instances. It also benefits reusablility for other projects.

However, for improved textual change-tracking, I suggest you enable the `flowFilePretty` setting in your settings.js. That way the flow isn't stored as one line, but in a more GIT friendly way.

---

<div class="post-metadata">

**Author:** ![nickgrealy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nickgrealy/32/40269_2.png) [@nickgrealy](https://discourse.nodered.org/u/nickgrealy)\
**Post date:** [15 April 2021 06:46 UTC](https://discourse.nodered.org/t/ability-to-structure-flows/44138/7 "2021-04-15T06:46:39Z")

</div>

Thanks @kuema - I'll use `flowFilePretty`. 👍

---

<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:** [15 April 2021 08:16 UTC](https://discourse.nodered.org/t/ability-to-structure-flows/44138/8 "2021-04-15T08:16:45Z")

</div>

If you run this script in your .node-red folder it well create a version of the flows file with function nodes formatted as they appear in the editor (more or less). If you also keep that in your git repo then you can get diffs showing changes within function nodes. It adds .formatted to the flows file name.

```auto
#!/usr/bin/env sh

# generates formatted versions of node red flow files matching flow*.json
# in files flow*.json.formatted

# NOTE must have flowFilePretty: true in settings.js

for f in flow*.json; do
  echo $f
  sed -r 's/\\n/\n/g' "$f" > "$f.formatted"
done
# remove any cred files converted
rm *_cred.json.formatted

```

---

<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:** [15 May 2021 08:17 UTC](https://discourse.nodered.org/t/ability-to-structure-flows/44138/9 "2021-05-15T08:17:16Z")

</div>

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