Skip to content
This guide is for the queue-only version of Edge Worker. Main docs are here

# Install Edge Worker

Let’s set up a few things before working with Edge Worker. This setup needs to be done only once per project.

Not production ready

pgflow is currently in Alpha stage and not yet production ready.

Prerequisites

- Supabase CLI version 2.0.2 or higher (check with `supabase -v`)
- A local Supabase project set up
- Node.js and npm installed

If you haven’t installed the CLI yet or need to upgrade, see Supabase’s installation guide.

1. ### Install Edge Worker

   Section titled “Install Edge Worker”

   You can install Edge Worker using the pgflow installer (recommended) or manually if you want more control over the process.

   Run the pgflow installer with npx:

       npx pgflow@latest install

   The installer will:

   - Detect your Supabase project automatically
   - Update your `config.toml` to enable connection pooling
   - Copy the required migrations to your migrations folder (including all Edge Worker tables)
   - Create a functions environment file if needed

   Note

   If your Supabase directory isn’t detected automatically, specify it manually:

       npx pgflow@latest install --supabase-path=./path/to/supabase

   Then apply the migrations:

       npx supabase migrations up

   Note

   The pgflow installer sets up both pgflow and Edge Worker schemas and tables, since pgflow builds on top of Edge Worker’s functionality.

2. ### Restart Supabase

   Section titled “Restart Supabase”

   To ensure all the configuration changes are applied, restart Supabase:

       npx supabase stopnpx supabase start

### What was installed?

Section titled “What was installed?”

The pgflow installer set up everything needed for Edge Worker:

1. Database schemas - Required tables for worker management and message queuing
2. Connection pooling - Configured in transaction mode for proper worker operation
3. Environment variables - Database connection for Edge Functions
4. Edge runtime policy - Set to per_worker mode for background tasks

That’s it! You’re ready to create your first worker and start processing messages 🥳