<@ULVA73B9P> Is there a way to establish a priorit...
# ask-marvin
b
@Marvin Is there a way to establish a priority within a work queue? Like, if I have a bunch of flows scheduled to run as soon as the there is a slot in the concurrency limit for that work queue, how can i schedule a flow to be the next one in the queue and bypass all of the other queue’d up flows
m
Yes, in Prefect, you can establish a priority within a work queue. When setting up work queues, each queue is associated with a priority indicated by a unique positive integer. Lower numbers take greater priority in the allocation of work. So, if you have multiple flows scheduled to run, you can assign a flow to a higher priority queue to ensure that it will be the next one to execute when a slot opens up within the concurrency limit for that queue. Priority is used to determine the order in which flow runs are submitted for execution, with higher priority queues receiving precedence. If all flow runs can be executed without limitations due to concurrency, then priority only affects the order of submission, not execution. However, when not all flows can be run due to concurrency limits, priority dictates which queue's runs are submitted first. Here's a brief overview formatted for Slack:
Copy code
plaintext
:sparkles: *Work Queue Priority in Prefect*
- Each work queue has a *priority* indicated by a unique positive integer.
- *Lower numbers* indicate *higher priority*.
- Priority determines the order of flow run submissions, especially under concurrency limits.
- Higher priority queues get precedence in submitting runs for execution.

For more information, refer to the Prefect documentation on work queues: <https://docs.prefect.io/latest/concepts/work-pools/>
Keep in mind that each queue can have its own concurrency limits, and is also subject to the global work pool concurrency limit, which cannot be exceeded.