DiscordExecution icon
Flow icon
ExecutionStatus icon
ExecutionNamespace icon

Send a Discord message when a production workflow fails

Monitor every workflow in a Kestra namespace and post Discord alerts on failure or warning. Event-driven, namespace-level observability with no boilerplate.

Categories
Business

Get instant Discord notifications when production data pipelines break. This blueprint sets up namespace-level failure monitoring across every flow in the company.analytics namespace, so a single reusable flow watches all of your production executions and posts a Discord message the moment one fails or finishes with a warning. No per-flow alerting code, no polling, no missed incidents: define the alert once and Kestra fans it out to every matching execution automatically.

How it works

A Flow trigger (io.kestra.plugin.core.trigger.Flow) listens for completed executions across your instance. Two conditions filter what matters: io.kestra.plugin.core.condition.ExecutionStatus keeps only executions ending in FAILED or WARNING, and io.kestra.plugin.core.condition.ExecutionNamespace restricts the watch to the company.analytics namespace with prefix: true, so child namespaces are covered too. When both conditions match, the send_discord_message task (io.kestra.plugin.discord.DiscordExecution) fires, posting an embed titled "Kestra Flow Notification" to your Discord channel via an incoming webhook. The task passes executionId from {{ trigger.executionId }}, linking the alert back to the exact execution that failed.

What you get

  • Real-time Discord alerts on every failed or warning execution in the namespace
  • One central alerting flow instead of duplicated notification logic in each pipeline
  • Automatic coverage of new flows added to company.analytics with zero extra setup
  • A direct reference to the failing executionId for fast triage

Who it's for

  • Data and platform engineers running production pipelines who need to know about failures immediately
  • On-call teams that live in Discord and want incident signals where they already work
  • Small teams that want robust observability without standing up a separate monitoring stack

Why orchestrate this with Kestra

Discord webhooks have no scheduler, no awareness of pipeline state, and no way to react to job outcomes on their own. Kestra closes that gap. The event-driven Flow trigger reacts to execution outcomes the instant they happen, so alerting is declarative YAML rather than glue code embedded in every pipeline. You also inherit retries, full execution lineage, and a central audit trail, and you can extend the same pattern to any channel without touching the flows being monitored.

Prerequisites

  • A Discord server where you can create an incoming webhook
  • A Kestra instance with the Discord plugin available

Secrets

  • DISCORD_WEBHOOK: the Discord incoming webhook URL the alert is posted to

Quick start

  1. In Discord, open Server Settings, Integrations, Webhooks and create a webhook for your target channel. Copy its URL. See the Discord webhook guide.
  2. Store that URL as the DISCORD_WEBHOOK secret in Kestra.
  3. Adjust the ExecutionNamespace condition to match the namespace you want to monitor.
  4. Add the flow to your instance. Failing executions in that namespace will now trigger Discord alerts.

How to extend

  • Add or change statuses in the ExecutionStatus condition (for example, alert on SUCCESS for critical jobs).
  • Customize the embed title, color, and username, or include execution links and labels in the message body.
  • Route different namespaces to different Discord channels by cloning the flow with another webhook secret.
  • Pair Discord alerts with Slack, email, or PagerDuty tasks for layered, multi-channel notifications.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.