Loop

Loop

Repeat a set of steps while a condition holds, up to a maximum number of iterations

Fields

FieldTypeRequiredDescription
whilecondition treeyesRe-evaluated before each iteration; if false at entry, the body never runs.
maxIterationsinteger, 1-50yesHard cap enforced by both validation and the run engine.
bodyarray of stepsyesSteps run each iteration.

Example

{
  "id": "01H8XGJVBWX7Y5Z3K9M2N4P6Q1",
  "type": "loop",
  "while": {
    "op": "<",
    "a": {
      "path": "vars.run.i"
    },
    "b": {
      "literal": 5
    }
  },
  "maxIterations": 10,
  "body": []
}

Did this page help you?