Source
yaml
id: on-failure-alert
namespace: company.team
tasks:
  - id: fail
    type: io.kestra.plugin.scripts.shell.Commands
    taskRunner:
      type: io.kestra.plugin.core.runner.Process
    commands:
      - exit 1
errors:
  - id: slack
    type: io.kestra.plugin.notifications.slack.SlackIncomingWebhook
    url: "{{ secret('SLACK_WEBHOOK') }}"
    payload: |
      {
        "channel": "#alerts",
        "text": "Failure alert for flow {{ flow.namespace }}.{{ flow.id }} with ID {{ execution.id }}"
      }
About this blueprint
Notifications DevOps
This flow will fail and the errors section declares tasks that should run on failure.
More Related Blueprints