Blueprints

Allow failure of a group of tasks

Source

yaml
id: allow-failure-demo
namespace: company.team

tasks:
  - id: allow_failure
    type: io.kestra.plugin.core.flow.AllowFailure
    tasks:
      - id: fail_silently
        type: io.kestra.plugin.scripts.shell.Commands
        taskRunner:
          type: io.kestra.plugin.core.runner.Process
        commands:
          - exit 1

  - id: print_to_console
    type: io.kestra.plugin.scripts.shell.Commands
    taskRunner:
      type: io.kestra.plugin.core.runner.Process
    commands:
      - echo "this will run since previous failure was allowed ✅"

  - id: fail
    type: io.kestra.plugin.scripts.shell.Commands
    taskRunner:
      type: io.kestra.plugin.core.runner.Process
    commands:
      - echo "failing and blocking downstream tasks ❌" && exit 1

  - id: will_never_run
    type: io.kestra.plugin.scripts.shell.Commands
    taskRunner:
      type: io.kestra.plugin.core.runner.Process
    commands:
      - echo "this will never run ⛔️"

About this blueprint

CLI

This flow demonstrates how to use the AllowFailure task to allow a task to fail without blocking downstream tasks. The AllowFailure task is useful if you don't want to block downstream tasks when a specific task fails. In this example, the task fail_silently will fail, but the flow will continue to run and the task print_to_console will run. The task will_never_run will never run because the task fail will block downstream tasks after failure.

Allow Failure

Commands

Process

More Related Blueprints

New to Kestra?

Use blueprints to kickstart your first workflows.

Get started with Kestra