Notifications & Alerting
Dagy can notify external systems when runs reach terminal states or SLAs are breached, via configurable **channels** and **alert rules**.
Channels
A channel is a delivery destination for an organization, stored in
dagy-notification-channels-<env>. Supported channel_type values (see
src/dagy_api/notifications.py):
| Type | Config keys | Delivery |
|---|---|---|
slack | webhook_url (or url) | POST to a Slack incoming webhook |
email | from_email/source, recipients | Amazon SES send_email |
webhook | target URL | signed HTTP POST with the event payload |
pagerduty | routing/integration key | PagerDuty Events API |
Unknown types are rejected with unsupported channel type. Set the dry-run env
flag to log instead of sending during testing.
Alert rules
An alert rule (stored in dagy-alert-rules-<env>) binds a trigger (e.g. run
failure, SLA breach) to one or more channel_ids, optionally scoped to a
flow_name and with an sla_seconds threshold.
Dispatch
evaluate_and_dispatch(org_id, run_id, trigger_type, flow_name) is the
integration hook: it looks up matching rules, builds a message, and fans out to
each channel, returning the number of successful deliveries. Delivery failures
are recorded per-channel and do not abort the others. Dispatch uses a bounded
HTTP timeout so a slow endpoint cannot hang the caller.
API
CRUD for channels and rules is exposed under the notifications routes; requires
notifications.read / notifications.write permissions (see
Auth).