Core Plugins and tasks LoopUntil

Core Plugins and tasks LoopUntil

Certified

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.

yaml
type: io.kestra.plugin.core.flow.LoopUntil

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.

yaml
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

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.

Min items1

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
Default{ "interval": "PT1M" }

Check the frequency configuration

Definitions
intervalstring
DefaultPT1M

Interval between each iteration

maxDurationstring

Maximum duration of the task

If not set, defines an unlimited maximum duration of iterations.

maxIterationsintegerstring

Maximum count of iterations

If not set, defines an unlimited number of iterations.

List of tasks to run if any tasks failed on this FlowableTask.

Defaultfalse

If set to true, the task run will end in a failed state once the maxIterations or maxDuration are reached.