WhatsAppExecution icon
Flow icon
ExecutionStatus icon
ExecutionNamespace icon

Send a WhatsApp notification when a workflow fails

Send WhatsApp notifications when Kestra workflows fail or warn. A reusable system flow that turns execution status into instant mobile alerts.

Categories
Core

Turn Kestra execution failures into instant mobile alerts with a reusable WhatsApp notifier. This system flow listens for any workflow under the company namespace that ends in FAILED or WARNING state and pushes a message to the on-call team through a WhatsApp webhook, so incidents are seen on the device people actually check. It replaces ad-hoc email rules and Slack-only alerting with a mobile-first channel that fits how distributed and on-call engineering teams actually work.

How it works

  • A Flow trigger (io.kestra.plugin.core.trigger.Flow) listens for executions of other flows in the same instance.
  • Two conditions filter the firehose: io.kestra.plugin.core.condition.ExecutionStatus keeps only FAILED and WARNING runs, and io.kestra.plugin.core.condition.ExecutionNamespace with comparison: PREFIX and namespace: company keeps only flows under that namespace tree.
  • The send_notification task (io.kestra.plugin.meta.whatsapp.WhatsAppExecution) posts the alert through your WhatsApp webhook URL, with a profileName, a from phone number, a list of recipient whatsAppIds, and a payload that includes {{ trigger.executionId }} and {{ taskrun.startDate }}.

What you get

  • Real-time WhatsApp pings for any failed or warning execution under company.*.
  • One central system flow instead of per-flow notifier tasks.
  • Execution IDs and start times embedded in the message for fast triage.
  • A pattern you can clone for other namespaces, teams, or severity levels.

Who it's for

  • Platform and data engineers running production pipelines on Kestra.
  • SRE and on-call teams that prefer WhatsApp over email or chat apps.
  • Analytics and ML teams that need to know the moment a critical job fails.

Why orchestrate this with Kestra

WhatsApp has no native concept of "send me a message when a data pipeline fails." Kestra fills that gap: Flow triggers turn execution state changes into events, declarative YAML keeps the alerting logic in Git next to the workflows it protects, and conditions let you scope alerts by namespace, status, or labels without writing glue code. Retries, execution lineage, and full audit history mean you can prove what fired, when, and why, something a bare webhook script cannot do.

Prerequisites

  • A WhatsApp messaging provider that exposes an incoming webhook URL (for example a WhatsApp Business API gateway).
  • A registered sender phone number and the recipient WhatsApp IDs.
  • Workflows running under a company.* namespace (adjust the prefix to match yours).

Secrets

  • WHATSAPP_WEBHOOK: the full webhook URL used to deliver messages.

Quick start

  1. Add the WHATSAPP_WEBHOOK secret to your Kestra instance.
  2. Update from, profileName, and whatsAppIds with your real sender and recipients.
  3. Adjust the ExecutionNamespace condition to match the namespace prefix you want to monitor.
  4. Deploy the flow to a system namespace, for example system or company.alerts.
  5. Trigger a test failure with a flow whose only task is io.kestra.plugin.core.execution.Fail and confirm the WhatsApp message arrives.

How to extend

  • Add severity routing by inspecting trigger.labels and sending to different whatsAppIds.
  • Enrich the payload with the flow id, namespace, and a direct link to the execution UI.
  • Fan out to multiple channels by chaining Slack, Microsoft Teams, or PagerDuty tasks after the WhatsApp call.
  • Add io.kestra.plugin.core.condition.ExecutionLabels to alert only on production-tagged runs.
  • Throttle noisy flows by adding a concurrency limit on the notifier itself.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.