SlackExecution icon
Flow icon
ExecutionStatus icon

Set up alerts for failed workflow executions using Slack

Send instant Slack alerts when any Kestra workflow execution fails or warns, using a single system flow with a Flow trigger and SlackExecution.

Categories
CoreSystem
id: failure-alert-slack
namespace: system

tasks:
  - id: send_alert
    type: io.kestra.plugin.slack.notifications.SlackExecution
    url: "{{ secret('SLACK_WEBHOOK') }}"
    executionId: "{{ trigger.executionId }}"

triggers:
  - id: on_failure
    type: io.kestra.plugin.core.trigger.Flow
    conditions:
      - type: io.kestra.plugin.core.condition.ExecutionStatus
        in:
          - FAILED
          - WARNING

Catch failures the moment they happen with a single, centralized Slack alerting flow. This blueprint sends a Slack notification whenever any Kestra workflow execution finishes in a FAILED or WARNING state, so your team finds out about broken pipelines from a Slack channel instead of from an angry stakeholder. It solves the noisy, scattered problem of wiring per-flow error handling: one flow watches every execution across your instance and routes failures to the right place.

How it works

  1. A io.kestra.plugin.core.trigger.Flow trigger listens for executions across your Kestra instance.
  2. An io.kestra.plugin.core.condition.ExecutionStatus condition narrows the trigger so it only fires when an execution ends with status FAILED or WARNING.
  3. The send_alert task, of type io.kestra.plugin.slack.notifications.SlackExecution, posts a formatted message to Slack using the incoming webhook URL and the failed executionId so the alert links straight back to the run.

What you get

  • Centralized failure alerting in one place, not duplicated in every flow.
  • Slack messages that include the failed execution context and a link back to the run.
  • Coverage for both hard failures (FAILED) and soft failures (WARNING).
  • A pattern you can extend to any team channel or escalation policy.

Who it's for

  • Data and platform engineers who own production pipelines.
  • On-call and SRE teams that triage failures in Slack.
  • Teams standardizing observability across many namespaces and flows.

Why orchestrate this with Kestra

A scheduler can run a job, but it cannot reliably tell you when something elsewhere broke. Kestra's event-driven Flow trigger reacts to the lifecycle of every other execution on the instance, something a single tool's own scheduler cannot do. You get declarative YAML you can version control, retries and lineage on the alerting flow itself, and one source of truth for failure routing rather than copy-pasted error handlers. Slack has no awareness of your pipelines, and a cron tool has no awareness of execution status: Kestra connects the two.

Prerequisites

  • A Kestra instance running this flow.
  • A Slack workspace with an incoming webhook configured for your target channel.

Secrets

  • SLACK_WEBHOOK: the Slack incoming webhook URL used by the send_alert task to post messages.

Quick start

  1. Create a Slack incoming webhook for the channel that should receive alerts.
  2. Store the webhook URL as the SLACK_WEBHOOK secret in Kestra.
  3. Add this flow to your instance and enable it.
  4. Trigger any failing execution to confirm the alert lands in Slack.

How to extend

  • Restrict alerts to specific namespaces by adding an io.kestra.plugin.core.condition.ExecutionNamespaceCondition to the trigger.
  • Add more tasks after send_alert to page on-call, open a ticket, or write to a log.
  • Swap or supplement Slack with email or other notification plugins for layered escalation.
  • Customize the message body and channel routing on the SlackExecution task.

Links

Orchestrate with Kestra
Orchestrate Slack with Kestra
Share this Blueprint
See How

New to Kestra?

Use blueprints to kickstart your first workflows.