Expand description
The run record and the scheduler: a run is a durable transition
log over a workflow’s DAG — per-step {status, attempt, started, finished, output, error}, vars, the start payload, budgets and
the terminal outcome. The scheduler is pure: given a workflow and a run it
names the steps that are ready (all depends_on terminal, when true),
applies step outcomes (on_error routing, goto recovery edges), and
decides the run’s terminal state (finish reached, failed, cancelled, or
stalled — no ready step and no finish).
Structs§
- RunState
- The durable run record: the whole state of one run, and the only thing that has to survive a restart for the scheduler to carry on where it stopped.
- Start
- How the run started: which start node fired, what payload it carried, and
when. Visible to templates as
run.start. - Step
State - One step’s durable state.
Enums§
- Next
- What the scheduler wants done next.
- RunStatus
- Step
Status
Functions§
- deadline_
passed - Whether the run’s deadline passed.
- env_
view - idempotency_
key - The
envview (curated, secret-free) the templates see. The idempotency key for one step of one run: stable across retries and replays BY ARITHMETIC — it is derived from identity every attempt of the same logical operation already shares — and distinct across runs because run ids are. Hashed so the remote learns nothing: a rawrun.stepwould leak ULID timestamps and internal step names to every API that logs its keys, which is the good instinct behind wanting keys random. Deterministic derivation gets the opacity without the persistence, and without the crash-window a mint-then-store scheme has to defend forever. - render_
spec - Render a step’s spec against the run data (every field, recursively).
- route_
failure - Apply a failed step’s
on_errorpolicy: returns the steps to schedule next (agototarget) orErr(reason)when the run must fail. - schedule
- Compute the ready steps.
whenguards are evaluated overdata; a false guard skips the step (durably) — hence&mut RunState.