Creation of flows

The Designer facilitate the creation of programs or flows. They are a collection of nodes wired together to exchange messages. In a technical way a flow consists of a list of JavaScript objects that describe the nodes and their configurations, as well as the list of downstream nodes they are connected to, the wires. These collection or wire nodes are connected in order to achieve a ceratin funcionality.

Flows can be exported in JSON format select the Export -> Clipboard option of the Node-RED's dashboard.

The wires define the connections between node input and output endpoints in a flow. They connect the output endpoints of nodes to inputs of downstream nodes indicating that messages generated by one node should be processed by the connected node next. Messages passed between nodes in Node-RED are, by convention, JavaScript Objects called msg, consisting of a set of named properties. It contain a msg.payload property with the payload of the message and may attach other properties to a message, which can be used to carry other information onto the next node in the flow.

To manage the execution of the flow, there are some interesting core nodes that provide the main funcionalities:

Inject nodes

An inject node is commonly the first node in a flow because it allows to inject messages into a flow. The most used functionality of an inject node is to insert a timestamp in order to run the flow.

Debug nodes

The functionality of a debug node is to display a message in the Debug sidebar of the Node-RED's dashboard. The user can select the property of the message (msg) to be displayed, which is the payload of the message by default.

Function nodes

A function node allows to write and execute Javascript code in order to manipulate the message. It is necessary to return the message at the end of the code.

// Javascript code
return msg;

More information

For more information, you can read the official documentation of Node-RED