I will introduce the procedure to create an original function with Node-RED using a

Create original function with Node-RED that can execute JavaScript code.

submited by
Style Pass
2020-07-04 06:06:19

I will introduce the procedure to create an original function with Node-RED using a "function" node that can execute JavaScript code.

Figure 12-10-1-1 is the flow created in "12-9. First flow with Node-RED". This flow was "When you run it, it outputs a timestamp as a debug message." In this article, I will introduce the procedure to add the original function to this flow.

Node-RED has a "function" node where you can create your own function. This node is in the Functional category of Palettes.

Now let's add a "function" node to the flow. The place to add is between the "inject" node and the "debug" node. Drag the "function" node from the palette onto the wire. At this time, the wire changes from the solid line to the dotted line, so drop it as it is.

The wire then automatically connects to both ends of the "function" node, creating a new flow. The "function" node has a blue circle. Do you remember? Don't forget to deploy.

Leave a Comment