https://github.com/hcl-tech-software/node-red-contrib-hcl-iterate-loop
This Node-RED node allows you to build loops, just like a for loop in any programming language do, iterating over the selected parts in the flow. Playing with the starting point, increment/decrement values and condition to be evaluated in each iteration.
https://github.com/hcl-tech-software/node-red-contrib-hcl-iterate-loop
loops model-realtime node-red node-red-contrib
Last synced: 4 months ago
JSON representation
This Node-RED node allows you to build loops, just like a for loop in any programming language do, iterating over the selected parts in the flow. Playing with the starting point, increment/decrement values and condition to be evaluated in each iteration.
- Host: GitHub
- URL: https://github.com/hcl-tech-software/node-red-contrib-hcl-iterate-loop
- Owner: HCL-TECH-SOFTWARE
- License: apache-2.0
- Created: 2020-10-26T08:42:48.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-30T18:02:46.000Z (over 5 years ago)
- Last Synced: 2025-07-29T20:40:34.460Z (11 months ago)
- Topics: loops, model-realtime, node-red, node-red-contrib
- Language: HTML
- Homepage:
- Size: 167 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-red-contrib-hcl-iterate-loop
Node-RED node to build loops and interact with others nodes in a flow.
Basically working like a `for loop`.
## Config iterate-loop
Below are the inputs properties required to make it possible.
- Variable name, that can be associated to a context variable(`msg`, `flow`, `global`).
- Value to start the loop, can be a number or a variable from a context(`msg`, `flow`, `global`).
- Condition to finish the loop, choosing from an operator (`==`, `<`, `<=`, `>`, `>=`) and a value to compare with (`number`, `msg`, `flow`, `global`).
- Increment/Decrement value (`number`, `msg`, `flow`, `global`). Note: for decrement is enough with enter negative values and for increment positive values.
The loop will continue as long as the condition it is `TRUE`, throwing an output to the output label `continue` in each iteration.
When the condition changes to `FALSE` the loop will terminate an the output will be send to the output label `exit`
## Basic example
With an example can be more straightforward to understand how this node works, the flow is available in the example folder of this repo.

node0.png - *node in resting mode*

node1.png - *looping status*

node2.png - *terminated loop status*

node-output.png - *output from debug messages*

node-output.png - *configuration properties of the node*
## License
[Apache 2.0](./LICENSE).