New to Kestra?
Use blueprints to kickstart your first workflows.
Kestra Flow trigger that watches a namespace tree for FAILED or WARNING executions, logs enriched failure context from the KV store, and alerts Slack.
Give each team its own failure alerting channel instead of one global firehose. This Kestra blueprint uses a Flow trigger scoped to a namespace prefix, so every execution that ends in FAILED or WARNING anywhere under that namespace tree fires exactly one alerting run. The alert logs the failing flow, state, execution id, and outputs, enriches the message with a custom label read from the KV store, and posts a compact notification to Slack. Because the alerting logic lives in a separate flow, the monitored pipelines need zero changes.
listen trigger (io.kestra.plugin.core.trigger.Flow) subscribes to execution state changes across the instance.io.kestra.plugin.core.condition.ExecutionStatus condition narrows it to executions ending in FAILED or WARNING, catching both hard failures and soft warnings.io.kestra.plugin.core.condition.ExecutionNamespace condition with prefix: true scopes the trigger to the company namespace tree, so other teams' failures never page this channel.log_failure task (io.kestra.plugin.core.log.Log) records the triggering flow id, state, execution id, and outputs. It also reads {{ kv(trigger.flowId ~ '-custom-label') }} from the KV store, letting monitored flows publish extra routing context, such as a business domain or report name, that shows up in the alert.send task (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) posts a one line summary with the flow id, final state, and execution id to your Slack channel.FAILED and WARNING terminal states with a single trigger.?? operator, so missing context never breaks the alert itself.Failure alerting bolted into each pipeline drifts, gets copy pasted, and silently disappears when someone forks a flow. Kestra's Flow trigger inverts the dependency: this one flow observes the whole namespace tree from the outside, and conditions declaratively define what counts as alert worthy. The KV store bridges context between producers and the alerting flow without coupling them, and the alert run itself is a normal execution with logs and history you can audit.
namespace: company to your tree).<flowId>-custom-label for enriched alerts.SLACK_WEBHOOK: incoming webhook URL used by SlackIncomingWebhook to post the alert.SLACK_WEBHOOK secret to your Kestra namespace.ExecutionNamespace condition to the namespace prefix you want to monitor.io.kestra.plugin.core.condition.ExecutionFlow condition to watch one specific critical flow.io.kestra.plugin.slack.notifications.SlackExecution for a richer formatted message with a direct execution link.send.ExecutionLabels condition to alert only on executions tagged as production critical.