Skip to content

# Deploy to Supabase.com

pgflow workers are regular Supabase Edge Functions. Deploy them like any Edge Function, plus deprecate old workers to prevent version overlap.

Running on production

pgflow is being used in production by early adopters. While core functionality is stable, thorough testing is recommended for your specific use case. Join our community to share experiences and get support.

## Quick Deployment

Section titled “Quick Deployment”

1. Deprecate old workers

       UPDATE pgflow.workersSET deprecated_at = NOW()WHERE function_name = 'your-worker-name'  AND deprecated_at IS NULL;

   This stops old workers from polling for new tasks while they finish current work.

2. Deploy new version

       npx supabase functions deploy your-worker-name

3. Start new worker

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

4. Keep workers up

   Set up the pg_cron safety net for reliable production operation.

   Don't Skip the Safety Net

   Your workers will eventually stop working without a safety net. This is especially critical for production deployments where workflow reliability matters.

   The safety net takes 2 minutes to set up and prevents hours of debugging why workflows stopped running. Configure it now →

## Deployment Details

Section titled “Deployment Details”

### Why Worker Deprecation

Section titled “Why Worker Deprecation”

Without deprecation, old workers run for up to 150s (free tier) or 400s (paid) after deployment, causing both versions to process tasks simultaneously.

Deprecation fixes this: workers check their status every 5 seconds and immediately stop polling for new tasks when deprecated, while finishing current work.

### Getting Your ANON Key

Section titled “Getting Your ANON Key”

Find your ANON key in Supabase Dashboard → Settings → API → `anon` `public` key.

### Monitoring Workers

Section titled “Monitoring Workers”

Track deployment progress with this query:

    SELECT  function_name,  COUNT(*) FILTER (WHERE deprecated_at IS NULL) as active_workers,  COUNT(*) FILTER (WHERE deprecated_at IS NOT NULL) as deprecated_workersFROM pgflow.workersWHERE last_heartbeat_at > now() - interval '6 seconds'GROUP BY function_name;