Project JSON Flow - Separate File per Flow/Tab?

#1

Is there a way to configure Node-RED to create separate flow.json files - one for each "flow" (aka tab) within the set of flows for a given Node-RED Git enabled project? The reason being is that as an overall flow gets large it is convenient to be able to move a set of nodes to a specific flow/tab within the overall Node-RED project (as is currently supported). However, when this is done Node-RED still saves all of flows configuration to a single flow.json file (instead a separate .json file for each flow). From the Git version control perspective, effectively the entire program's "code" lives in a single file - which can get very large. Several benefits would be provided, from a Git perspective, if each distinct flow/tab was saved into its own file (e.g. smaller individual flow files, version history per flow, easier multi-user team development - e.g. each team member responsible for a specific flow file, etc.)

If this can't be done today could this feature be considered? For example, allow the settings.js file to optionally have Node-RED save each flow/tab to a separate file - with perhaps the master flow.json file pointing to each of the individual flow files. Thanks.

PS - I used to develop with Microsoft LightSwitch (now discontinued btw) which was similar to Node-RED in that it was RAD tool with a visual dev interface that would automatically generate program "code" - in their case it was XML. With the first version of LightSwitch the application would write all the "code" to a single file - but eventually based on feedback (specifically regarding the size of the "code" file and to also facilitate multi-user project development) Microsoft enhanced LightSwitch so that each distinct screen would be written to its own file.

1 Like
#2

A very interesting demand. I second that. :+1:

#3

so Microsoft lightswitch started with a single file - then moved to multiple files - then the project folded.... not sure that is a path we want to follow :slight_smile:

3 Likes
#4

@dceejay, it's easy: just do the "multiple files" feature while avoiding the "project folding" feature ... :stuck_out_tongue_winking_eye:

#5

Hi,

Yes this has been discussed lots of times. There is an item on the backlog for looking at how to split up the flow file.

2 Likes
#6

We had an internal plugin in the past that did exactly that. It does help git workflows to some extent. I also wrote a public node that converts flows to YAML, the nice thing is it allows multiline function nodes so diffs are easier. Having both possibilities would be the best, we also work with very large projects (20 tabs, 30-40 subflows) and git work with more than 2 persons is almost impossible, we have to take turns which is less than ideal. The projects feature could help but I'm not convinced it would be efficient for very large projects.

1 Like