Blueprints

Set up alerts for failed workflow executions using Discord

About this blueprint

Notifications System

This system flow will help you set up alerts for failed workflow executions. Using this pattern, you can manage alerts on failure in one place.

Here, we send a message to a Discord channel when any workflow execution fails.

You can further customize that system flow by modifying the DiscordExecution task, or by adding more tasks to the flow.

Additionally, you can restrict the flow to only send alerts for specific namespaces by adding an ExecutionNamespaceCondition to the trigger. You can read more about that in the Administrator Guide.

yaml
id: failure_alert_discord
namespace: system

tasks:
  - id: send_alert
    type: io.kestra.plugin.notifications.discord.DiscordExecution
    url: "{{ secret('DISCORD_WEBHOOK') }}"
    executionId: "{{ trigger.executionId }}"

triggers:
  - id: on_failure
    type: io.kestra.plugin.core.trigger.Flow
    conditions:
      - type: io.kestra.plugin.core.condition.ExecutionStatusCondition
        in:
          - FAILED
          - WARNING

Discord Execution

Flow

Execution Status Condition

More Related Blueprints

New to Kestra?

Use blueprints to kickstart your first workflows.

Get started with Kestra