Blueprints

Using finally to run the task at the end of the failed flow

Source

yaml
id: finally-failure-flow
namespace: company.team

tasks:
  - id: log
    type: io.kestra.plugin.core.execution.Fail

finally:
  - id: final_task
    type: io.kestra.plugin.core.log.Log
    message: "This task gets executed irrespective of whether the flow is successful
      or failed."

About this blueprint

Software Engineering

This flow demonstrates that the tasks in the finally block gets executed even when the flow has failed.

Fail

Log

More Related Blueprints

New to Kestra?

Use blueprints to kickstart your first workflows.

Get started with Kestra