New to Kestra?
Use blueprints to kickstart your first workflows.
Trigger Kestra flows based on execution namespace using the ExecutionNamespace condition. Automate cross-namespace workflow dependencies at scale.
id: flow-condition-executionnamespace
namespace: company.team
triggers:
- id: flow
type: io.kestra.plugin.core.trigger.Flow
dependsOn:
- when: "{{ trigger.namespace startsWith 'company.engineering' }}"
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 }}"
Get a Slack notification every time any workflow under a chosen namespace fails, without wiring an alert into each flow individually. This blueprint listens for failed executions across a whole namespace prefix and pushes a clear message to your incident channel, so platform and data teams catch broken pipelines the moment they break. It pairs the Kestra Flow trigger with a dependsOn when expression to deliver centralized, namespace-wide failure monitoring.
io.kestra.plugin.core.trigger.Flow trigger subscribes to executions happening elsewhere in your Kestra instance.dependsOn when expression ({{ trigger.namespace startsWith 'company.engineering' }}) filters those executions to any namespace starting with company.engineering (for example company.engineering.etl or company.engineering.ml).dependsOn entry's states list is set to [FAILED], so this flow only runs when a matching execution fails.send_slack_message task (io.kestra.plugin.slack.notifications.SlackExecution) posts the alert, interpolating {{ trigger.executionId }}, {{ trigger.flowId }}, and {{ trigger.namespace }} into the payload so the message names the exact failing execution.FAILED, not on normal completions.A standalone scheduler can run jobs but cannot react to the outcome of other flows across namespaces. Kestra Flow triggers turn execution events into first-class triggers, so this alert fires the instant a failure happens, with no polling. The dependsOn when expression scopes monitoring declaratively in YAML, retries and execution history give you lineage on every alert, and the whole policy lives in one version-controlled flow rather than scattered across dozens of pipelines.
SLACK_WEBHOOK: the Slack incoming webhook URL used by the send_slack_message task.SLACK_WEBHOOK secret to your Kestra instance.when expression from company.engineering to the namespace prefix you want to monitor.WARNING to the trigger states list to widen coverage.when expression to an equality check ({{ trigger.namespace == 'company.engineering' }}) to monitor a single exact namespace.