PagerDuty AI Incident Triage with Azure OpenAI
When a PagerDuty incident triggers, the flow sends the alert payload to Azure OpenAI to produce a plain-language summary, likely cause, suggested runbook steps, and a severity recommendation, then posts it as an incident note and to Teams. Helps responders orient fast and reduces time-to-mitigate for noisy or cryptic alerts.
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 gives on-call responders an AI head start on every PagerDuty incident. A polling trigger fans out newly created incidents one at a time; the flow re-fetches the full incident payload, sends it (plus configurable runbook context) to an Azure OpenAI chat-completions deployment in JSON mode, and gets back a structured triage: a plain-language summary, likely cause, suggested runbook steps, and a recommended severity. The triage is posted back onto the incident as a note and surfaced to a Microsoft Teams channel with a link to the incident.
Why it matters: Cryptic or noisy alerts cost minutes of orientation at the worst possible time. An AI triage note helps responders understand and act faster, reducing time-to-mitigate - while the human still owns the decision. The flow ships Off (demo); going live requires only connection authorization and environment-variable configuration.
Use Case
An on-call team wants each incident to arrive pre-triaged - with an AI summary, probable cause, and runbook pointers attached - so responders skip the what-is-this-even-saying phase and move straight to mitigation. The recommended severity is advisory and helps prioritize, but the responder makes the call.
Flow Architecture
When a New PagerDuty Incident Is Created
PagerDuty OnNewIncidentCreatedPolls every 3 min; splitOn fans out the returned incidents so one incident is processed per run.
Initialize variables (x8)
Initialize VariableBind env vars (deployment, api-version, runbook context, Teams group/channel, PagerDuty From user) plus tuning (temperature 0.2, max tokens 800).
Get Incident Details
PagerDuty GetIncidentByIdRe-fetches the authoritative full incident payload by ID (service, urgency, status, timestamps, URL).
Compose Incident Context
ComposeBuilds the single-line incident-context block sent to the model.
Call Azure OpenAI
Azure OpenAI ChatCompletions_Create_2024Feb15PreviewJSON mode; returns structured triage JSON at low temperature.
Parse Triage
Parse JSONDecodes summary / likelyCause / runbookSteps / recommendedSeverity.
Compose Note Body
ComposeFormats the triage into a plain-text incident note.
Add AI Triage Note
PagerDuty AddNoteToIncidentPosts the triage as a note onto the originating incident (requires the From user).
Post Triage To Teams
Teams PostMessageToConversationSurfaces the triage to the responder channel with a link back to the incident.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_AOAIDeploymentName | String | gpt-4o-mini | Azure OpenAI deployment name (reused). |
| flowlibs_AOAIApiVersion | String | 2024-02-15-preview | Azure OpenAI REST api-version (reused). |
| flowlibs_RunbookContext | String | (configure) | Runbook snippets/links used to ground the AI triage. |
| flowlibs_TeamsGroupId | String | <your-team-id> | Responder Teams group/team ID (reused). |
| flowlibs_TeamsChannelId | String | <your-channel-id> | Responder Teams channel ID (reused). |
| flowlibs_PagerDutyFromUserId | String | REPLACE_WITH_PAGERDUTY_USER_ID | PagerDuty user ID used as the note author (From). |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| PagerDuty | shared_pagerduty | OnNewIncidentCreated GetIncidentById AddNoteToIncident |
| Azure OpenAI | shared_azureopenai | ChatCompletions_Create_2024Feb15Preview |
| 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.
- Similar-incident grounding
- Retrieve past similar incidents (e.g. Azure AI Search) and append to the context so the model's cause suggestions are grounded in your history.
- Auto-severity with a confidence gate
- When recommendedSeverity meets a confidence threshold, automatically set the incident priority (via PagerDuty REST) instead of only suggesting.
- Concrete runbook links
- Return real runbook URLs from your KB in runbookSteps.
- Trigger on assignment instead of creation
- Swap OnNewIncidentCreated for OnIncidentAssigned to triage only what lands on a specific responder.
- Tune the model
- Adjust varTemperature / varMaxTokens, or point flowlibs_AOAIDeploymentName at a stronger deployment for richer triage.
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.01Incident id (after splitOn)
The id of the single fanned-out incident.
EXPR.02Full incident payload
Authoritative incident object (service, urgency, html_url, ...).
EXPR.03Model output
Raw model content fed to Parse JSON.
EXPR.04Note author (required)
request/userId for the AddNoteToIncident write.
EXPR.05Runbook steps render
Flatten the suggested runbook steps into the note.
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.