When you have multiple workers in a pool, the flow run assignment follows a first-come, first-served basis. Here's how it works:
1. Workers continuously poll their assigned work pool for available flow runs
2. When a flow run becomes available (scheduled or triggered), the first worker that polls the work pool and is available to execute the run will pick it up
3. There is no predetermined assignment or load balancing - it's based on which worker checks in first and has capacity
This design is intentionally simple and resilient, as it:
- Automatically handles worker availability (if a worker goes down, others will pick up the work)
- Provides natural load distribution across workers
- Requires no central orchestration or complex scheduling logic
You can monitor which worker picked up a specific flow run in the Prefect UI by looking at the flow run details, which will show the worker that executed it.
If you need more controlled distribution of work, you can:
- Create separate work pools for different types of workloads
- Configure worker process limits to control how many concurrent runs each worker can handle
- Use work pool queue configurations to prioritize certain types of runs
For more details, you can check out the
workers concept documentation and
work pools documentation.