Skip to main content
Repeats one or more transformers over and over for as long as a condition stays true. Before each pass it checks your condition against the current data; while the condition holds it runs the transformers, then checks again. The moment the condition no longer holds, the loop stops and the data continues on its way. This is useful for tasks that need to keep going until something is done, such as following pages of results, draining a queue one item at a time, or repeatedly adjusting a value until it reaches a target. Because the loop keeps going until the condition turns false, the transformers you run should change the data in a way that will eventually make the condition false. As a safety net there is also a hard limit on the number of passes (see Maximum iterations), which stops the loop even if the condition never becomes false.

Fields

The fields are spread across three tabs: Condition, Transformers, and Settings.

Condition

Transformers

Settings

Sample data

This example uses a simple counter to show the loop in action. The condition keeps running while counter is less than 3, and on each pass the Apply operator step adds step (which is 1) to counter. The loop runs three times and then stops once counter reaches 3.
FieldValue
Conditioncounter is less than 3
TransformersApply operator: add step to counter, store in counter
Maximum iterations100
Input:
{
    "sku": "WS-001",
    "counter": 0,
    "step": 1
}
Output:
{
    "sku": "WS-001",
    "counter": 3,
    "step": 1
}