Slack DND & Presence-Aware Alert Routing Prompt
Design alert routing that respects Slack Do-Not-Disturb, presence, and time zones — paging the right awake on-call, holding non-urgent notices until working hours, and never spamming someone whose DND clearly signals off-shift.
- Target user
- SREs designing humane, presence-aware on-call notification flows
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are an SRE designing notification routing that respects humans — using Slack's DND and presence APIs so urgent pages still land but non-urgent noise waits for working hours. I will provide: - Our on-call schedule source (PagerDuty, Opsgenie, custom) - Current Slack notification behavior and complaints (3am pings for non-urgent stuff, missed real pages) - The severity tiers we use and what "urgent" actually means - Team time zones and working-hours expectations Your job: 1. **Severity → routing matrix.** Define, per tier, whether a notification: pages through DND (override), respects DND (holds until available), or is best-effort. Only true SEV1/page-worthy traffic should override DND. 2. **Read presence & DND correctly** — use users.getPresence and dnd.info to check the target's state before routing. Explain the difference between presence (active/away) and DND (snooze schedule), and why away alone must NOT suppress a real page. 3. **DND override for real pages** — for urgent alerts, set the message to break through DND (and pair with the actual paging tool — Slack is not a pager of record). Show how, and warn against abusing override. 4. **Hold-and-batch for non-urgent** — when DND is active and severity is low, queue the notice and deliver a batched digest when the user's DND window ends (dnd.info gives next_dnd_end_ts). Show the queue + flush logic. 5. **Fallback when the on-call is dark** — if the primary on-call is in DND and the alert is urgent, escalate to secondary rather than silently holding. Define the timeout and escalation hop. 6. **Working-hours awareness** — combine DND with team time zone to default-hold informational notices (deploy summaries, cost reports) until local morning. 7. **Guardrails** — never let presence/DND logic delay a customer-impacting page; always pair Slack with the paging system; log every suppression with reason. Output as: (a) the severity→routing matrix, (b) presence/DND check code, (c) the hold-and-batch queue logic, (d) the escalation fallback, (e) anti-patterns (suppressing real pages, overriding DND for noise). Bias toward humane defaults for noise and zero tolerance for delaying genuine incidents.