pgflow

Workflow orchestration that runs in your Supabase project

This demo runs a 4-step DAG: fetch → (summarize + extractKeywords in parallel) → publish.

Postgres handles orchestration, state management, output persistence, retries, and queue management.

Auto-respawning Edge Function worker executes your handlers.

TypeScript Client wraps RPC and Realtime for starting flows and observing state changes.

Click any step to inspect inputs, outputs, and dependencies

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

Processes web articles by fetching content, generating summaries and keywords in parallel, then publishing the results. Demonstrates parallel execution, automatic retries, and dependency management.

How pgflow orchestrates this flow

start_flow() creates a run and initializes state for each step. Root steps (no dependencies) get tasks queued immediately.

Edge Function worker polls the queue, calls start_tasks() to reserve tasks, executes handlers, then calls complete_task() to save outputs.

SQL Core checks dependencies after each completion, creates tasks for steps with all dependencies met, and marks the run complete when remaining_steps = 0.

Supabase Realtime broadcasts state changes back to this UI for live updates.

Reliability Configuration
maxAttempts: 2

Automatically retries failed steps up to 3 times before giving up

Steps