Skip to content

Notifications ​

Notifications send run events, such as a failed run or a step waiting for approval, to Slack, Microsoft Teams, email, Telegram, a webhook, or a local command. You set them up once in the Web UI instead of in every DAG file. Open Notifications under Monitor.

For PagerDuty or SolarWinds Incident Response, which open and resolve incidents, use Incident Routing. To alert on several servers from one place, connect them to Dagu Cloud.

Notification rules with Global defaults selected: Platform Slack notified on Failed, Aborted, Rejected, and Waiting, and On-call email on FailedNotification rules with Global defaults selected: Platform Slack notified on Failed, Aborted, Rejected, and Waiting, and On-call email on Failed

How Routing Works ​

A channel is a destination, such as a Slack webhook or an email list. A rule sends chosen events to one channel. Rules exist at three levels, and the most specific level that is configured wins:

A configured level with no rules sends nothing. It does not fall back to a broader level.

Set It Up ​

  1. Open the Channels tab, select Add channel, pick a type, and fill in its destination.
  2. Select Test on the channel to send a sample notification.
  3. Open the Rules tab, keep Applies to on Global defaults, and select Add rule.
  4. Pick the channel under Send to, tick the events under Notify on, and select Save changes.

Adding a channel sends nothing until a rule uses it.

Channels tab listing Incident relay, On-call email, Ops Teams, and Platform Slack, with Email delivery not configuredChannels tab listing Incident relay, On-call email, Ops Teams, and Platform Slack, with Email delivery not configured

Events ​

EventSent when a run
FailedFails. With DAG-level auto retry left, only the last failed attempt notifies.
AbortedIs stopped
RejectedHas a step whose approval was rejected
WaitingWaits for a person: an approval or a human task
Partially succeededFinishes with some steps failed but allowed to fail
SucceededSucceeds

A new rule starts with Failed, Aborted, Rejected, and Waiting ticked.

With connections turned on, rules also offer Connection needs attention and Connection restored. See Badge and Notifications.

Channels ​

TypeDestinationNotes
SlackSlack webhook URLHTTPS only
Microsoft TeamsTeams webhook URL from a Teams Workflow or legacy connectorHTTPS only. Sent as a MessageCard.
EmailRecipients, with optional Cc, Bcc, and Attach logsNeeds Email Delivery
TelegramBot token, Chat ID, and optional Telegram topic IDThe topic ID targets a forum topic.
Generic WebhookWebhook endpoint URL, with optional headers and HMAC secretSee Webhook Payload
Local commandA shell command on the Dagu serverAdmins only. See Local Commands.

For Google Chat or another service without its own type, use Generic Webhook with a custom JSON body.

Dagu encrypts webhook URLs, tokens, HMAC secrets, and SMTP credentials at rest. After saving, the page shows only whether each is set, or a shortened preview. Editing a channel without retyping a secret keeps it.

A local command is not a secret. Anyone who can view channels can read it, so keep credentials out of it.

Microsoft Teams ​

  1. In Microsoft Teams, open Workflows and create one from an incoming-webhook template for a chat or channel. See Microsoft's guide.
  2. Copy the webhook URL it generates.
  3. Add a Microsoft Teams channel in Dagu, paste the URL, and select Test.

The default message ends with {{run.link}}, which needs public_url to hold a link.

Webhook Safety ​

A Generic Webhook URL must use HTTPS and must not point at a loopback or private address. Turn on Allow HTTP or Allow private network on the channel to send to an internal receiver.

Email Delivery ​

Email delivery at the bottom of the Channels tab sets the SMTP server and default sender that every email channel uses. Select Configure and choose the SMTP authentication:

AuthenticationEnter
PasswordSMTP host, Port, Username, Password, and Default sender
OAuth 2.0OAuth provider, Sender mailbox, the provider's credentials, and Default sender
Notification connectionExperimental, with connections on. SMTP host, port, username, and sender. A notification connection signs in and Dagu refreshes its token.
OAuth providerCredentials
Microsoft 365Microsoft tenant ID, Client ID, Client secret. Sends through smtp.office365.com:587.
Google Workspace service accountService-account JSON with domain-wide delegation. Sends through smtp.gmail.com:587.
Google refresh tokenClient ID, Client secret, Refresh token. Sends through smtp.gmail.com:587.

OAuth sends over STARTTLS with XOAUTH2, and Dagu fills in the host and port. Changing the provider, sender mailbox, tenant ID, or client ID drops the stored credentials, so enter them again. Switching to Password and saving removes the OAuth settings.

For personal Gmail, Password with a Google app password is the shortest path. See Choosing Gmail Authentication and SMTP Providers for provider setup.

Local Commands ​

A Local command channel runs a shell command on the Dagu server for each event, such as a desktop notifier or a script.

  • Only admins can create, edit, or test one. Developers and managers can add an existing one to rules.
  • The server must keep permissions.write_dags and permissions.run_dags on, as by default. Otherwise Dagu hides the type and fails deliveries.

The command runs with sh -c on Unix and PowerShell (pwsh, else powershell) on Windows. Template tokens are not replaced; run values arrive as environment variables:

VariableValue
DAG_NAME, DAG_RUN_ID, ATTEMPT_IDDAG name, run ID, attempt ID
STATUS, EVENT_TYPERun status and event type
ERRORSame as {{run.error}}
FAILED_STEPS, PARTIALLY_SUCCEEDED_STEPS, ABORTED_STEPS, SUCCEEDED_STEPSComma-separated steps with that status
RUN_PATH, RUN_URL, RUN_LINKRun path, and the absolute URL and Run: ... line when public_url is set
STARTED_AT, FINISHED_AT, OBSERVED_ATRun start, finish, and event times
WORKSPACE, WORKER_IDSet when present
EXECUTION_LOGTemporary file with up to 1 MiB of the run's logs, ending in # log truncated when cut
bash
notify-send "Dagu" "DAG $DAG_NAME finished with status: $STATUS"

