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.
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
- Open the Channels tab, select Add channel, pick a type, and fill in its destination.
- Select Test on the channel to send a sample notification.
- Open the Rules tab, keep Applies to on Global defaults, and select Add rule.
- 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.
Events
| Event | Sent when a run |
|---|---|
| Failed | Fails. With DAG-level auto retry left, only the last failed attempt notifies. |
| Aborted | Is stopped |
| Rejected | Has a step whose approval was rejected |
| Waiting | Waits for a person: an approval or a human task |
| Partially succeeded | Finishes with some steps failed but allowed to fail |
| Succeeded | Succeeds |
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
| Type | Destination | Notes |
|---|---|---|
| Slack | Slack webhook URL | HTTPS only |
| Microsoft Teams | Teams webhook URL from a Teams Workflow or legacy connector | HTTPS only. Sent as a MessageCard. |
| Recipients, with optional Cc, Bcc, and Attach logs | Needs Email Delivery | |
| Telegram | Bot token, Chat ID, and optional Telegram topic ID | The topic ID targets a forum topic. |
| Generic Webhook | Webhook endpoint URL, with optional headers and HMAC secret | See Webhook Payload |
| Local command | A shell command on the Dagu server | Admins 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
- In Microsoft Teams, open Workflows and create one from an incoming-webhook template for a chat or channel. See Microsoft's guide.
- Copy the webhook URL it generates.
- 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:
| Authentication | Enter |
|---|---|
| Password | SMTP host, Port, Username, Password, and Default sender |
| OAuth 2.0 | OAuth provider, Sender mailbox, the provider's credentials, and Default sender |
| Notification connection | Experimental, with connections on. SMTP host, port, username, and sender. A notification connection signs in and Dagu refreshes its token. |
| OAuth provider | Credentials |
|---|---|
| Microsoft 365 | Microsoft tenant ID, Client ID, Client secret. Sends through smtp.office365.com:587. |
| Google Workspace service account | Service-account JSON with domain-wide delegation. Sends through smtp.gmail.com:587. |
| Google refresh token | Client 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_dagsandpermissions.run_dagson, 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:
| Variable | Value |
|---|---|
DAG_NAME, DAG_RUN_ID, ATTEMPT_ID | DAG name, run ID, attempt ID |
STATUS, EVENT_TYPE | Run status and event type |
ERROR | Same as {{run.error}} |
FAILED_STEPS, PARTIALLY_SUCCEEDED_STEPS, ABORTED_STEPS, SUCCEEDED_STEPS | Comma-separated steps with that status |
RUN_PATH, RUN_URL, RUN_LINK | Run path, and the absolute URL and Run: ... line when public_url is set |
STARTED_AT, FINISHED_AT, OBSERVED_AT | Run start, finish, and event times |
WORKSPACE, WORKER_ID | Set when present |
EXECUTION_LOG | Temporary file with up to 1 MiB of the run's logs, ending in # log truncated when cut |
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.
| Rule | Behavior |
|---|---|
| Host | The Dagu server or scheduler that delivers notifications, not a worker |
| Environment | The same filtered environment as steps, without Dagu's own credentials. See Environment Variable Filtering. |
| Result | A non-zero exit fails the delivery and shows the start of stderr. Stdout is discarded. |
| Timeout | 30 seconds. Processes the command left behind are stopped too. |
| Retries | Failed 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.
| Level | Where | Choices |
|---|---|---|
| Global | Applies to: Global defaults | Used by every DAG without its own rules |
| Workspace | Applies to: the workspace | Use Global rules (the default), or Configure workspace to replace them |
| DAG | The Notifications tab of a workflow's Workflow panel | Override 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:
| Token | Value |
|---|---|
{{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].
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.
DAG Run Links
Set public_url to the Web UI address recipients open, including any reverse-proxy subpath:
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
{
"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:
{
"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
{
"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.





