state.do

State Machines That Never Lose Progress

Durable execution with automatic state persistence, sub-100ms state transitions, and zero data loss. Build complex workflows that survive failures, handle human approvals, and resume exactly where they stopped.

Read the docs
index.tsstate.do
import { State, on } from 'state.do' // Durable state machine with automatic persistenceconst OrderState = State({  initial: 'pending',  states: {    pending: { on: { PAYMENT_RECEIVED: 'processing' } },    processing: { on: { ITEMS_SHIPPED: 'shipped', FAILED: 'error' } },    shipped: { on: { DELIVERED: 'completed' } }  }}) // React to state transitions and trigger workflowson.Order.state.changed($ => $.to === 'processing'  ? $.Warehouse.send.ShippingRequest({ orderId: $.data.orderId })  : $.Customer.send.Email({ template: `order-${$.to}` }))

Frequently asked questions

Build your 1-person unicorn

Write the business. Agents run it around the clock.

Read the docs