Teams Graph Presence-Aware Alert Routing Prompt
Use Microsoft Graph presence to route alerts to whoever is actually available, falling back through an escalation list instead of paging someone who is offline or in a meeting.
- Target user
- SRE and on-call tooling engineers building smarter alert routing into Teams
- Difficulty
- Intermediate
- Tools
- Claude, Gemini
The prompt
You are a senior on-call tooling engineer who routes alerts by real availability so the right person gets paged the first time. I will provide: - My alert source and the escalation order (primary, secondary, manager) - The Graph permissions I hold (Presence.Read.All, application context) and how I message users (proactive bot, chat) - The page acknowledgment mechanism Your job: 1. **Read presence** — call the Graph `/communications/getPresences` batch endpoint for the escalation list; interpret `availability` and `activity` (Available, Busy, InAMeeting, Offline, DoNotDisturb). 2. **Define routing policy** — decide who gets the page given presence: prefer Available, skip Offline, respect DoNotDisturb only for non-critical severities, and never silently drop a critical page. 3. **Cascade with timeout** — page the chosen person, wait for an Adaptive Card `Action.Execute` ack within a window, then escalate to the next person if unacked. 4. **Avoid presence staleness** — cache presence briefly but re-check before escalating; treat unknown presence as "page anyway" for critical alerts. 5. **Notify and acknowledge** — send a proactive Adaptive Card with Acknowledge/Escalate actions and record who acked. 6. **Audit the chain** — log each routing decision and the presence snapshot that drove it. Output as: (a) the presence-fetch + policy code, (b) the page Adaptive Card, (c) the escalation state machine. Never let presence suppress a critical page, treat presence as advisory, and respect that DoNotDisturb may mean focus time, not unavailability.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Teams Graph Usage Report Adoption Digest Prompt
Use the Microsoft Graph reports API to build a Teams adoption / usage digest — active users, message and meeting activity, app usage — and post it back into Teams as an Adaptive Card for platform owners.
-
Graph $batch Dependent Requests and Ordering Prompt
Design a Microsoft Graph $batch payload that chains dependent requests (create team, then add members, then post welcome) using the dependsOn ordering, with per-request error handling and a 20-request chunking strategy.
-
Graph Change Notifications with Rich Resource Data Batching Prompt
Design a Graph change-notification receiver that batches encrypted resource-data payloads, validates the dataSignature, and decrypts in bulk so a high-volume Teams message subscription does not melt your endpoint.
-
Microsoft Graph Paging & Throttling for Teams Data Export Prompt
Write a resilient Microsoft Graph client that pages through large Teams datasets (messages, members, channels) while respecting 429 throttling, @odata.nextLink, and delta queries.
More Microsoft Teams prompts & error guides
Browse every Microsoft Teams prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.