How to Give Millions of Workflows Quality Sleep
DBOS workflow suspension lets a durable workflow that is sleeping or waiting for a notification (via `suspend=True` on `DBOS.recv` or `DBOS.sleep`) mark itself SUSPENDED in its database row, record a delay deadline and suspend key, and exit via a special exception, so it holds no thread, memory or queue slot. Timeouts are resumed by a background poller that reads only the front of an index on the delay-deadline column and clears deadlines after waking workflows, keeping the index small. Notifications are handled in `DBOS.send`, which sets a matching suspended workflow's deadline to 0 so the poller wakes it immediately; a transactional check before suspending avoids races. Woken workflows are re-enqueued and resume from checkpoints exactly as in crash recovery, which lets millions of long-waiting workflows coexist cheaply.
Related posts
- Running Durable Workflows in Postgres using DBOS
Supabase mediumAdeptDBOS 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.
- How We Oops-Proofed Infrastructure Deletion on Railway
Railway mediumAdeptRailway now gives deleted persistent volumes a 48-hour grace period during which deletion can be undone, built on Temporal durable workflows. Committing an environment patch starts a workflow via signalWithStart. A delayed-deletion workflow marks the volume's deletedAt, notifies admins, then waits on a condition until a cancel signal arrives or the timeout expires. If cancelled, it restores the volume. Otherwise a child workflow with a 1-hour timeout tears down each instance through the router and compute host (ZFS recursive destroy) and then tombstones or hard-deletes the database records, with non-cancellable cleanup of the state on failure.
- Durable and auditable workflows with DBOS and ClickHouse Managed Postgres
ClickHouse mediumAdept
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. The walkthrough runs the DBOS Python starter app against ClickHouse Managed Postgres, then uses WalShadow (private preview) to replicate the dbos schema from the Postgres WAL into ClickHouse. With WalShadow's soft-delete setting, deletions arrive as tombstone rows (_is_deleted = 1, _commit_ts) in a ReplacingMergeTree. That lets teams keep short retention in Postgres (e.g., seven days) while holding years of auditable workflow history in ClickHouse.
- Building Workflows, Part 2 – the executor and evaluation
incident.io mediumAdeptincident.io's workflow executor listens for trigger events, evaluates workflow conditions against a scope, and creates a workflow run before executing steps. A broad 'incident-updated' trigger fixes ordering problems with multi-condition workflows. A 'once-for' column backed by a Postgres unique index provides cheap, consistent idempotency, so trigger consumers can be retried safely. To cope with Google Pub/Sub's at-least-once delivery, execution proceeds one step at a time under a SELECT FOR UPDATE row lock, with a JSON progress column recording completed steps. Runs therefore behave serially, resume after crashes without repeating steps, and double as a customer-facing audit log.
- Incident Report: February 11, 2026
Railway mediumAdeptA new automated anti-fraud ruleset at Railway used overly broad workload-fingerprinting criteria. It matched legitimate processes, including Postgres and MySQL databases, and sent them SIGTERM, leaving about 3% of workloads in a "forced pause" state. The rule had passed staging tests and a production dry run, but false positives appeared only after live staged rollout. Reverting it and restarting affected deployments took about four hours, and the mass restart caused deployment backpressure. Planned fixes include broader false-positive testing against common workloads, longer observation windows, tier-based staged rollout, and safeguards that exempt known legitimate process types from enforcement.