younifyd
Menu

Do While

Run the loop body first, then repeat while a condition stays true, up to a max iteration cap.

Use it in a workflow

  1. Add a step and choose the For Loop connector.
  2. Pick the Do While action (under workflow).
  3. Fill in the fields below, then reference the result from later steps as {{doWhile.response.data}}.

Fields

continueConditionobjectrequired

Evaluated after each iteration; the loop repeats while this is true. Same recursive ConditionNode JSON shape as the Conditional connector's branch conditions (single condition or nested AND/OR groups) — rendered by a dedicated condition-builder widget, not by walking this schema. Can reference {{runtimeVariables.x}} (see the Variable connector), step outputs, and trigger data.

maxIterationsnumberrequired

Safety cap on how many times the loop body can run, in case the condition never becomes false.

Default 1000

indexVariablestring

Optional variable name to hold the current iteration index (e.g., 'index', 'i').

Default "index"

recordIdentitystring

Expression identifying this iteration's stable business key (e.g. {{runtimeVariables.orderId}}). Enables cross-run history, per-record filtering, and record-scoped rerun in batch jobs, same as For Each. Falls back to iteration index when unset.

isPrimaryProgressSourceboolean

Mark this loop's progress as the one that rolls up into the batch job's top-level 'X of Y' progress and record count. Defaults to false — with a single loop in the whole call graph (including any loops inside called workflows/routes) it's picked automatically, but with more than one, exactly one must be marked explicitly or the batch job will pick whichever happens to report first.

Default false

Examples

Poll until a job finishes

Repeat the loop body (e.g. a status-check HTTP call) while a runtime variable still reads 'pending', up to a safety cap of 50 attempts

json
{
  "continueCondition": {
    "type": "condition",
    "lhs": "{{runtimeVariables.jobStatus}}",
    "operator": "equals",
    "rhs": "pending"
  },
  "maxIterations": 50,
  "indexVariable": "attempt"
}

Need more? See the For Loop guide for connection setup and behaviour shared by every action.

Was this page helpful?
Do While — For Loop — Documentation