New to Kestra?
Use blueprints to kickstart your first workflows.
Compiles PagerDuty on-call shift incident digests and escalation metrics via REST API, delivering structured transition summaries to Slack channels.
This blueprint automates Site Reliability Engineering (SRE) on-call shift transitions by integrating PagerDuty with Slack. Scheduled daily at shift handover intervals (09:00 UTC), it queries the PagerDuty REST API v2 to compile unresolved incidents, escalation statuses, and urgency levels, broadcasting a concise transition brief to engineering channels before incoming on-call engineers assume primary responsibilities.
daily_shift_handover_schedule trigger (io.kestra.plugin.core.trigger.Schedule) executes at 09:00 UTC daily to align with shift rotations.fetch_pagerduty_shift_metrics task (io.kestra.plugin.scripts.python.Script) interrogates PagerDuty /incidents, parsing active triggered and acknowledged items for the target technical service.check_unresolved_incidents flowable task (io.kestra.plugin.core.flow.If) evaluates whether any open incidents require acknowledgment during the transition.notify_slack_shift_handover (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) delivers an incident briefing card to the on-call channel.log_clean_shift_transition records an all-clear message.export_shift_manifest task tags the execution with searchable status labels.flowchart TD
A[Schedule: Daily at 09:00 UTC] --> B[fetch_pagerduty_shift_metrics: Query PagerDuty REST API]
B --> C{Active Incidents Exist?}
C -- Yes --> D[notify_slack_shift_handover: Slack Webhook]
C -- No --> E[log_clean_shift_transition: Log All Clear]
D --> F[export_shift_manifest: Execution Labels]
E --> F
| Name | Type | Default | Description |
|---|---|---|---|
pagerduty_service_id |
STRING | P123ABC |
Target PagerDuty technical service identifier for incident digest compilation. |
slack_channel |
STRING | #oncall-shift-handover |
Slack channel destination for on-call transition and incident digest cards. |
alert_on_unresolved_incidents |
BOOL | true |
Whether to emphasize active triggered incidents requiring immediate shift transition handover. |
{{ outputs.fetch_pagerduty_shift_metrics.vars.unresolved_incident_count }}: Count of active triggered and acknowledged incidents.{{ outputs.fetch_pagerduty_shift_metrics.vars.high_urgency_incident_count }}: Number of unresolved incidents marked as high urgency.{{ outputs.fetch_pagerduty_shift_metrics.vars.has_unresolved_incidents }}: Boolean flag indicating if any open incidents exist.{{ outputs.fetch_pagerduty_shift_metrics.outputFiles['pagerduty_handover_report.json'] }}: Structured JSON report detailing incident titles and urgency levels.PAGERDUTY_API_TOKEN: PagerDuty REST API v2 authentication token.SLACK_WEBHOOK_URL: Slack Incoming Webhook endpoint URL.PAGERDUTY_API_TOKEN and SLACK_WEBHOOK_URL in your Kestra namespace secrets.pagerduty_service_id.PABC123) and can be retrieved from the URL of the service page in the PagerDuty web application./oncalls to dynamically mention the incoming engineer's Slack user ID (<@U12345>) in the notification payload.