Node red makes it easy to save, share and move flows between computers using the export and import feature.
Flows are exported as a JSON file and imported from a JSON file.
You can export parts of a flow or the entire flow or even all flows.
Exporting Flows
Press CTRL and Click each node in the flow that you want to export. The nodes will be highlighted.
Note: Use CTRL+A to select all nodes in the workspace.
Then click on Menu>export>clipboard.
The contents of the export file will be displayed click on export to clipboard.
There are three tabs on the screen with the selected nodes tab selected.
You can change it to export the entire flow or all flows in the workspace.
Click export to clipboard and then open a file editor and paste the contents into the file using CTRL+V.
Give the file a name and save it.
Importing A Flow
You will need to open the flow in a text editor, and then copy its contents using CRTL+C.
You then go to Menu>import>clipboard and paste the file into the window.
You can import the flow into an existing flow or into a new flow.
Click the import button to complete the import.
Import Problems
If you find that the import button doesn’t change colour and a red line appears around the text box it is probably because what you are trying to import isn’t valid JSON.
You can test it by pasting it into this On Line JSON checker
A confusing issue I found is that my export file verified OK using the JSON checker but failed when doing an import at a remote location.
The problem was due to smart quotes in the export file.
I pasted the file into this online smart quotes removal tool to remove them, and then sent it, and it worked OK.
Video -How to Copy Nodes and Flows in Node-Red -(3 Methods includes export )
Using Copy and Paste to Copy Nodes In A Flow
If you need to copy nodes between flows in the same node-red Workspace then you can use copy and paste.
This works just like copying text in a word processor. You simply select the nodes you want using the CTRL key to select individual nodes together into a group or CTRL+A to select all nodes in the workspace.
Then use CTRL+C to Copy.
You then move to the place on the workspace or open the workspace where you want to copy the nodes to and use CTRL+V to paste the nodes/flow into the workspace.
Note: This only works for flows in the same workspace.
Common Questions and Answers
Q- Can I use the export feature to backup my flows.
A- Yes it is one of the backup methods you can use.
<=====Deploying Node-Red Flows
Related Tutorials and Resources:
- Using The Node-Red Library
- How to use the Editor, nodes and flow basics.
- Securing Node-Red with SSL and Username Authentication
- Deploying Node-Red Flows
- Using Subflows and Groups in Node-Red
Hello steve
I encountered node-red to solve farm automation by myself.
There are many things I don’t know, but the answer is difficult to find,,,,
However, thank you very much for the many serious things I have found from you.
In Jinan, Korea
Hi, very good tutorial. I follow always your video.
How is it possible to export library as well? I mean, when I have a new Node Red installation and I import node the library is not included and I have to install it.
Does exist a full backup? Thanks.
You should be able to simply copy the lib/flows folder .
Rgds
Steve
Hello,
Is there any way to build a flow and export the JavaScript code itself?
I assume you mean the code for the actual nodes.
Not as far as I a aware. Is there a reason why you need it?
rgds
steve
Hi Steve,
Nice tutorial – thanks!
A quick question/scenario:
– Given that I have a few small (pi-driven) node-red instances out in the wild – all having the same set of flows.
– And I periodically may need to update these flows (correct errors, improve functionality etc).
– Is there a way to automate this process and do it OTA? For example have a node-red flow check for updates and then update other flows as required.
Hope I’m making sense.
Thanks.
Not that I know off but a good idea. I’ll look more into it.
Rgds
steve