Bringing the Pieces Together
Queues and Edge Functions shine on their own. pgflow wraps them in one orchestration interface, so you write features-not glue code.
npx pgflow@latest install
While Supabase provides the essential building blocks, pgflow brings enhanced orchestration for advanced workflow management.
Real comments after seeing early demos
As apps grow, a little extra coordination can save a lot of engineering time. pgflow steps in right there:
Bringing the Pieces Together
Queues and Edge Functions shine on their own. pgflow wraps them in one orchestration interface, so you write features-not glue code.
Wanting a Bird’s-Eye View
When your workflows span several functions or use multiple cron schedules, it’s handy to follow progress from a single place. pgflow’s approach prioritizes at-a-glance visibility for runs, step states, retries and outputs.
Extra Type Confidence
Define workflows in TypeScript and get a compile-time safety for the data flow between steps.
Keeping Everything Inside Supabase
All state, retries, and dependencies stay in the Postgres database you already trust-no extra services required.
pgflow works in harmony with Supabase’s tools, simplifying orchestration and enabling a more cohesive workflow.
Eliminate manual orchestration with Postgres‑native workflows, zero extra servers, and built‑in reliability
Postgres-Native Orchestration
pgflow handles state transitions, dependencies, and execution control directly inside in your Supabase Postgres database. Everything is self-contained.
Durable Queue-Based Workers
Edge Functions pull tasks from a Postgres queue with automatic retries, back‑offs, and concurrency limits.
Simple, Typed Flow Definitions
You specify flow logic once. pgflow enforces retries, timeouts, and step dependencies without custom plumbing.
Zero Extra Infra, Zero Lock-In
Everything stays in your Supabase project. No extra runtimes, no vendor dashboards.
pgflow is a workflow orchestration system with its core state management in your database, combining:
SQL Core
Manage workflow state and transitions natively in Postgres with full ACID compliance
TypeScript DSL
Type-safe workflows with automatic inference and end-to-end compile-time safety.
Edge Worker
Auto-respawning, continuously running worker for low latency, reliable task execution.
CLI Tools
One-command setup: quickly deploy pgflow with automatic DB migrations.
Define parallel, type-safe DAG workflows effortlessly.
new Flow<{ url: string }>({ slug: 'analyze_website',}) .step( { slug: 'website' }, async (input) => await scrapeWebsite(input.run.url) ) .step( { slug: 'summary', dependsOn: ['website'] }, async (input) => await summarizeWithAI(input.website.content) ) .step( { slug: 'tags', dependsOn: ['website'] }, async (input) => await extractTags(input.website.content) ) .step( { slug: 'saveToDb', dependsOn: ['summary', 'tags'] }, async ({ run, summary, tags }) => await saveWebsite({ user_id: run.user_id, website_url: run.url, summary, tags, }) );
Single source of truth
All workflow definitions, state, and execution history stored in your Postgres database-simplifying monitoring and debugging.
Reliable task processing
Automatic retries, timeouts, at-least-once delivery and dead-letter handling built directly into your database.
Supabase-native
Deploy as Edge Functions with automatic restarts and zero-config integration with your existing Supabase project.
Developer experience
Full type inference between workflow steps with IDE autocompletion and compile-time safety for your entire workflow DAG.
Create and run workflows with a straightforward process:
The execution system handles the rest-scheduling steps when dependencies complete, retrying failed tasks, and aggregating results automatically.