Runbook Triggers

Learn how to write custom automated playbooks.

Runbooks in DeployPilotOS are YAML definitions of standard operating procedures. When the agent diagnoses a root cause with high confidence (>80%), it will attempt to match the root cause to a predefined runbook.

Runbook Schema

A runbook defines triggers (regex patterns to match against AI diagnosis) and steps (actions to perform).

db-recovery.yaml
name: DB Connection Pool Exhaustion Recovery
description: Automatically restarts the connection manager and bumps pool limits.
triggers:
  - match: "connection pool exhausted"
  - match: "too many connections"
steps:
  - type: shell
    command: "kubectl scale deployment api-service --replicas=0"
  - type: sql
    query: "ALTER SYSTEM SET max_connections = 300;"
  - type: shell
    command: "kubectl scale deployment api-service --replicas=3"

Human-in-the-Loop Mode

For critical infrastructure (like databases), you can add requireApproval: true to the runbook YAML. DeployPilotOS will halt execution and ping the on-call engineer via Slack or Voice War Room for manual sign-off before proceeding.