Keep Parallel and Dag Tasks Running After a Failure with onChildFailure
For the complete documentation index, see llms.txt. For a full content snapshot, see llms-full.txt. Append.mdto anykestra.io/docs/*URL for plain Markdown.
Available on:Open Source EditionEnterprise Edition
Parallel and Dag tasks now interrupt their other running tasks when one task fails. The new onChildFailure property controls this behavior, and its default is FAIL on both tasks.
| Task | onChildFailure default |
|---|---|
io.kestra.plugin.core.flow.Parallel | FAIL from 2.0.0 |
io.kestra.plugin.core.flow.Dag | CONTINUE in 2.0.0 to 2.0.7, FAIL from 2.0.8 |
In 1.x, the other tasks kept running to completion after a failure.
What changes after upgrading
When a task inside a Parallel or Dag fails with no retry left, and onChildFailure is FAIL:
- Tasks that are still running are interrupted and end in the
FAILEDstate. This includes tasks nested at any depth, such as tasks inside aSequentialbranch. - Each interrupted task logs a warning that names the task that caused the interruption:
Task terminated because sibling task '<task_id>' failed. - The
ParallelorDagtask itself ends in theFAILEDstate, and itserrorsandfinallytasks run as before.
Migration steps
- Search your flows for tasks of type
io.kestra.plugin.core.flow.Parallelandio.kestra.plugin.core.flow.Dag. - For each task that should let its other tasks finish after one fails, add
onChildFailure: CONTINUE. - Check any existing
onChildFailurevalues. The accepted values areCONTINUE,CANCEL, andFAIL. ReplaceCANCELLEDwithCANCELandFAILEDwithFAIL.
Before: in 1.x, extract_customers kept running after extract_orders failed.
id: parallel_flownamespace: company.team
tasks: - id: parallel type: io.kestra.plugin.core.flow.Parallel tasks: - id: extract_orders type: io.kestra.plugin.core.execution.Fail
- id: extract_customers type: io.kestra.plugin.core.flow.Sleep duration: PT1MAfter: set onChildFailure: CONTINUE to keep the same behavior.
id: parallel_flownamespace: company.team
tasks: - id: parallel type: io.kestra.plugin.core.flow.Parallel onChildFailure: CONTINUE tasks: - id: extract_orders type: io.kestra.plugin.core.execution.Fail
- id: extract_customers type: io.kestra.plugin.core.flow.Sleep duration: PT1MWith onChildFailure: CONTINUE, extract_customers runs for its full minute after extract_orders fails. Without it, Kestra interrupts extract_customers as soon as extract_orders fails.
The same property works on Dag:
- id: dag type: io.kestra.plugin.core.flow.Dag onChildFailure: CONTINUE tasks: - task: id: extract_orders type: io.kestra.plugin.core.execution.Fail - task: id: extract_customers type: io.kestra.plugin.core.flow.Sleep duration: PT1MTo set interrupted tasks to CANCELLED instead of FAILED, use onChildFailure: CANCEL.
Kestra saves a flow with an unrecognized onChildFailure value, such as CANCELLED or FAILED, without a validation error. When a task fails, the Parallel or Dag task fails with an error log and the other running tasks are not interrupted.
Related
Was this page helpful?