PagerDuty On-Call Handoff SMS Reminder
At each on-call shift change, the flow texts the incoming on-call engineer via Twilio with a summary of open incidents and anything in progress, and posts the same handoff summary to a Teams channel. Confirms the new on-call has acknowledged. Smooths shift transitions so context isn't lost between responders.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This flow smooths PagerDuty on-call handoffs. It runs on a schedule aligned to each shift boundary, reads the current on-call roster from PagerDuty, summarizes the open incidents, texts the incoming on-call engineer via Twilio, and posts the same handoff summary to a Microsoft Teams channel. The SMS asks the engineer to reply ACK to confirm they have the handoff.
Why it matters: Context is easily lost at shift boundaries. A proactive handoff carrying open-incident context - delivered by SMS, which on-call staff actually read - reduces dropped balls between responders. Flow ships Off; going live requires only authorizing the three connections and setting the environment-variable values.
Use Case
An on-call rotation wants the incoming engineer to begin their shift with a clear picture of what is open and in flight, pushed to their phone and to the team channel, with an explicit acknowledgement step. Audience: IT Admins, Operations. Skill level: Intermediate.
Flow Architecture
Shift Change Schedule
Recurrence (Day / 08:00)Fires at the shift boundary. Adjust the time, or add a second run, to match each rotation's handoff.
Initialize variables (x9)
Initialize VariableLoads config from env vars (API base, token, schedule IDs, Twilio sender, Teams group/channel, fallback SMS) and seeds accumulator strings for the incident lists.
Compose OnCall Query URI
ComposeBuilds the PagerDuty /oncalls query for the configured schedule IDs (current primary on-call).
Get Incoming OnCall
HTTP GET (PagerDuty REST)Reads the current on-call roster (Token header auth - no connector op exists).
Compose incoming engineer details
ComposeSafely extracts the incoming engineer's user id, display name, and the rotation name (guards an empty roster).
Get OnCall ContactMethods
HTTP GET (PagerDuty REST)Fetches the engineer's contact methods to find their SMS/phone number; filters to SMS/phone entries.
Compose To Number
ComposeResolves the E.164 recipient: the on-call's PagerDuty phone, or the configured fallback number.
Get Open Incidents
PagerDuty GetActiveIncidentsLists currently open (triggered/acknowledged) incidents - connector action.
Foreach Incident + Compose Sms Body
Apply to each + ComposeBuilds an ordered plain-text list (for SMS) and an HTML list (for Teams), then assembles the SMS with rotation, incoming engineer, open count, incident lines, and Reply ACK to confirm.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_PagerDutyApiBase | String | https://api.pagerduty.com | PagerDuty REST API base URL. |
| flowlibs_PagerDutyApiToken | String | REPLACE_WITH_PAGERDUTY_API_TOKEN | PagerDuty REST API token (read on schedules + incidents) used in the Authorization: Token token= header. |
| flowlibs_PagerDutyScheduleIds | String | PSCHED01,PSCHED02 | Comma-separated PagerDuty schedule IDs whose on-call is handing off. |
| flowlibs_TwilioFromNumber | String | +15551234567 | Verified Twilio sender number (E.164). |
| flowlibs_TeamsGroupId | String | <your-team-id> | Teams Team (group) ID of the on-call channel. |
| flowlibs_TeamsChannelId | String | <your-channel-id> | Teams channel ID of the on-call channel. |
| flowlibs_OnCallSmsFallbackNumber | String | +15551234567 | Fallback SMS recipient when the engineer has no PagerDuty phone/SMS contact method. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| PagerDuty | shared_pagerduty | GetActiveIncidents |
| Twilio | shared_twilio | SendMessage |
| Microsoft Teams | shared_teams | PostMessageToConversation |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Two-way ACK (production upgrade)
- Add a second flow triggered by a Twilio inbound webhook (built-in Request trigger reading triggerFormDataValue From/Body) that records the acknowledgement and, if no ACK arrives within a threshold, escalates to the secondary on-call.
- Time-zone aware handoffs
- Duplicate the run, or change timeZone/hours, so each rotation fires at its own local shift-change time.
- Escalation note
- Extend Compose_Sms_Body / Compose_Teams_Html with the secondary on-call (a second /oncalls read at escalation_level=2) so the incoming engineer knows who to escalate to.
- Multi-schedule fan-out
- Wrap actions 10-26 in an Apply-to-each over the schedule IDs to notify each schedule's incoming engineer separately.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01On-call query URI
Builds the /oncalls request for the configured schedules.
EXPR.02Incoming on-call user id
Safely extract the incoming engineer id.
EXPR.03SMS recipient (with fallback)
PagerDuty phone, else the fallback number.
EXPR.04Open incident count
Count of currently open incidents.
EXPR.05PagerDuty REST auth header
With Accept: application/vnd.pagerduty+json;version=2.
Customize & download
Generate a ready-to-import copy of this solution with your environment-variable values baked in — available on Base, Pro, or Team.
Upgrade to customize
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.