SlackExecution icon
Flow icon
ExecutionStatus icon
ExecutionNamespace icon

Failure notifications to Slack to monitor the health of production workflows

Get instant Slack alerts when any Kestra flow in a namespace fails or warns. One Flow trigger covers every workflow, with a link to the failed execution.

Categories
BusinessCore
id: slack-failure-alert
namespace: company.monitoring

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

triggers:
  - id: listen
    type: io.kestra.plugin.core.trigger.Flow
    conditions:
      - type: io.kestra.plugin.core.condition.ExecutionStatus
        in:
          - FAILED
          - WARNING
      - type: io.kestra.plugin.core.condition.ExecutionNamespace
        namespace: company.analytics
        prefix: true

Catch failures the moment they happen instead of discovering broken pipelines hours later. This blueprint posts a Slack alert whenever any flow in the company.analytics namespace finishes in a FAILED or WARNING state, so on-call engineers and data teams get notified in the channel they already watch. The alert carries the executionId, giving everyone a direct link to the failed execution page for fast triage and root-cause analysis.

How it works

  • A io.kestra.plugin.core.trigger.Flow trigger named listen watches the execution state of other flows across the whole instance.
  • Two conditions gate the trigger: io.kestra.plugin.core.condition.ExecutionStatus fires only on FAILED and WARNING outcomes, and io.kestra.plugin.core.condition.ExecutionNamespace with prefix: true scopes it to company.analytics and all of its child namespaces.
  • When a matching execution ends, the send task (io.kestra.plugin.slack.notifications.SlackExecution) posts to Slack via an incoming webhook url, passing executionId so the message includes execution context and a link.

What you get

  • Centralized failure alerting defined once, not copy-pasted into every flow.
  • Coverage of an entire namespace tree, including new flows added later.
  • A clickable path from the Slack message straight to the failed execution.
  • Both hard failures and soft warnings surfaced in one place.

Who it's for

  • Data and platform engineers running production pipelines.
  • On-call and SRE teams that triage incidents from Slack.
  • Analytics teams who need to know the instant a scheduled job breaks.

Why orchestrate this with Kestra

Slack itself has no awareness of your workflows, and most schedulers can only alert on the single job they ran. Kestra's event-driven Flow trigger reacts to the execution state of any flow in a namespace, so one declarative YAML definition replaces per-flow notification boilerplate. You also get retries, full execution lineage, and a searchable history, capabilities a plain webhook or a tool's built-in scheduler cannot provide on their own.

Prerequisites

  • A Kestra instance with the Slack plugin available.
  • A Slack incoming webhook URL for the target channel.

Secrets

  • SLACK_WEBHOOK: the Slack incoming webhook URL used by the send task.

Quick start

  1. Create a Slack incoming webhook and copy its URL.
  2. Store that URL as the SLACK_WEBHOOK secret in Kestra.
  3. Adjust the ExecutionNamespace condition to your own namespace.
  4. Add the flow and let the trigger watch your executions.
  5. Force a test failure to confirm the alert lands in Slack.

How to extend

  • Add or remove states in ExecutionStatus (for example, alert only on FAILED).
  • Swap SlackExecution for SlackIncomingWebhook to send a fully custom message payload.
  • Layer in more conditions, such as filtering by flow id or labels.
  • Route to multiple channels by adding additional notification tasks.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.