> For the complete documentation index, see [llms.txt](https://doc.wearepatchworks.com/product-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.wearepatchworks.com/product-documentation/virtual-environments/implementing-virtual-environments/deploying-a-single-process-flow-to-a-virtual-environment/understanding-queue-priority-in-virtual-environments.md).

# Understanding queue priority in virtual environments

## Introduction

When a process flow is initialised, it gets added to your run queue and - by default - is picked for processing as soon as a slot becomes available. You have the option to assign a different `queue priority` for a given process flow, assigning a higher or lower priority in [process flow settings](/product-documentation/process-flows/building-process-flows/process-flow-settings.md) - for example:

<div align="left"><figure><img src="/files/yQi12BPBgtdMOIZcjncp" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
&#x20;For more information about this, please refer to [Working with your run queue](/product-documentation/process-flows/error-reporting-and-exception-handling/run-logs-and-queue/working-with-your-run-queue.md).
{% endhint %}

However, if you deploy process flows to virtual environments, you may need to assign a different `queue priority` in different virtual environments. You can do this in two ways:

* [As part of the deployment process for a flow version](#setting-queue-priority-as-part-of-flow-deployment-to-a-virtual-environment)
* [As a replacement setting in the configuration for each virtual environment](#setting-queue-priority-as-part-of-virtual-environment-configuration)

In the following sections, we take a look at queue priority options and consider the precedence of one over the other.

## Setting queue priority as part of flow deployment to a virtual environment

When [deploying a single process flow version to a virtual environment](/product-documentation/virtual-environments/implementing-virtual-environments/deploying-a-single-process-flow-to-a-virtual-environment.md), a queue priority option is available - for example:&#x20;

<div align="left"><figure><img src="/files/fgkSbYcIhJmIJuooXiXe" alt=""><figcaption></figcaption></figure></div>

The default setting is to `inerit from flow`, which means that the `queue priority` defined for the process flow as a whole (see [above](#introduction)) is applied when this process flow runs in the associated virtual environment.&#x20;

If required, you can override the default, flow-level priority with a new setting that only applies when this flow version runs in the associated virtual environment.

## Setting queue priority as part of virtual environment configuration

When [configuring replacement options for a virtual environment](/product-documentation/virtual-environments/implementing-virtual-environments/configuring-a-virtual-environment-version/configuring-virtual-environment-replacements.md), you can define a [flow queue priority](/product-documentation/virtual-environments/implementing-virtual-environments/configuring-a-virtual-environment-version/configuring-virtual-environment-replacements/replacement-flow-queue-priorities.md) for process flows if/when they are deployed to that environment, for example:

<div align="left"><figure><img src="/files/HRQNdu66nvZTvRj6GOge" alt=""><figcaption></figcaption></figure></div>

Choosing to configure a replacement `flow priority` here overrides any current `queue priority` setting (i.e. it overrides the [default flow-level setting](#introduction) AND any [override set when this process flow was deployed](#setting-queue-priority-as-part-of-flow-deployment-to-a-virtual-environment)).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.wearepatchworks.com/product-documentation/virtual-environments/implementing-virtual-environments/deploying-a-single-process-flow-to-a-virtual-environment/understanding-queue-priority-in-virtual-environments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
