
Core Plugins and tasks LoopUntil
CertifiedRepeat tasks until a condition becomes true.
Core Plugins and tasks LoopUntil
Repeat tasks until a condition becomes true.
Runs the child tasks in a loop, evaluating condition after each iteration. Condition is rendered and coerced to boolean; loop stops when true or when maxIterations/maxDuration in checkFrequency are hit (optionally failing via failOnMaxReached).
Iteration count and outputs are available under outputs.loop.* for conditions or downstream use.
type: io.kestra.plugin.core.flow.LoopUntilExamples
Run a task until it returns a specific value. Note how you don't need to take care of incrementing the iteration count. The task will loop and keep track of the iteration outputs behind the scenes — you only need to specify the exit condition for the loop.
id: loop_until
namespace: company.team
tasks:
- id: loop
type: io.kestra.plugin.core.flow.LoopUntil
condition: "{{ outputs.return.value == '4' }}"
tasks:
- id: return
type: io.kestra.plugin.core.debug.Return
format: "{{ outputs.loop.iterationCount }}"
Properties
condition *Requiredstring
The condition expression that should evaluate to true or false
Boolean coercion allows 0, -0, null and '' to evaluate to false; all other values will evaluate to true.
tasks *RequiredNon-dynamicarray
checkFrequency Non-dynamic
{
"interval": "PT1M"
}Check the frequency configuration
io.kestra.plugin.core.flow.LoopUntil-CheckFrequency
PT1MInterval between each iteration
Maximum duration of the task
If not set, defines an unlimited maximum duration of iterations.
Maximum count of iterations
If not set, defines an unlimited number of iterations.
errors Non-dynamicarray
List of tasks to run if any tasks failed on this FlowableTask.
failOnMaxReached booleanstring
falseIf set to true, the task run will end in a failed state once the maxIterations or maxDuration are reached.
finally Non-dynamicarray
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.