Quote variables, as in "$ERROR", so a value never runs as a command. PowerShell reads them as $env:ERROR.

RuleBehavior
HostThe Dagu server or scheduler that delivers notifications, not a worker
EnvironmentThe same filtered environment as steps, without Dagu's own credentials. See Environment Variable Filtering.
ResultA non-zero exit fails the delivery and shows the start of stderr. Stdout is discarded.
Timeout30 seconds. Processes the command left behind are stopped too.
RetriesFailed deliveries retry. A command cut off by the timeout or a shutdown can run again, so make it safe to repeat.

Test runs the command once with a sample failed run of a DAG named channel-test.

Rules ​

Applies to on the Rules tab picks the level. A rule has one channel under Send to, the events under Notify on, and an Enabled switch. Changes apply after Save changes.

LevelWhereChoices
GlobalApplies to: Global defaultsUsed by every DAG without its own rules
WorkspaceApplies to: the workspaceUse Global rules (the default), or Configure workspace to replace them
DAGThe Notifications tab of a workflow's Workflow panelOverride off to inherit, or on with its own channels and events

Keep most DAGs inheriting. Override a DAG only when it needs a different destination or event set than its workspace.

Message Templates ​

Each channel except Local command has a message template, and email channels have a subject and body template. Tokens in {{...}} are replaced:

TokenValue
{{dag.name}}DAG name
{{run.id}}, {{run.attemptId}}Run ID, attempt ID
{{run.status}}Run status
{{run.error}}Run error, or each failed step's error as step: message, one per line
{{run.failed_steps}}, {{run.partially_succeeded_steps}}, {{run.aborted_steps}}, {{run.succeeded_steps}}Comma-separated steps with that status, or empty
{{run.path}}Relative Web UI path of the run
{{run.url}}, {{run.link}}Absolute run URL, and a Run: ... line, when public_url is set
{{run.startedAt}}, {{run.finishedAt}}Run start and finish times
{{workspace}}, {{worker.id}}Workspace and worker, when present
{{event.type}}, {{event.observedAt}}Event type and time

The camelCase forms {{dagName}}, {{dagRunId}}, {{status}}, {{error}}, {{runPath}}, {{runUrl}}, {{runLink}}, {{attemptId}}, and {{eventType}} also work. A fan-out step appears once per item, such as process[customer-a].

text
DAG {{dag.name}} {{run.status}}
Error: {{run.error}}
Failed steps: {{run.failed_steps}}
{{run.link}}

Email bodies and Slack messages escape token values, so <, >, and & in an error show as written. Markup in the template itself is kept.

Set public_url to the Web UI address recipients open, including any reverse-proxy subpath:

yaml
public_url: "https://dagu.example.com"

The environment variable is DAGU_PUBLIC_URL, and the Helm value is config.publicUrl. Without it, {{run.url}} and {{run.link}} are empty, and {{run.path}} still works.

Generic Webhook Payload ​

With Webhook JSON body template blank, a webhook channel POSTs a batch of events, with the rendered message template in message.

Default payload
json
{
  "version": "v1",
  "message": "DAG daily-report failed: exit status 1\nRun: https://dagu.example.com/dag-runs/daily-report/019e3...",
  "events": [
    {
      "eventType": "dag.run.failed",
      "dagName": "daily-report",
      "dagRunId": "019e3...",
      "runPath": "/dag-runs/daily-report/019e3...",
      "runUrl": "https://dagu.example.com/dag-runs/daily-report/019e3...",
      "status": "failed",
      "error": "exit status 1",
      "observedAt": "2026-05-17T10:00:00Z"
    }
  ]
}

With HMAC secret set, X-Dagu-Signature signs the exact request body.

Custom JSON Body ​

Set Webhook JSON body template when the receiver expects another shape. Many chat webhooks take a single text field:

json
{
  "text": "{{message}}"
}

The template takes every message token, plus {{message}} for the rendered message. Values are escaped as JSON string content, so keep string tokens inside quotes.

  • Dagu sends one request per event, and a transient failure retries only that request.
  • Every body in a batch must render as valid JSON before the first is sent. Invalid JSON fails the delivery without retrying.
  • Headers and HMAC signing still apply.

Backfill Summaries ​

A backfill that ends succeeded or failed sends one summary instead of one notification per run. It goes to the channels a run of that DAG with the same outcome would notify, except local commands.

Webhook payload of a backfill summary
json
{
  "type": "backfill.ended",
  "backfill": {
    "id": "3f9a1c2e",
    "dag": "daily-report",
    "succeeded": false,
    "slots": 28,
    "succeededSlots": 25,
    "failedSlots": 3,
    "skippedSlots": 0,
    "notRunSlots": 0,
    "durationSeconds": 6000,
    "failures": [
      {"step": "load", "error": "connection refused", "slots": 2, "slot": "2026-10-02T02:00:00Z", "runId": "backfill-3f9a1c2e-0-20261002T020000Z"}
    ]
  },
  "message": "Backfill 3f9a1c2e of daily-report failed: 28 slots, 25 succeeded, 3 failed, in 1h40m\n..."
}

Delivery ​

The Dagu server sends notifications from the run events it records, not from a workflow step. Runs on distributed workers notify the same way. The server remembers what it delivered, so a restart does not resend old events. Failed deliveries retry with backoff.

Permissions ​

Managing channels and rules needs the developer role or higher. Local command channels need admin to create, edit, or test.

Dagu is open source under the GNU General Public License v3.0.