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.
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.
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
If you need to copy nodes between flows in the 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: