NodeRED. Flow-based programming
The information provided below is intended to be complementary to the project script and is not required reading.
Motivation
Node-RED is an open source visual programming tool that allows you to generate communication flows in a very intuitive way. Node-RED is built on top of Node.js, a runtime environment for JavaScript, which allows you to work on it directly in the browser.
Throughout the development of the project you will see how communications with other applications are created and configured in Node-RED, and this experience can be very useful in the future since Node-RED can be installed on a multitude of operating systems and hardware. Some of the possibilities are
- Low cost devices like Arduino, Raspberry Pi or Beagelbone Black.
- Run locally on local computers and servers (on-premise). This allows a distribution of data and event processing capacity across a company's network of devices.
- Execution in the cloud using platforms such as Azure, developed by Microsoft, which will be the one you will use in the course project. This option allows Node-RED to be integrated with the wide spectrum of managed services offered by cloud service providers: databases, Big-Data, Machine Learning, etc.
In the following link you can find the official page of Node-RED:
Communication flows or flows
In Node-RED, a communication flow or flow is a .JSON file where one or more data flows have been programmed. These flows are created by dragging the desired nodes from the side palette (highlighted in red in the following screenshot) to the workspace, where they can be connected to each other and configured with parameters and attributes specific to each node.

The possibility of configuring and connecting the nodes is particularly suitable for Internet-of-Things (IoT) solutions, where the flexibility of data flows and their scalability are fundamental factors for their adaptation to the constant evolution of technology. .
The simplest method of organizing Node-RED streams is to separate them into multiple tabs within the editor, as there is an option to compile and run all tabs simultaneously.
Nodes
There are many types of nodes, but all of them can be included in one of the following three categories depending on their situation in a data flow:
- Flow initiator nodes that initiate or trigger process flow execution (e.g. an Inject node).
- Intermediate nodes that perform actions with the information they receive in the data flow and pass the resulting data to the following nodes (e.g. a function node).
- Flow terminal nodes that trigger specific actions when the data flow reaches them (e.g. an Influx Batch node).
The basic node palette that Node-RED offers when installed in its lighter version can be extended by installing new packages in the form of community-developed plugins.
In addition, it is possible to create new nodes according to the needs of each application. This process is as simple as creating an HTML file with a configuration form available on the official Node-RED page, and a JS (Java Script) file with the node logic written in NodeJS.
You can find all the information regarding the creation of new nodes in the official documentation:
https://nodered.org/docs/creating-nodes/
Compatibility with communication protocols
Node-RED is currently capable of managing data flows through widely used protocols such as:
- Modbus
- TCP/IP
- UDP/IP
- MQTT
- HTTP
- Application APIs such as Twitter, Facebook, etc..
Therefore, any application that uses these protocols is likely to be implemented on Node-RED.