# AUTOMATION.md starter: alert watch

When to use. A job that runs on an event (an alert), adds it to the on-call queue, and hands it to a person when it keeps coming back. min_gap is the rate limit: a run that comes sooner holds. Telling the backup contact waits for the owner's yes, so a burst of alerts never pages anyone on its own.

Before you turn it on. Change the owner, the event name, the gap, the repeat count and the amounts to your own. Run check_automation with your rules, show the section to the owner, and set status on only after their yes. Call preflight_run on every event; it holds a run inside min_gap and once the day's budget is spent.

format: automation/1
owner: ops-team
currency: USD
timezone: UTC
updated: 2026-10-23

## alert-watch

trigger: on alert.raised
steps:
  1. read the alert and the alerts of the last hour
  2. skip it when the same one was handled in the last 10 minutes
  3. add the alert to the on-call queue
  4. notify the backup contact when the same alert repeats 3 times in an hour
scope: read alerts, on-call queue; write on-call queue
approval: before notify the backup contact
budget: 0.02 per run, 0.50 per day, 10 per month
retries: 2, backoff 30s exponential
timeout: 2m
min_gap: 1m
owner: ops-team
status: draft
last_reviewed: 2026-10-23
