How to Export and Import Flows-Node-Red

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.

export-node-flow

The contents of the export file will be displayed click on export to clipboard.

node-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.

node-red-import-flows

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

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

=====>Understanding the Message object

Related Tutorials and Resources:

 

Please rate? And use Comments to let me know more
[Total: 0    Average: 0/5]

4 comments

    1. 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

  1. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *