New to Kestra?
Use blueprints to kickstart your first workflows.
Send automatic email alerts on failed or warning Kestra executions with a single system flow, centralizing failure notifications across every namespace.
id: failure-alert-email
namespace: system
triggers:
- id: on_failure
type: io.kestra.plugin.core.trigger.Flow
dependsOn:
- states:
- FAILED
- WARNING
tasks:
- id: notify
type: io.kestra.plugin.email.MailSend
from: alerts@example.com
to: team@company.com
username: username@example.com
password: "{{ secret('EMAIL_PASSWORD') }}"
host: smtp.com
port: 465
subject: Failed Execution - {{ trigger.executionId }}
htmlTextContent: "{{ trigger.executionId }}"
Stop discovering broken pipelines hours after they fail. This system flow sends an email alert the moment any workflow execution in your Kestra instance finishes with a FAILED or WARNING status, giving on-call engineers and data teams a single, centralized place to manage failure notifications instead of wiring per-flow alerting into every pipeline.
io.kestra.plugin.core.trigger.Flow trigger listens across the instance for completed executions.dependsOn entry with states: [FAILED, WARNING] filters those executions, matching only those two statuses.notify task (io.kestra.plugin.email.MailSend) sends an SMTP email. The subject and htmlTextContent are templated with {{ trigger.executionId }} so the alert identifies the failed execution.system namespace, the flow reacts to executions in other namespaces without any changes to those flows.Most tools alert only on their own jobs. Kestra's event-driven Flow trigger reacts to the outcome of any execution across the whole instance, so one declarative YAML flow covers your entire platform. You get retries, full execution lineage, and a single source of truth for failure handling that no individual task scheduler or cron job can provide.
EMAIL_PASSWORD: the SMTP account password used by the notify task to authenticate.EMAIL_PASSWORD secret to your Kestra instance.from, to, username, host, and port values in the notify task to match your SMTP provider.system namespace and enable the trigger.when expression checking trigger.namespace to the dependsOn entry.