# AUTOMATION.md starter: nightly sync

When to use. A job that copies changed records from one system to another every night: it writes, so it has capped retries with a growing backoff and a timeout well under the gap between runs.

Before you turn it on. Change the owner, the systems, the time (UTC) and the limits to your own. 21:30 UTC sits outside the recommended quiet hours (22:00 to 06:00 UTC); move it if your quiet hours differ. Run check_automation with your rules, show the section to the owner, and set status on only after their yes. Call preflight_run right before each run and count a failed run only after its last retry.

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

## nightly-sync

trigger: cron 30 21 * * *
steps:
  1. pull the records changed since the last sync
  2. write them to the reporting copy
  3. compare the row counts on both sides
  4. log the result
scope: read source records; write reporting copy, sync log
approval: none
budget: 0 per run, 0 per month
retries: 3, backoff 2m exponential
timeout: 45m
owner: data-team
status: draft
last_reviewed: 2026-10-23
