Pre-populated flows tab for new installations

I'm putting together a software package that includes Node-RED and I would like to have a flows tab populated with pre-configured nodes that the user can copy/paste into their flows. What is the best/safest way to do that?

The seemingly obvious thing to is to include a default flows.json file that has the sample tab. Is that safe to do? I don't want to mess up installations as new version of Node-RED are released that might change the flows file. Is there a more appropriate way to do this?

A pre-populated flows file is probably the safest and easiest option.

Even if we introduce a new file format, we'll still support the existing format for backward compatibility.

1 Like

The default flows file would be generated dynamically from hardware discovery. Are there any rules I need to follow when generating IDs for tabs and nodes? Or is it just random 16-character strings?

Seems to be random 16 hexadecimal (that's backend) and this is frontend - both do the same.

1 Like

Works like a charm. Thanks!!!

1 Like