Topics
Node-RED Low-Code Programming

Node-RED Low-Code Programming

Node-RED is a low-code programming platform for event-driven applications (such as IoT solutions that trigger actions based on sensor data or events). It was developed by IBM and is now maintained by the OpenJS Foundation.

It comprises a server and a web application that can be accessed using a browser. The server manages the connections, data flow between components and external services and executes the programs with the data processing instructions. The web application enables you to define the connections between components and data flow using a simple graphical user interface, with just a little programming.

Node-RED makes it easy to connect hardware devices, APIs and online services. With a low-code solution like Node-RED you can minimize the effort required to program a microcontroller. Some common tasks like connecting to MQTT brokers can be achieved without needing to write any code.

Flow-based Programming

Flow-based programming is a way of defining the functionality of an application as a series of tasks (or nodes as they are called in Node-RED). Each node has a similar process - it receives some data, performs some operations on the data and passes it to the next node.

This style of programming lends itself very well to a visual representation and GUI-based programming.

Here is an example of how Node-RED can be used:

Data received from IoT devices can have a high volume and velocity where you can receive many data values (if you have multiple sensors) and very rapidly (each sending a reading every second, for example). We may want to store every data value for subsequent analysis, but we wouldn't want to read every single data value in real-time rather than that we want to be notified if a value meets certain criteria (for example, the temperature goes above or below a certain value, if motion is detected, if gas or smoke is detected, a door is opened, etc.).

Node-RED is the perfect solution for such a requirement. It can receive every data value and write every data value to the database, but it can program a function that will only send notifications if the conditions programmed in the function are satisfied.

The lightweight server is built on Node.js, taking full advantage of its event-driven, non-blocking model. In simple terms, the program waits for an event to trigger an action, and when the action is being executed, it continues to listen for the next event and executes that action, etc. This makes it ideal to run on low-powered hardware such as the Raspberry Pi.

This is an example of a low-code program written in the Node-RED editor.

Node-RED Example

The Node-RED website (nodered.org) has excellent documentation so we will not replicate that here. The projects that use Node-RED will explain some of the concepts as they are used.

⚠️

The link to the Node-RED website is valid and secure to the best of our knowledge but you must reconfirm its validity and security yourself before you visit it.