Skip to content
pgflow is in public beta. See project status for production readiness details.

Deploy Your First Flow

This guide walks you through deploying your pgflow workers to Supabase.com production for the first time.

Your workers need to connect to the production database:

  1. Open Supabase Dashboard
  2. Navigate to SettingsDatabase
  3. Scroll to Connection String section
  4. Copy the Transaction Mode connection string (uses connection pooler)

The connection string looks like:

postgresql://postgres.pooler-yourproject:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:6543/postgres

Workers access the database through the EDGE_WORKER_DB_URL environment variable. Set it as a Supabase secret:

npx supabase secrets set EDGE_WORKER_DB_URL="postgresql://postgres.pooler-yourproject:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:6543/postgres"

Replace [YOUR-PASSWORD] with your actual database password from the connection string.

Deploy your Edge Function to Supabase:

npx supabase functions deploy your-worker-name

Replace your-worker-name with your actual worker function name (e.g., flow-worker).

This uploads your worker code and makes it available at:

https://your-project.supabase.co/functions/v1/your-worker-name

Workers don’t start automatically after deployment. Start it with a POST request:

curl "https://your-project.supabase.co/functions/v1/your-worker-name" \
-H "Authorization: Bearer YOUR_ANON_KEY"

Finding your ANON key:

  1. Open Supabase Dashboard
  2. Navigate to SettingsAPI
  3. Copy the anon public key

The worker starts polling for tasks and continues running until it’s stopped or times out.

Edge Functions eventually stop due to platform limits or errors. Set up a pg_cron job to automatically restart workers when they stop.

Follow the safety net setup guide →