It is sometimes useful to reuse a piece of code you or someone else wrote. For that flows can be imported and exported from the editor using their JSON format, making it very easy to share flows with others
The Import dialog can be used to import a flow by the following methods:
- pasting in the flow JSON directly,
- uploading a flow JSON file,
- browsing the local flow library,
- browsing the example flows provided by installed nodes.
In all cases, the dialog offers the option to import the nodes into the current flow, or to create a new flow for them.
Importing json code
Importing json file
Export Flows dialog
The Export dialog can be used to copy flow json out of the editor by the following methods:
- copying the JSON to the system clipboard,
- downloading the JSON as a file,
- saving it to the local flow library.
It can export either the selected nodes, the current flow (including its tab node) or the complete flow configuration.
It offers the option to export compact or formatted JSON. The compact option generates a single line of JSON with no whitespace. The formatted JSON option is formatted over multiple lines with full indentation - which can be easier to read.
Tutorial credits: https://nodered.org/docs/user-guide/editor/workspace/import-export