Complete Node in Node Red
In this post i will share ,how to use Node Red Complete Node
A Complete Node can be use to monitor execution of specific line of a node.
When the node Monitor by a Complete node has completed execution , it will pass the msg.payload from the monitored node to the Complete Node.
after that ,User can use the Complete Node to trigger other process.
Lets Build the Complete Node
Step 1
We Will build the Node to be Monitored by Complete Node.
Drag out an inject node and configure as below
Step 2
Build the Count and Trigger Node
Drag out the Function Node and paste the Code below inside the Function Node at the On Message Tab Area.
There are 2 component s. the interval function will keep adding count by 1000 ( 1 Second )
While the SetTimeOut , parameter is set to 5000 ( 5 Second ) to time out . In the SetTimeOut function , first it will clear the Interval , update the node Status , update the lastest node count to payload.
Step 3
Drag Out Debug Node , and joint all 3 Nodes as below
Step 4
Drag out the Complete Node , configure as below
Step 5
Drag out the Function Node and paste the code below into the function node on message tab .
This Function node will get the msg.payload value from the “Count and Trigger ” Function passed to Complete Node
Step 6
Drag out the debug node and joint the node as below , Trigger the Inject Node and observe the result
Results
Check out how to declare global Variable in Node Red
Leave a Reply