Skip to main content

Running loops/iterations

Altogic's service design flexibility allows users to create complex service flows, including loops/iterations. A loop is a group of connected service nodes repeatedly run (iterations) until a specific condition is met. You can use loops to cycle through object lists, fetch data, repeat functions, and do many other things.

info

Please consider that if you do not correctly set up your loops, then there is a risk that your service execution can infinitely repeat itself. There are limitations in the total number of node executions and duration of service executions to prevent infinite loops. If the total number of nodes executed exceeds a threshold (100K node executions for endpoint and messaging services and 200M node executions for task services) or if the duration of the service execution exceeds a set limit (30 seconds for endpoint and messaging services and 3 hours for task services) then the service execution stops and an error message is returned.

Below is a loop example that iterates over data retrieved from the database. We submit a message to a message queue for each data object until all retrieved objects are processed. When there is no data available to process, we return a successful response.

To form a loop, you need to create a link from an output link point of a node to another node's input link point that was already connected directly or through intermediate nodes.