Skip to content

# FAQ - Common Questions

## What are the two Edge Worker modes?

Section titled “What are the two Edge Worker modes?”

Short Answer: Edge Worker supports two modes: background jobs (simple task processing) and flows (multi-step workflows with dependencies).

Edge Worker can run in two distinct modes depending on what you pass to `EdgeWorker.start()`:

Background Jobs Mode - For simple, independent tasks:

    EdgeWorker.start(async (payload) => {  // Your task handler});

In this mode, Edge Worker polls a queue (default: `tasks`) and processes messages independently. Perfect for simple background jobs like sending emails, processing uploads, or web scraping.

Flow Mode - For multi-step workflows:

    import MyFlow from './_flows/my_flow.ts';EdgeWorker.start(MyFlow);

In this mode, Edge Worker processes tasks for a specific workflow, handling step dependencies, data flow between steps, and automatic coordination. The queue name matches your flow slug.

Read more about choosing the right mode

Background Jobs: Single-step tasks without dependencies (sending notifications, processing webhooks, image resizing)

Flows: Multi-step processes with dependencies, data flow between steps, parallel execution (AI pipelines, data transformations, business workflows)

Configuration: Both modes share the same Edge Worker options. Background jobs use `queueName` option (default: `tasks`), flows use the flow slug as queue name.

🤔 Hard to decide? Consider flows if your “single step” has multiple distinct operations that could fail independently, or you might add steps later. Handler functions are reusable between modes - start with background jobs and migrate to flows when needed.

## Will running Edge Worker 24/7 affect my billing?

Section titled “Will running Edge Worker 24/7 affect my billing?”

Short Answer: It depends on your workload

Edge Worker consumes:

- Invocations: One invocation to start, then processes messages continuously until CPU/clock limits terminate the function. Automatically self-respawns (and can be additionally respawned by pg_cron safety net if configured).
- Egress: Message data transferred during processing. Varies based on message size and count.

This is more efficient than invoking Edge Functions per-message or per-batch via pg_cron, which would require one invocation per batch.

Actual costs depend on message volume, message size, and worker stability. Monitor your usage in Supabase Dashboard and review Supabase Pricing to understand limits and costs.

## Can one Edge Worker process multiple queues or flows?

Section titled “Can one Edge Worker process multiple queues or flows?”

Short Answer: No - one Edge Worker processes one queue

Each Edge Worker instance is bound to a single queue:

- Background jobs mode: Queue name set via `queueName` configuration (default: `tasks`)
- Flow mode: Queue name automatically matches the flow slug

Scaling options:

- Multiple workers on same queue: Deploy multiple Edge Workers pointing to the same queue for increased throughput
- Multiple queues: Deploy separate Edge Workers - one per queue

## How do I prevent one tenant from monopolizing the queue?

Section titled “How do I prevent one tenant from monopolizing the queue?”

Short Answer: You can’t - fair processing is not implemented yet

Fair processing is not currently implemented in Edge Worker.

Need this? Let’s chat on Discord - there are ideas for workarounds to explore.

## Can I force a new Edge Worker to spawn by calling the function again?

Section titled “Can I force a new Edge Worker to spawn by calling the function again?”

Short Answer: Not reliably

Spawning new Edge Worker instances is managed by the Supabase platform, and simply invoking the same Edge Function again doesn’t guarantee a new Edge Worker is started.

Read more about the Supabase load balancer

### Why can’t I control Edge Worker creation?

Section titled “Why can’t I control Edge Worker creation?”

- Edge Workers are managed by an API gateway that decides when to start new instances based on load and availability.
- Sending multiple HTTP requests to the same Edge Function will not necessarily create new Edge Workers.
- For concurrency or throughput, run multiple Edge Functions with Edge Workers, each configured separately.

## Related Documentation

Section titled “Related Documentation”
Create your first worker
Run your Flow
Worker Configuration
Supabase Pricing