PagerDuty

Monitoring API key, or an Events routing key

Create and resolve incidents, and manage services, schedules and escalation policies, in PagerDuty from any Windmill script, flow or app.

Set up in 3 steps

1

Create an API key

In PagerDuty, open Integrations then API Access Keys, and create one. Note the login email of a PagerDuty user too — the REST API requires it as the From header on writes.

2

Add the resource in Windmill

Open Resources, add a resource of type pagerduty, and fill token and from_email.

3

Run your first script

Fork any script below and read before writing anything.

Scripts

Building blocks, if none of the projects above fit. Fork one, run it, or call it as a step inside your own flow.

Submit a script →

Trigger flows from PagerDuty

PagerDuty is not only a destination. These inbound paths are supported today.

Alerts from your own jobs

The Events API scripts take a routing key rather than an API key, so a failing flow can trigger, acknowledge or resolve an alert on one service without any account-wide credential.

New or updated incident (scheduled poll)

The New or Updated Incident trigger script polls PagerDuty and returns the incidents whose status changed (created, acknowledged or resolved) since its last run. To run it, open a flow, add a trigger and choose Scheduled Poll, then pick the trigger script and an interval. Windmill puts the script first in the flow with a loop after it, so the steps you add run once per new item. The cursor is saved per flow: two flows polling the same source each get every item, and test runs keep a cursor of their own.

Resource types

The credential shapes the scripts on this page expect — pick the one your script asks for.

FieldTypeRequiredWhat it is
from_emailstringNoLogin email of a valid PagerDuty user. Sent as the `From` header on incident write actions; required when using an account-scoped (general access) API key, ignored for user-scoped keys.
tokenstringYesPagerDuty REST API key. Create one under Integrations → API Access Keys (account-scoped) or My Profile → User Settings → Create API User Token (user-scoped). https://support.pagerduty.com/docs/api-access-keys

pagerduty_events

View raw schema →
FieldTypeRequiredWhat it is
routing_keystringYes32-character Events API v2 integration/routing key from the service's Integrations tab.

Questions

Which resource do I need?

pagerduty for the REST API — incidents, services, schedules. pagerduty_events for firing alerts at one service, which needs only that service's routing key and nothing else.

A write fails without from_email

PagerDuty attributes writes to a user, sent as a From header. It has to be the login email of a real PagerDuty user, not an alias.

Is my token stored on the hub?

Never. It lives only in your own Windmill workspace, encrypted at rest.