
Flow If
CertifiedBranch tasks based on a rendered condition.
Flow If
Branch tasks based on a rendered condition.
Renders condition and coerces it to boolean (the strings false, 0, -0, an empty string and null are false; every other value is true). Executes then when true, else when false, with optional errors/finally blocks.
Frequently used after previous task results to drive control flow.
type: io.kestra.plugin.core.flow.IfExamples
id: if
namespace: company.team
inputs:
- id: string
type: STRING
required: true
tasks:
- id: if
type: io.kestra.plugin.core.flow.If
condition: "{{ inputs.string == 'Condition' }}"
then:
- id: when_true
type: io.kestra.plugin.core.log.Log
message: "Condition was true"
else:
- id: when_false
type: io.kestra.plugin.core.log.Log
message: "Condition was false"
Properties
condition *string
The If condition which can be any expression that evaluates to a boolean value.
Boolean coercion evaluates the strings 'false', '0', '-0', an empty string and null to false; all other values evaluate to true.
then *array
1List of tasks to execute if the condition is true
assets
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.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset 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.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150else array
List of tasks to execute if the condition is false
errors array
List of tasks to execute in case of errors of a child task
finally array
Outputs
evaluationResult boolean
Condition evaluation result