# microsoft/pg_durable

PostgreSQL in-database durable execution

Repository: https://github.com/microsoft/pg_durable
Canonical: https://ross.abutalabs.com/products/pg_durable
Homepage: https://microsoft.github.io/pg_durable/
Language: Rust
License: NOASSERTION
License Family: other
Topics: durable-execution, durable-functions, durable-workflows, postgresql, ai-pipelines, ai-workflows
Last push: 2026-08-26T20:25:12+00:00

## Health v2 (maintenance only)
Score: 82/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 99, longevity 14
- inputs: {"age_days": 201, "days_push": 7, "days_rel": 10, "gap_med": 15.5, "n_releases_24m": 5}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2788, forks 75 (observed 2026-08-28T04:07:21.953454+00:00)

## What it is
pg_durable is a PostgreSQL extension that provides durable execution for long-running, fault-tolerant SQL functions directly inside the database. It lets teams define workflows as graphs of SQL steps that are automatically checkpointed and resumed after crashes, restarts, or failed steps, eliminating the need for external orchestrators, cron jobs, or custom job-queue plumbing.

## Use cases
- run crash-proof background workflows directly in postgres without external orchestrators
- build vector embedding pipelines that chunk documents and upsert into pgvector
- replace pg_cron plus job queue tables and polling workers with durable sql functions
- schedule maintenance runbooks that survive database restarts and are auditable in sql
- fan out parallel sql queries and join results with automatic checkpointing
- orchestrate external api calls like enrichment and classification from sql workflows
- resume failed multi-step data ingestion pipelines from the last checkpoint
- add retries and conditional branching to long-running sql jobs

## When to choose
- your state already lives in postgres and you want workflows next to the data
- you are stitching together cron jobs, workers, queues, and status tables for background work
- you need durable execution without deploying extra service infrastructure like containers or external orchestrators
- you are building data or ai pipelines that need per-row, per-document, or per-batch durability
- you are a dba or sre automating runbooks that must survive restarts and be auditable in sql

## When to avoid
- you need workflows spanning multiple heterogeneous systems beyond postgres
- you prefer a general-purpose orchestrator with a rich ui like airflow or temporal
- your postgres version is older than 17
- you need language-level workflow code rather than a sql dsl

## Facets
- artifact type: library
- maturity: active
- function: database, workflow-automation, scheduling, message-queue, concurrency
- domain: databases, backend, artificial-intelligence, developer-tools
- platform: windows, self-hosted, cloud
- tags: durable-execution, durable-functions, durable-workflows, postgresql-extension, sql-dsl, checkpointing, crash-recovery, background-worker, ai-pipelines, vector-embedding-pipelines, pgvector, workflow-orchestration, retry-logic, fan-out-aggregation, scheduled-maintenance, no-external-services, azure-horizondb, rust, postgres-17, postgres-18, data-engineering, automation, postgresql, linux, macos, docker

## Member repositories
- microsoft/pg_durable (main) score 82

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:21.953454+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T08:15:59.526740+00:00, confidence not recorded.
  - readme: https://github.com/microsoft/pg_durable (fetched 2026-08-28T04:07:21.953454+00:00, sha f297b44be421)
  - homepage: https://microsoft.github.io/pg_durable/ (fetched 2026-08-29T09:55:07.573467+00:00, sha 62102120f1f4)
- Data as of 2026-08-30T08:39:29.467469+00:00.
