2022.1

Table Of Contents
Node-RED: nodes and common techniques
The nodes and common techniques described in this chapter will help you to start creating
flows for an OLConnect application in Node-RED.
The typical flows that an OL Connect application may have are described separately; see
"Flows in an OL Connect application" on the previous page.
For the user documentation of Node-RED, please refer to Node-RED's website: nodered.org.
See also: "OL Connect Startup flow" on page209
Tip
Add a debug node after a node to verify that the contents of a property of the msg object
are changed as expected.
Nodes used in OL Connect flows
In addition to the "Node-RED: nodes and common techniques" above, these standard nodes
will often be used in OL Connect applications:
l The inject node triggers the flow. It can be setup in a way that it triggers the flow
whenever it is deployed or when Node-RED is started (see "OL Connect Startup flow" on
page209). It can also be used to inject the full path to a (sample) data file into a flow.
l The HTTP in node creates an HTTP end-point for creating web services.
l Any flow that starts with an HTTP in node must have a path to an HTTP response node
otherwise requests will eventually timeout.
l The read file node loads a file. If the file is a JSON file, the result is a JSON string.
l The write file writes the content of msg.payload to a file.
l The JSON node parses a JSON string and adds the keys with their values as properties
to msg.payload.
l The change node can initialize variables and change their value.
l The function node executes JavaScript code. See https://nodered.org/docs/user-
guide/writing-functions.
Page 204