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.

  1. 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

    Then apply the migrations:

    npx supabase migrations up
  2. To ensure all the configuration changes are applied, restart Supabase:

    npx supabase stop
    npx supabase start

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 🥳