Operational guarantees
- The scheduler duty uses the store’s lease mechanism.
- Tick identity prevents a repeated duty attempt from duplicating the same logical run.
- Missed-run behavior is explicit per schedule.
- Enqueue hooks receive schedule and tick context.
- The API and console expose bounded enqueue history.
Schedule specifications
The control API accepts epoch-aligned intervals and cron expressions:@every is always aligned to UTC and rejects a
CRON_TZ prefix.
Missed runs
The missed-run policy controls recovery when the scheduler was unavailable across one or more ticks:
Headgate stores
next_run_ms durably. Consequently, the latest due tick is always the
current recovery tick, so skip and run_once have the same effective behavior today:
one latest job and no backlog flood. The separate values preserve the schedule’s declared
intent; backfill is the policy that materially changes the number of jobs enqueued.
The console’s Enqueue now action is unrelated to missed-run recovery. It creates one
extra job from the schedule immediately without changing next_run_ms. That job still
passes through the ordinary admission gate, and an idempotency key prevents a double-click
from creating two manual runs.
Periodic origin
Every scheduler-created job storesperiodic_schedule_id and periodic_tick_ms. Job
inspection exposes the pair as periodic_origin; ordinary jobs return null. Validation
and database constraints require both fields together.
The typed origin is intentionally separate from job IDs, uniqueness keys, and opaque
headers. Operators never need to parse an implementation-specific generated ID to find
the schedule and tick that created a job.
Enqueue-event audit trail
Every automatic tick produces a durable operator-facing enqueue-attempt record:events and an opaque next_cursor.
Stores retain the newest 100 records per schedule, newest first, so both writing and
inspection remain bounded. Deleting a schedule does not delete its enqueue history.
Records contain schedule and tick identity, job ID, store timestamp, outcome, and a stable
low-cardinality reason. They never store payloads or raw backend error text.
The scheduler records the event after enqueue and before compare-and-set schedule advance.
If writing the audit record fails, it does not advance the schedule. A later sweep replays
the deterministic job ID; uniqueness prevents a second job while allowing the missing
audit record to be filled.