Skip to main content
A Loop repeats the nodes placed inside its card. Drag a node into the card to include it. It leaves when you drag it out, or when you shrink the card so its center is outside. Nodes after the card run once. Connect the previous node into the handle on the left. Connect the first node inside from the handle under the title. Connect the node that runs after the loop from the handle on the right. While the run is going, the card shows the current step and the total, starting at 1. Each item uses the number of elements. While uses Max iterations. Index on Insert value still starts at 0.

Each item

Each item reads an array from the previous node’s JSON. Items path defaults to items, which matches Read records: { "items": [], "nextCursor": null }. On each step, the first node inside receives the current element as its input. Insert value on that edge lists Item and Index (Index starts at 0). A Code node anywhere in the card reads that element as item. An empty array finishes with 0 iterations. An array longer than Max iterations fails the run before any node inside runs.

While

While repeats until the expression is false, or until Max iterations. The expression uses the same input as Condition, plus index. It does not see the nodes inside the card. The first node inside receives the Loop input (the previous node’s JSON) on every step. If the expression is still true at the cap, the run succeeds and Stopped is max.

After the loop

The handle on the right runs once. Its Result is JSON:
stopped is empty, end, condition, or max. Results of the nodes inside are not copied into this JSON.

Limits

Max iterations cannot be higher than 100. A Loop can sit inside another Loop, up to 3 levels. Trigger and Respond cannot be placed inside. One error inside fails the run. Run this step on the Loop runs every iteration. Run this step on a node inside runs that node once and uses the Loop Test input as the current element.