---
title: "Running Durable Workflows in Postgres using DBOS"
description: "DBOS implements durable workflows entirely in Postgres: workflow and step decorators record a workflow's ID, inputs and status in a workflow_status table and each step's output in operation_outputs, all within a separate system database."
url: "https://swe.quest/articles/running-durable-workflows-in-postgres-using-dbos-758f463809fa3e9f"
canonical: "https://supabase.com/blog/durable-workflows-in-postgres-dbos"
source: "Supabase"
published: "2024-12-10"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 4
tags: ["postgres","scheduling","resilience","serverless"]
---

# Running Durable Workflows in Postgres using DBOS

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2024-12-10, 4 min read, Deep dive. Original: [https://supabase.com/blog/durable-workflows-in-postgres-dbos](https://supabase.com/blog/durable-workflows-in-postgres-dbos)

## Summary

DBOS implements durable workflows entirely in Postgres: workflow and step decorators record a workflow's ID, inputs and status in a workflow\_status table and each step's output in operation\_outputs, all within a separate system database. On restart, a background thread re-runs PENDING workflows with their original inputs and skips steps whose outputs are already stored, so execution resumes from the last completed step. This relies on workflows being deterministic. Because a step transition is a ~1ms Postgres write rather than a ~100ms external dispatch, DBOS claims 25x the speed of AWS Step Functions, and it offers exactly-once transactional steps and idempotency keys used as workflow IDs.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Scheduling](https://swe.quest/tags/scheduling.md) (Distributed systems)
- [Resilience](https://swe.quest/tags/resilience.md) (Distributed systems)
- [Serverless](https://swe.quest/tags/serverless.md) (Backend & APIs)

## Prerequisites

- Postgres basics ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- database transactions ([easy posts on Databases](https://swe.quest/tags/databases.md?difficulty=easy))

## Keywords

DBOS, Supabase, PostgreSQL, AWS Step Functions, Temporal, durable workflows

## Related posts

- [Durable and auditable workflows with DBOS and ClickHouse Managed Postgres](https://swe.quest/articles/durable-and-auditable-workflows-with-dbos-and-clickhouse-managed-postgres-84b2cf91df44a544.md): ClickHouse · 2026-11-24 · Medium · 6 min read · Event-driven architecture, PostgreSQL, Analytics & OLAP, Scheduling, Python
  DBOS, an open-source Postgres-native durable execution library, stores workflow and step checkpoints, queues and schedules in Postgres so crashed processes resume from the last completed step without a separate orchestrator.
- [Building Workflows, Part 2 – the executor and evaluation](https://swe.quest/articles/building-workflows-part-2-the-executor-and-evaluation-b966efc6ca5866f8.md): incident.io · 2022-09-14 · Medium · 19 min read · PostgreSQL, Scheduling, Queues & messaging, System design, Go
  incident.io's workflow executor listens for trigger events, evaluates workflow conditions against a scope, and creates a workflow run before executing steps.
- [Workflows are coming to Supabase](https://swe.quest/articles/workflows-are-coming-to-supabase-a57ed34660f0256b.md): Supabase · 2021-04-02 · Medium · 5 min read · Serverless, PostgreSQL, Elixir & Erlang, Scheduling, Event-driven architecture
  Supabase is building Workflows, an open source orchestration engine written in Elixir that uses the Amazon States Language to coordinate existing functions (AWS, GCP, Azure, OpenFaaS, Postgres) in response to database events or HTTP calls.
- [Production Postgres on Railway: From First Deploy to High Availability](https://swe.quest/articles/production-postgres-on-railway-from-first-deploy-to-high-availability-70a3bcba84354fc9.md): Railway · 2026-10-15 · Medium · 13 min read · PostgreSQL, Replication, Resilience, Cloud platforms
  Railway Postgres can grow from a single private-networked database to a production setup with volume backups, point-in-time recovery, PgBouncer connection pooling and Patroni-based high availability, demonstrated with an orders API that uses idempotency keys so retries stay safe.
- [Managed Postgres on Railway](https://swe.quest/articles/managed-postgres-on-railway-38376e6923686bbc.md): Railway · 2026-11-05 · Medium · 9 min read · PostgreSQL, Replication, Cloud platforms, AI agents
  Railway's managed Postgres now covers the full database lifecycle: private-by-default services with reference-variable credentials, usage-billed vertical scaling, live volume resizing, and one-click PgBouncer pooling with a separate unpooled URL for migrations.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
