Skip to main content

Overview

Appends a new routing rule to the end of an event orchestration’s router rules. This is a convenience tool that retrieves the current configuration, adds your new rule, and updates the router.
This is a write tool that modifies your PagerDuty account. It requires the --enable-write-tools flag to be enabled.

Parameters

orchestration_id
string
required
The ID of the event orchestration to append a rule to
new_rule
EventOrchestrationRuleCreateRequest
required
The new routing rule to append

Response

Returns the updated EventOrchestrationRouter object with the new rule appended to the end of the rules list.

How It Works

This tool:
  1. Retrieves the current router configuration
  2. Appends your new rule to the end of the existing rules
  3. Updates the router with the modified configuration
  4. Returns the updated router
The new rule is evaluated after all existing rules, so it won’t affect existing routing logic.

Usage Examples

Add a routing rule

Add a rule to orchestration P1A2B3C that routes events with 'database' in the summary to service PABCDEF

Add a rule for critical events

Add a routing rule to orchestration P1A2B3C for critical severity events to route to the SRE on-call service

Add a rule with multiple conditions

Add a rule to orchestration P1A2B3C that routes events from production databases to service PXYZABC

PCL Expression Examples

PagerDuty Common Expression Language (PCL) is used for rule conditions:

String matching

event.summary matches part 'error'
event.summary matches part 'database'
event.summary matches regex 'Error: (\\d+)'

Equality checks

event.severity equals 'critical'
event.source equals 'monitoring-system'
event.custom_details.environment equals 'production'

Logical operators

event.severity equals 'critical' && event.source matches part 'prod'

Field existence

event.custom_details.region exists

Important Notes

Rules are evaluated in order. Your new rule will be evaluated last, after all existing rules. If an earlier rule matches the event, your new rule won’t be evaluated.
If the orchestration has no valid router configuration, this tool will raise an error.

Build docs developers (and LLMs) love