Backfill & Run Operations
Backfill lets you (re)run a scheduled flow over a historical time range as a set of discrete, tracked runs. It lives in the `runs_ops` module (`src/dagy_api/runs_ops/`).
Model
A backfill job is stored in the table named by DAGY_BACKFILLS (documented
default dagy-backfills-{environment}). When the env var is unset,
backfills_enabled() returns False and the router degrades gracefully — the
module is always import-safe.
build_backfill_plan(...) expands a [start, end] window and cadence into
discrete BackfillIntervals, so each historical period becomes its own run with
its own status.
API
Exposed by the runs_ops router:
| Method & path | Purpose |
|---|---|
POST /flows/{flow_name}/backfill | create a backfill job |
GET /backfills | list backfill jobs for the org |
GET /backfills/{backfill_id} | backfill progress (per-interval status) |
POST /backfills/{backfill_id}/cancel | stop dispatching further runs |
The same module also provides retry and run-comparison endpoints for operational workflows.
Cancellation semantics
Cancel stops dispatching further runs; runs already launched continue to completion. Use cancel to stop a backfill that is overloading the system (it is also the mitigation referenced in the DynamoDB throttling runbook).