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.

This flow processes web articles by fetching content, generating summaries and keywords, then publishing the results.

Demonstrates parallel execution, automatic retries, and dependency management—all core pgflow features.

⚙️ How SQL Core orchestrates this flow

When you call start_flow('article_flow', {url}), SQL Core creates a run and initializes state rows for each step. Root steps (no dependencies) get messages pushed to the queue immediately.

As Workers execute handlers and call complete_task(), SQL Core acknowledges completion, saves outputs, checks dependent steps, and starts those with all dependencies satisfied. The run completes when remaining_steps = 0.

This demo uses Supabase Realtime to broadcast graph state changes from SQL Core back to the browser in real-time.

🛡️ Reliability Configuration
maxAttempts: 3

Automatically retries failed steps up to 3 times before giving up

Steps