Durable execution. Thread by thread.
Durable execution for agents, workflows, and whatever you build next.
Weave agents, workflows, and your own thread types into one durable run. Nest them together, pause for the world, and pick up where you left off.
npm install @swirls/loomsDefine your own thread types.
An agent loop and a workflow DAG are two ways of running work. Looms lets you define another: an auction, a review policy, a device controller. Compose them in one run, with one shared history.
Finds suppliers and starts a purchase.
Coordinates bidding, review, and fulfillment.
Accepts bids until a deadline and returns a winner.
Recover recorded progress
Load durable history after a restart. Historical replay rebuilds state without dispatching effects; external actions interrupted by a crash need safe retries.
Understand the guarantees →Wait for the world
Pause for a human, webhook, timer, or child thread. Keep decisions in the log and resume when the matching event arrives.
Add a human decision →Show what happened
Use the same events to render conversations, approval queues, and debugging views. Build shared indexes for work across runs.
Connect your UI →Add your own modules.
Define events, effects, thread kinds, and projections in a module. Built-in modules use the same extension model as yours.
Write a module →import { createLooms } from '@swirls/looms/runtime'import { agent } from '@swirls/looms/agent'import { workflow } from '@swirls/looms/workflow'import { approval } from '@swirls/looms/approval'import { auction } from './auction'import { buyer, purchase, llm } from './definitions'const looms = createLooms({ modules: [ agent({ definitions: [buyer], llm }), workflow({ definitions: [purchase] }), approval(), auction, ],})await looms.start(buyer, 'Find a supplier')One timeline across every thread.
Follow delegation, tool results, and decisions in one place. Select a thread or event in this recorded run to see how the work unfolded.
Inspect your runs →Explore recorded events and thread relationships.
Start with a run.
Run locally with Bun and SQLite, then take the same definitions to Cloudflare Durable Objects.