Skip to main content
The While loop transformer repeatedly applies a transformer as long as a condition returns true. This enables repeated polling of HTTP endpoints or other iterative operations until a completion condition is satisfied. The loop continues executing the transformer on each iteration until either the condition becomes false or the maximum iteration limit is reached.

Fields

Condition

A required field. The condition to evaluate on each iteration. The loop continues while this filter returns true and breaks when it returns false. You can use any filter type (value condition, pattern condition, key exists, logical operators like AND/OR, etc.) to define when the loop should continue.

Transformers

A required field. The transformers to apply on each iteration of the loop. This can be any transformer including HTTP transformers, data transformers, or even nested transformer chains. The output of each iteration becomes the input for the next iteration.

Maximum iterations

A required field. Defines the maximum number of times the loop will execute. This acts as a safety mechanism to prevent infinite loops. The hard limit is capped at 1000 iterations regardless of the configured value.

Sample data

Polling an HTTP endpoint until job completion.
  • Condition: Value condition filter checking status not equals completed
  • Transformers: HTTP transformer calling GET /api/job/
  • Maximum iterations: 50
Input:
{
    "job_id": "12345",
    "status": "pending"
}
After first iteration:
{
    "job_id": "12345",
    "status": "processing",
    "progress": 25
}
After multiple iterations (final):
{
    "job_id": "12345",
    "status": "completed",
    "progress": 100,
    "result": "success"
}
The loop stops when status equals completed (condition becomes false).