Building Blocks
OpenWorkflow has three core building blocks:- Workflows: durable functions that describe your business process
- Steps: durable checkpoints that memoize results and protect side effects
- Workers: stateless processes that execute and resume workflow runs
Lifecycle
When a run starts:- Your app enqueues a run (for example, with
ow.runWorkflow(workflow.spec, input)), creating apendingrun in the database - A worker claims the run and marks it
running - The worker replays workflow code from the beginning
- Completed steps return cached outputs; new steps execute and persist results
- The run transitions to
completed,failed, orcanceled(or staysrunningwhile durably parked for sleep)
Why This Is Reliable
- Memoized steps prevent duplicate side effects on retries
- Durable sleep (
step.sleep) pauses runs without holding worker capacity - Heartbeats + leases (
availableAt) allow automatic crash recovery - Database as source of truth avoids a separate orchestration service
Read Next
- Workflows: define and run workflows, options, and states
- Steps: step types, naming, and retry behavior
- Workers: execution model, concurrency, and graceful shutdown
- Configuration: config file and worker/backend settings