{
  "name": "pagerduty-trigger",
  "title": "Trigger a PagerDuty alert",
  "category": "Notifications",
  "tags": [
    "notifications",
    "python"
  ],
  "version": "1.0.0",
  "date": "2026-07-16",
  "notes": "Initial release.",
  "latest": true,
  "installable": true,
  "url": "https://catalog.dagweave.com/api/v1/items/pagerduty-trigger/1.0.0.json",
  "templateUrl": "https://catalog.dagweave.com/api/v1/items/pagerduty-trigger/1.0.0/template.yaml",
  "entrypoint": "trigger",
  "parameters": [
    {
      "name": "source",
      "title": "Source",
      "description": "The affected system, component or service the alert originates from.",
      "type": "string",
      "required": true,
      "example": "checkout-api"
    },
    {
      "name": "summary",
      "title": "Summary",
      "description": "Human-readable summary of the alert (the incident title).",
      "type": "string",
      "required": true
    },
    {
      "name": "routing-key-secret-key",
      "title": "Routing key secret key",
      "description": "Key within the Secret that holds the routing key.",
      "type": "string",
      "required": false,
      "default": "routing-key"
    },
    {
      "name": "routing-key-secret-name",
      "title": "Routing key secret name",
      "description": "Name of the Kubernetes Secret in the run namespace holding the Events API v2 integration routing key.",
      "type": "string",
      "required": false,
      "default": "pagerduty-routing-key"
    },
    {
      "name": "severity",
      "title": "Severity",
      "description": "Perceived severity of the alert.",
      "type": "string",
      "required": false,
      "default": "critical",
      "enum": [
        "critical",
        "error",
        "warning",
        "info"
      ]
    }
  ],
  "images": [
    {
      "ref": "python@sha256:20a82dbc2783112ddb91d1534603f802d222a3e63e593cd002eb2ac534e70211",
      "repository": "python",
      "digest": "sha256:20a82dbc2783112ddb91d1534603f802d222a3e63e593cd002eb2ac534e70211"
    }
  ],
  "install": {
    "kubectl": "kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/pagerduty-trigger/1.0.0/template.yaml",
    "argo": "argo template create -n argo https://catalog.dagweave.com/api/v1/items/pagerduty-trigger/1.0.0/template.yaml"
  },
  "template": "apiVersion: argoproj.io/v1alpha1\nkind: WorkflowTemplate\nmetadata:\n  name: pagerduty-trigger\n  labels:\n    dagweave.io/catalog-item: pagerduty-trigger\n  annotations:\n    # The catalog semver this manifest was authored at. The dagweave app records\n    # (catalog-item-id, semver) -\u003e content-hash -\u003e base-vN when it mints the tenant\n    # cluster name via ResolveOrMint. Keep in sync with metadata.yaml `version`.\n    dagweave.io/catalog-version: \"1.0.0\"\n    dagweave.io/catalog-category: \"Notifications\"\nspec:\n  entrypoint: trigger\n  templates:\n    - name: trigger\n      inputs:\n        parameters:\n          # Human-readable summary of the alert (the incident title).\n          - name: summary\n          # Perceived severity: one of critical, error, warning, info.\n          - name: severity\n            default: critical\n          # The affected system, component or service the alert originates from.\n          - name: source\n          # Name/key of the Kubernetes Secret in the run namespace holding the\n          # Events API v2 integration routing key. Defaults let a user leave them\n          # blank in the Inspector.\n          - name: routing-key-secret-name\n            default: pagerduty-routing-key\n          - name: routing-key-secret-key\n            default: routing-key\n      container:\n        # Pinned by digest per the catalog convention: an image rebuild can never\n        # silently change the behaviour of an already-released item version.\n        # python:3.15-alpine — the Events API v2 expects a JSON body, so the payload\n        # is built with json.dumps (which correctly escapes any quotes, newlines or\n        # control characters) rather than shell string assembly. urllib performs the\n        # POST, so no extra image is needed.\n        image: python@sha256:20a82dbc2783112ddb91d1534603f802d222a3e63e593cd002eb2ac534e70211\n        command: [python3, -c]\n        # Values arrive as env vars (below), never interpolated into the program\n        # source, so a summary/source with any content is safe.\n        args:\n          - |\n            import json, os, urllib.request\n            body = {\n                \"routing_key\": os.environ[\"ROUTING_KEY\"],\n                \"event_action\": \"trigger\",\n                \"payload\": {\n                    \"summary\": os.environ[\"SUMMARY\"],\n                    \"severity\": os.environ[\"SEVERITY\"],\n                    \"source\": os.environ[\"SOURCE\"],\n                },\n            }\n            req = urllib.request.Request(\n                \"https://events.pagerduty.com/v2/enqueue\",\n                data=json.dumps(body).encode(\"utf-8\"),\n                headers={\"Content-Type\": \"application/json\"},\n                method=\"POST\",\n            )\n            with urllib.request.urlopen(req) as resp:\n                print(resp.read().decode(\"utf-8\"))\n        env:\n          - name: SUMMARY\n            value: \"{{inputs.parameters.summary}}\"\n          - name: SEVERITY\n            value: \"{{inputs.parameters.severity}}\"\n          - name: SOURCE\n            value: \"{{inputs.parameters.source}}\"\n          - name: ROUTING_KEY\n            valueFrom:\n              secretKeyRef:\n                name: \"{{inputs.parameters.routing-key-secret-name}}\"\n                key: \"{{inputs.parameters.routing-key-secret-key}}\"\n",
  "templateSha256": "56a9babd471655a51adba37e8cb58c0afb2db548863063583542239c9e81f2c4",
  "source": "https://github.com/dagweave/catalog/tree/67458f74dbbf913b03177f3cefc69424be85eb1d/catalog/pagerduty-trigger",
  "catalogSha": "67458f74dbbf913b03177f3cefc69424be85eb1d"
}
