Typed by construction
Inputs, outputs, terminal errors, and signals share one schema-first contract from authoring through execution.
The durable workflow CLI
wf is the local CLI for creating, running, signalling, and inspecting workflows that survive restarts.
wf create orders --file workflows/orders.ts --version 1wf run orders '{"orderId":"1842"}'wf signal 0190...a92 managerApproval '{"approved":true}' wf history 0190...a92bun install -g @mokronos/wf Let the model discover tools, resolve ambiguity, and compose the plan. Then turn that plan into a typed artifact a small, boring runtime can execute for years.
Discover schemas, compose steps, generate tests, repair failures.
Persist results, replay decisions, wait durably, compensate safely.
01 export const OrderWorkflow = defineWorkflow({
02 name: "OrderWorkflow",
03 input: Order,
04 output: Receipt,
05 run: function* (order, ctx) {
06 const payment = yield* ctx.run(
07 chargeCard,
08 order
09 )
10 yield* ctx.waitForSignal(
11 "managerApproval",
12 Approval
13 )
14 return { paymentId: payment.id }
15 }
16 }) A restart reruns workflow code but reuses journaled step results, time, randomness, and signals. Side effects happen once; orchestration remains understandable.
OrderWorkflow:v1 ChargeCard #2 ReserveStock #1 managerApproval actor: ops pay_order-1842 Workflow semantics stay explicit. Everything else stays TypeScript.
Inputs, outputs, terminal errors, and signals share one schema-first contract from authoring through execution.
Step results, timers, signal waits, and deterministic values are journaled before the workflow moves on.
Retries, timeouts, typed failures, and compensations are workflow semantics, not comments in generated code.
Every run leaves a replayable event history. See the graph, inspect the source, and understand why it stopped.
Keep mapping, filtering, formatting, and business rules in code instead of exploding them into tiny nodes.
Bun and SQLite make the full durable loop easy to run, test, restart, and reason about on one machine.
Top-level help maps the workflow lifecycle. Every command explains its own arguments, options, and examples, without leaving the terminal.
Read the CLI reference ↗wf helpwf help createwf run --helpNo. Workflows are TypeScript artifacts. The observer renders graphs and histories from those artifacts so humans can inspect what the runtime understands.
No. Agents help design, test, and repair workflows. The deployed runtime executes deterministic code and only calls models when you explicitly define a model-backed step.
Step results, timers, signal waits, and deterministic values are persisted. After a restart, workflow code replays against that journal instead of repeating completed side effects.
The current runtime persists locally in SQLite. This keeps development and single-owner deployments small, inspectable, and easy to move.
Build the artifact. Keep the history.