PagerDuty Post-Incident Review Generator
When a PagerDuty incident is resolved, the flow compiles the timeline (triggered, acknowledged, escalated, resolved, responders, log entries) into a branded post-incident review document, files it to a SharePoint library, schedules a review meeting, and posts the draft to the team in Teams. Turns every resolved incident into a ready-to-edit postmortem.
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 turns every resolved PagerDuty incident into a ready-to-edit postmortem. When an incident transitions to resolved, the flow pulls the full incident record and its responder notes, computes the timeline and reliability metrics (time-to-acknowledge / time-to-resolve), populates a branded Word post-incident-review (PIR) template, files the document into a SharePoint library, schedules a review meeting on the team calendar (Outlook), and posts a draft summary to the team in Teams - all stamped with a single correlation id.
Why it matters: PIRs are high value but tedious to start. Auto-generating a populated draft with the real timeline removes the blank-page friction and makes blameless reviews routine. Built as a demo - ships Off. Going live requires only connection authorization plus environment-variable configuration (no logic changes).
Use Case
An SRE / IT-Operations team runs post-incident reviews and wants a pre-filled PIR document, an archived copy, a scheduled review meeting, and a team notification created automatically the moment a PagerDuty incident resolves. Primary audience: IT Admins, Operations. Skill level: Advanced. Category: Document Management.
Flow Architecture
When a PagerDuty Incident Is Resolved
PagerDuty OnIncidentResolvedPolling trigger (recurrence every 5 min, splitOn body/incidents). Fires once per resolved incident.
Initialize Correlation Id / Company / Incident Id
Initialize VariableTrace id linking the document, file, invite and Teams post; brand name; resolved incident id from the trigger.
Get Incident Details + Notes
PagerDuty GetIncidentById + GetIncidentNotesFull incident record (service, urgency, timestamps, acknowledgements) plus responder notes / log entries.
Compose timeline + metrics
ComposeNormalises the incident, computes triggered/acknowledged/resolved anchors and MTTA/MTTR minutes.
Compose responders + notes
Select + ComposeFlattens acknowledger names into a responders list and incident notes into a pipe-separated log, plus a one-line timeline summary.
Compose Template Field Data
ComposeAssembles every content-control value as one object (dynamic-schema mitigation).
Populate Review Document
Word Online CreateFileItemPopulates the branded PIR Word template into a draft .docx.
Save Review To SharePoint
SharePoint CreateFileFiles the draft into the PIR library and composes an absolute document link.
Schedule Review Meeting
Outlook V4CalendarPostItemBooks the review meeting (lead days @ 16:00 plus duration) with reviewers as required attendees.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_PIRTemplateDrive | String | <configure> | Document-library / drive id holding the PIR Word template. |
| flowlibs_PIRTemplateFileId | String | <configure> | File id of the branded PIR template (with content controls). |
| flowlibs_PIRLibraryFolderPath | String | /Post-Incident Reviews | Server-relative SharePoint folder where reviews are filed. |
| flowlibs_PIRReviewCalendarId | String | Calendar | Calendar used to schedule the review meeting. |
| flowlibs_PIRReviewerEmails | String | alerts@yourcompany.com | Semicolon-separated required attendees. |
| flowlibs_PIRReviewLeadDays | String | 2 | Days after resolution to schedule the review. |
| flowlibs_PIRMeetingTimeZone | String | Eastern Standard Time | Time zone for the meeting (Windows tz name). |
| flowlibs_PIRMeetingDurationMinutes | String | 30 | Meeting length in minutes. |
| flowlibs_PIRCompanyName | String | yourcompany | Brand name on the document and Teams post. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| PagerDuty | shared_pagerduty | OnIncidentResolved GetIncidentById GetIncidentNotes |
| Word Online (Business) | shared_wordonlinebusiness | CreateFileItem |
| SharePoint | shared_sharepointonline | CreateFile |
| Office 365 Outlook | shared_office365 |
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.
- AI-drafted analysis
- Add Azure OpenAI to draft a summary and contributing-factors section from the notes/timeline before populating the template.
- Severity gate
- Add a Condition after Compose Incident to only generate PIRs for high-urgency incidents and skip the rest.
- Action items
- Create follow-up tasks in Planner or Azure DevOps from the review and link them back into the document.
- Real Teams meeting
- Swap the Outlook calendar event for Teams CreateTeamsMeeting (or set item/isOnlineMeeting) to attach a join link.
- Distribution
- Add the reviewers / stakeholders as Outlook email recipients with the document attached.
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.01Normalised incident
Detail record, falls back to the trigger body.
EXPR.02Time-to-acknowledge (min)
MTTA in minutes, or N/A when never acknowledged.
EXPR.03Time-to-resolve (min)
MTTR in minutes.
EXPR.04Responders (flattened)
Flattens acknowledger names into a readable list.
EXPR.05Meeting start (lead days @ 16:00)
Review-meeting start time.
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.