DBOS Transact: Lightweight Durable Workflows Documentation • Examples • Github • Discord
What is DBOS?
DBOS provides lightweight durable workflows built on top of Postgres. Essentially, it helps you write long-lived, reliable code that can survive crashes, restarts, and failures without losing state or duplicating work.
As your workflows run, DBOS checkpoints each step they take in a Postgres database. When a process stops (fails, intentionally suspends, or a machine dies), your program can recover from those checkpoints to restore its exact state and continue from where it left off, as if nothing happened.
In practice, this makes it easier to build reliable systems for use cases like AI agents, data synchronization, payments, or anything that takes minutes, days, or weeks to complete. Rather than bolting on ad-hoc retry logic and database checkpoints, DBOS workflows give you one consistent model for ensuring your programs can recover from any failure from exactly where they left off.
This library contains all you need to add durable workflows to your program: there's no separate service or orchestrator or any external dependencies except Postgres. Because it's just a library, you can incrementally add it to your projects, and it works out of the box with frameworks like Spring. And because it's built on Postgres, it natively supports all the tooling you're familiar with (backups, GUIs, CLI tools) and works with any Postgres provider.
Features
💾 Durable Workflows Workflows make your program durable by checkpointing its state in Postgres. If your program ever fails, when it restarts all your workflows will automatically resume from the last completed step. You add durable workflows to your existing Java program in just a few lines of code by registering ordinary functions as workflows and steps: interface Example { public void workflow (); } class ExampleImpl implements Example { private void stepOne () { System . out . println ( "Step one completed!" ); } private void stepTwo () { System . out . println ( "Step two completed!" ); } @ Workflow () public void workflow () { DBOS . runStep (() -> stepOne (), "stepOne" ); DBOS . runStep (() -> stepTwo (), "stepTwo" ); } } Workflows are particularly useful for Orchestrating business processes so they seamlessly recover from any failure.
Building observable and fault-tolerant data pipelines.
Operating an AI agent, or any application that relies on unreliable or non-deterministic APIs. Read more ↗️
... continue reading