larzstate
Workflows & state machines.
Durable workflows with per-step checkpointing and crash-resume, saga compensation for rollback, plus a general state machine with guards, actions and history.
larzscript pkg install state
What you get
- Checkpointed workflows
- Crash-resume by run id
- Saga compensation
- State machine w/ guards
Try it
import "state" as state
let w = state.resume("workflow.json", "order-42")
state.step(w, "charge_card", fn(ctx) { ctx["charge_id"] = "ch_1" }, fn(ctx) { print("refunding", ctx["charge_id"]) })
state.step(w, "ship_order", fn(ctx) { ctx["shipped"] = true })
print(state.is_done(w, "charge_card"))
print(state.is_done(w, "ship_order"))Output
true true
Why it's in the Larz Stack
larzstate is a real Larzscript package (larzscript pkg install state) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.