Flow icon
SlackExecution icon

Executes flow on flow trigger with ExecutionStatus condition

Trigger a Kestra flow whenever another execution hits a given status and send a Slack alert. Build status-driven failure monitoring across all your flows.

Categories
Core
id: flow-condition-executionstatus
namespace: company.team

triggers:
  - id: flow
    type: io.kestra.plugin.core.trigger.Flow
    dependsOn:
      - states:
          - FAILED

tasks:
  - id: send_slack_message
    type: io.kestra.plugin.slack.notifications.SlackExecution
    url: "{{ secret('SLACK_WEBHOOK') }}"
    executionId: "{{ trigger.executionId }}"
    payload: "The workflow execution {{ trigger.executionId }} failed for the flow
      {{ trigger.flowId }} in the namespace {{ trigger.namespace }}"

Catch failures across every flow in your instance and react to them automatically. This blueprint uses a Kestra Flow trigger gated by a dependsOn states filter so that whenever any other execution reaches the FAILED state, this flow fires and posts a contextual Slack alert with the failing execution, flow, and namespace. It turns scattered, easy-to-miss failures into a single, status-driven notification pipeline without bolting monitoring logic onto every workflow.

How it works

  • The flow trigger of type io.kestra.plugin.core.trigger.Flow listens to executions produced by other flows in the instance.
  • The trigger's dependsOn entry sets states: [FAILED], so only failed executions pass through.
  • When the states match, the send_slack_message task of type io.kestra.plugin.slack.notifications.SlackExecution posts a message to the Slack webhook URL.
  • The payload interpolates {{ trigger.executionId }}, {{ trigger.flowId }}, and {{ trigger.namespace }} so the alert names exactly which execution failed and where.

What you get

  • Centralized failure alerting for every flow without editing each one.
  • Slack messages enriched with the source execution ID, flow ID, and namespace.
  • A reusable pattern you can point at any execution status, not just FAILED.

Who it's for

  • Platform and data engineers running many flows who need a single monitoring entry point.
  • On-call teams that want failures surfaced in Slack instead of buried in execution logs.
  • Teams standardizing observability across namespaces.

Why orchestrate this with Kestra

The dependsOn states filter lets you react to the lifecycle of other executions declaratively, something a tool's own scheduler cannot do because it has no awareness of cross-flow outcomes. Kestra evaluates the event in real time as executions complete, so there is no polling. You keep retries, full execution lineage, and a single declarative YAML definition, and the trigger scales to every flow in the instance instead of one cron job per workflow.

Prerequisites

  • A running Kestra instance with the Slack plugin available.
  • A Slack incoming webhook URL for the channel that should receive alerts.

Secrets

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

Quick start

  1. Add SLACK_WEBHOOK as a secret in your Kestra instance.
  2. Create this flow and save it.
  3. Run any other flow and let it fail, or trigger a known failing flow.
  4. Confirm the alert lands in your target Slack channel.

How to extend

  • Add more statuses to the states list, such as WARNING or SUCCESS, to broaden coverage.
  • Scope the trigger to specific namespaces or flows by adding a when expression, or flowId/namespace fields, to the dependsOn entry.
  • Swap the Slack task for an email, PagerDuty, or Microsoft Teams notification.
  • Add a follow-up task to automatically restart or quarantine the failed execution.

Links

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

New to Kestra?

Use blueprints to kickstart your first workflows.