New to Kestra?
Use blueprints to kickstart your first workflows.
Automatically trigger PagerDuty incidents when Kestra workflows fail or warn. A system-level on-call alerting blueprint for SRE and platform reliability.
id: create-pagerduty-alert-on-failure
namespace: company.team
tasks:
- id: create_pagerduty_alert
type: io.kestra.plugin.pagerduty.PagerDutyExecution
url: "{{ secret('PAGERDUTY_EVENT') }}"
payloadSummary: "Kestra Workflow Failure: {{ trigger.executionId }} has failed
on {{ taskrun.startDate }}"
deduplicationKey: dedupkey
routingKey: routingkey
eventAction: trigger
executionId: "{{ trigger.executionId }}"
triggers:
- id: on_failure
type: io.kestra.plugin.core.trigger.Flow
conditions:
- type: io.kestra.plugin.core.condition.ExecutionStatus
in:
- FAILED
- WARNING
- type: io.kestra.plugin.core.condition.ExecutionNamespace
namespace: company
comparison: PREFIX
Failed pipelines that nobody notices turn into data downtime, broken SLAs, and angry stakeholders. This system blueprint wires Kestra straight into PagerDuty so that any workflow failure or warning across your instance automatically opens an incident, pages the right on-call engineer, and feeds your existing escalation policies. Instead of polling dashboards or scraping logs, you get real-time, structured incident alerting driven by execution events, with deduplication and routing handled by PagerDuty.
io.kestra.plugin.core.trigger.Flow trigger (on_failure) listens to executions across the whole instance.io.kestra.plugin.core.condition.ExecutionStatus matches FAILED and WARNING executions, and io.kestra.plugin.core.condition.ExecutionNamespace with comparison: PREFIX scopes alerting to the company namespace tree.create_pagerduty_alert task (io.kestra.plugin.pagerduty.PagerDutyExecution) posts an event to the PagerDuty Events API.payloadSummary enriched with {{ trigger.executionId }} and {{ taskrun.startDate }}, an eventAction of trigger, plus a deduplicationKey and routingKey so PagerDuty groups duplicates and routes to the correct service.PagerDuty reacts to events but does not know when your pipelines fail. Kestra closes that gap. The event-driven Flow trigger fires on real execution status, no cron polling required. Declarative YAML keeps the alerting rule versioned and reviewable, retries and execution lineage stay visible in the Kestra UI, and a single system flow centralizes alerting policy instead of scattering notification logic across hundreds of individual workflows.
PAGERDUTY_EVENT: the PagerDuty Events API v2 integration URL used by the url property.PAGERDUTY_EVENT secret with your PagerDuty Events API integration URL.dedupkey and routingkey with the real deduplication and routing keys for your service.ExecutionNamespace namespace prefix to match the namespaces you want to monitor.ExecutionStatus values or a label condition to narrow which failures page.eventAction to resolve in a companion flow on SUCCESS to auto-close incidents.payloadSummary with flow ID, namespace, or attempt count for richer triage context.