Temporal task queue priority and fairness

Temporal task queue priority and fairness let one shared worker pool serve urgent work first and stop one tenant or batch from starving others. This page explains the settings, the trade-offs and what to confirm against your Temporal version.

On this page

When one shared Temporal worker pool needs Temporal task queue priority and fairness

Task queue priority lets Temporal dispatch urgent tasks ahead of less urgent ones on the same task queue, and fairness keeps one tenant or batch from consuming the queue and starving everyone else. Both features apply to one shared worker pool, so a platform team does not have to stand up a separate queue or deployment for every class of work. The situation this section addresses is familiar: one pool of workers serves a time-sensitive workflow such as a payment retry, a large backfill that enqueues thousands of executions at once, and several tenants whose volumes differ widely. Without any ordering control, whichever work arrives in volume tends to be served first in practice, and the urgent workflows wait behind it.

The Temporal documentation describes priority and fairness as settings on task queues that influence the order in which the service hands tasks to workers. Priority is about relative urgency between kinds of work, while fairness is about sharing capacity across keys such as tenants or workflow types so that no single key monopolizes the pool. Teams should decide first whether the problem is ordering (urgent work must not wait) or sharing (no tenant may crowd out the rest), because the two call for different designs. Separate task queues or separate worker deployments remain the stronger choice when workloads need different hardware, different code versions, different scaling rules or hard isolation for compliance reasons, since priority and fairness only shape ordering inside one pool.

Before relying on either feature, confirm the exact priority range, weighting behavior, default values and how fairness keys are assigned in the current Temporal documentation for your server version and SDK, since these details change between releases. Then test with a realistic mix on a staging pool: load a large batch, add a small set of urgent workflows, and measure schedule-to-start latency for each class. Starvation is the main risk these features address, so treat the test as proof that the urgent path stays fast under the batch, not as a general performance benchmark. Record the settings in your runbook so that operators know why the ordering exists and what to change when a new tenant arrives.

Priority, fairness and separate task queues compared

This table compares priority within one task queue, fairness across keys or tenants within one task queue, and dedicated task queues or worker pools. Read each column as a separate option, then match the row that answers your question to the separation you need. The main takeaway is that only dedicated queues or pools give hard isolation, while priority and fairness shape order without reserving capacity.

AspectPriority within one task queueFairness within one task queueDedicated task queues or worker pools
What it controlsRelative order in which tasks on the same queue are dispatched to workers, set per workflow or activityShare of dispatch that each fairness key (such as a tenant) receives when keys compete for the same queueWhich workers are able to pick up a given task, by routing work to a separate queue name served by a separate pool
What it does not guaranteeStart times, completion times or a share of capacity; lower-priority work can still wait for long periods under loadPriority ordering between tasks, exact throughput per key, or protection from a single key that saturates the whole poolIsolation of the database, downstream services or host resources if pools share them; a queue split does not cap total load
Operational costOne setting in workflow or activity options; needs a shared convention for priority levels across teams and SDK versionsFairness weights and keys must be designed and monitored; behavior should be validated under realistic load before relying on itSeparate worker deployments, scaling rules, alerts and versioning per pool; more capacity to plan and more places to fail
Fits whenUrgent work must jump ahead of routine work on a shared pool and occasional delay of the routine work is acceptableOne tenant or customer batch could otherwise crowd out others and you want a proportional share without splitting infrastructureA workload has hard latency, compliance, data locality or resource needs, or an SLA that a shared pool cannot meet
Confirm for your SDKCheck the priority and fairness option names, value ranges and whether they apply to workflow tasks, activity tasks or both in your SDK versionCheck whether fairness is available for your server version and SDK, and how weights are configured and documentedCheck worker options, task queue naming and routing in your SDK, and the Temporal guidance on queue partitions before splitting

How a shared task queue decides which task runs next

The diagram starts where workflows schedule activities onto a shared task queue. Before a worker polls for the next task, the queue considers each task's priority and then its fairness settings. Only then does a worker take the task and run it. Work routed to a dedicated task queue follows a separate path to its own workers and does not compete in the shared pool. When you design a queue, check in the Temporal docs how priority and fairness interact for your SDK and server version, and confirm that dedicated queues are used only where isolation is required.

Shared queue dispatch considers priority and fairness before a worker takes a task.

Choosing a design by tenant, batch and urgency situation

Urgent operational workflows, such as a same-day refund correction or an incident runbook, can share a worker pool with a large backfill when priority keeps urgent tasks ahead of queued backfill tasks. The starter for each path sets the priority on the workflow or activity options, so the backfill is always tagged lower than the urgent path. (Illustrative example: an overnight reconciliation backfill running beside a same-day refund workflow.)

  • Setting: Task queue priority on each workflow or activity start, with the backfill assigned a lower level than the urgent path.
  • Workflow code: Build start options through one shared helper so every backfill starter sets the priority, and add a test that fails when the value is missing.
  • Monitor: Schedule-to-start latency for the urgent activity types, plus the backlog depth and oldest task age for the backfill.
  • Move to a dedicated pool when: the urgent work has a latency target that a shared pool cannot hold during backfill peaks, or the backfill needs different hardware, network paths or secrets.

Load test the urgent path with a backfill running at full volume before you rely on priority alone.

Configuring priority and fairness on a shared task queue

This sequence takes a shared Temporal worker pool from a single first-in, first-out queue to one where urgent work is scheduled ahead of bulk work and no single tenant or batch can starve the others. Each step ends with a check you can run before moving on.

  1. Confirm server and SDK support for priority and fairness

    The platform team checks the Temporal Server version and the SDK version used by each worker language against the official documentation for task queue priority and fairness. Confirm whether the feature is available on your server minor line, whether it is enabled by default or behind a dynamic configuration setting, and whether your self-hosted deployment or Temporal Cloud namespace exposes it. Upgrade the server first if needed, following the one-minor-version-at-a-time path in the upgrade guide. Done when a test workflow on a development namespace accepts the priority and fairness settings without error and the worker logs show them being read.

  2. Decide the priority scheme and fairness key

    Product owners and platform engineers agree on the priority levels that matter, such as urgent customer-facing work, standard work and bulk or backfill work, and map each workflow type to one level. Choose the fairness key that identifies who should share capacity fairly, usually a tenant, customer or batch identifier, and confirm that every workflow in the queue can supply it. Write down what happens to work with no key or no explicit priority. Done when the scheme fits on one page, every workflow type has an owner and a level, and the team agrees on the default for unlabeled work.

  3. Set priority and fairness where workflows start

    Application developers set the chosen priority and fairness values on workflow start options, and on activity options where a specific activity needs a different level, using the exact field names from the SDK reference for your language. Keep the mapping in one shared module or constants file so that callers cannot invent new values. Check that child workflows and continue-as-new calls inherit or set the values you expect, since this differs by SDK and should be confirmed in the docs. Done when a unit or integration test starts one workflow of each class and reads back the stored values from the execution.

  4. Align worker configuration with the scheme

    Platform engineers review the worker concurrency, poller and slot settings for the shared task queue, since priority only changes the order in which available slots take work. Confirm that the worker pool has enough capacity that urgent work is not blocked by long-running bulk activities, and confirm the settings against your measured resource use rather than defaults. Record which worker deployment handles which queue so that rollouts do not silently change behavior. Done when the configuration review is written down and each worker pool's slot limits match the load profile you will test.

  5. Load test a mixed workload with a representative batch

    The performance owner builds a test that mixes urgent, standard and bulk workflows at the proportions you expect in production, including a large batch run by one fairness key alongside smaller traffic from other keys. Use a staging namespace on infrastructure that matches production sizing as closely as you can, and record the workload shape so the test can be repeated after changes. Run the test with priority and fairness enabled and again with the old settings for comparison. Done when you have two recorded runs with the same input and the team can explain any difference in queue wait between them.

  6. Verify with metrics that urgent work waits less

    The operations team reads schedule-to-start latency and task queue backlog metrics for each priority level and each fairness key during the test, and compares them. Confirm that urgent work shows lower wait than bulk work under contention, and that no fairness key stays starved for longer than the team agreed during the design step. Add a dashboard panel for these values before production use, since the alerting work depends on them. Done when the metrics show the expected ordering in the test and the results are attached to the change record.

  7. Roll out and confirm in production

    Platform and application owners enable the new values in production in stages, starting with a low-risk workflow type and a limited set of tenants or batches, and watch the same latency and backlog metrics as the test. Confirm that existing running workflows keep the settings they started with, and that new starts carry the expected values. Keep the previous configuration available for rollback until the team has observed a full normal business cycle. Done when production metrics match the staging results and the rollout plan is closed by the owners.

Security and operational controls for shared queues

A shared Temporal worker pool gives several tenants and workloads one set of workers, one server and one queue design. The cards below cover the places where that sharing can leak data, let one workload crowd out another, or let the wrong person raise a workflow's priority, and what to confirm before production.

Tenant data through shared workers and payloads

Workers that serve several tenants can hold each tenant's workflow inputs, activity results and secrets in memory at the same time. Workflow payloads are stored in the persistence layer in readable form unless you add a custom payload codec. Confirm which namespaces map to which tenants, whether payloads are encrypted per tenant, and who can read the Web UI and history.

Self-hosted security docs

Noisy tenant under misconfigured fairness

Fairness is meant to stop one tenant or batch from starving the others, but it only helps when each tenant's work is tagged with a fairness key and weight that match your intent. A batch job submitted without those settings can still occupy the queue. Test with a deliberate burst from one tenant and watch schedule-to-start latency for the others before you rely on the setting.

Who can start high-priority workflows

Priority is only as trustworthy as the caller allowed to set it. Without an Authorizer, self-hosted Temporal uses a no-op authorizer that allows every API request. Configure an Authorizer and a ClaimMapper so that JWT or certificate claims map to namespace roles, and limit which roles may start workflows at high priority.

Authorization controls

Audit of who set priority

A priority value recorded on a workflow tells you what was requested, not who requested it. Log the identity behind each start call, including the claims that were mapped to a role, and keep that record alongside workflow history. Confirm with your auditors which events must be retained and where they are stored, since Temporal does not decide that for you.

Temporal services on private networks

Temporal's deployment guidance says its services should run on hosts that are not reachable from the public internet, with network access limited to trusted internal networks. Apply that to the frontend, the internode traffic and the persistence and visibility stores. Enable mTLS between services, and confirm that only your worker and client networks can reach the frontend port.

Deployment guidance

What to confirm before relying on priority and fairness in production

Treat priority and fairness as features to verify on your exact stack, not as defaults you can assume. Start with versions: confirm that the Temporal Server release you run, the frontend and matching services, and the SDK and language runtime in each worker all support the priority and fairness options you plan to set on the task queues. Support can differ between server minor lines and between SDKs, and a worker that does not understand a setting will not enforce it. Check the current release notes for each component rather than relying on the version you saw in a tutorial, and record the results in your change ticket so an upgrade or SDK bump triggers a retest.

Next, confirm how priority interacts with the other limits in your environment. Priority orders tasks that are waiting on a queue, but it cannot make a worker faster. If worker slots are exhausted, high-priority tasks still wait behind running work, and if a rate limit on the queue or namespace is reached, the throttle applies regardless of priority. Also confirm how fairness behaves under a sustained flood from one tenant or batch: fairness is designed to share dispatch across keys, but the size of the share, the behavior during a long backlog, and the effect on tasks that have already been dispatched all need to be measured on your own workload. Watch schedule-to-start latency per priority level, slot utilization, poller counts, and backlog age on each queue. If you use the Worker Controller, versioned workers, or task routing to specific hosts, repeat the test on each路由 path, because a task that is pinned to a small pool can starve even when the shared pool looks healthy.

Testing under your own load is the only reliable way to confirm ordering and latency behavior. Build a load profile that mirrors production mix, including a burst from a single tenant, a long batch backfill, and a steady stream of urgent work, and measure the schedule-to-start distribution for each class. Run the same profile after every server upgrade, SDK change, or worker configuration change, and keep the results with the runbook. If a number in your results does not match what you expected, treat it as a finding to resolve before go-live, not as noise. For vendor-specific details, confirm current behavior with Temporal directly and in your own environment.

Questions teams ask about Temporal priority and fairness

What drives the cost of work on Temporal priority and fairness?

The cost follows the number of task queues, workloads and tenants sharing the worker pool, plus how well the current workflow design already separates urgent and batch work. Most engagements are fixed-scope, so the written scope sets the quote, and DeployOpen does not publish a price list. The cost components are design work (which workloads get which priority and which tenants need fairness protection), configuration and worker changes in each language runtime, load tests that show whether urgent work moves ahead under pressure, and runbook updates for operators. Design and first rollout are one-time costs. Monitoring and retesting recur whenever new tenants or batch sources join the pool. When you ask for a quote, request the list of queues and workloads in scope, the SDK languages involved, whether load testing is included, and the handover documentation you will receive.

How long does a scoped Temporal priority and fairness engagement take?

No duration is fixed in advance, because the length depends on the scope you agree in writing before work starts. The main drivers are the number of task queues, the number of distinct workloads that need different priority levels, how many tenants or batch sources need fairness protection, and how many worker languages and deployments are involved. A single queue with one clear urgent class is a much smaller job than a shared pool serving many tenants across several SDKs. Also count the time your change approval process needs for worker configuration changes, and the load test windows you can get in staging. Ask for the timeline split into design, build, test and rollout phases, with the dependencies on your side listed. Illustrative: a pool with two queues and one batch feed usually scopes smaller than one with a dozen tenants across three runtimes.

What does our team need to provide for this work?

Expect to provide access, people who know the workloads, and a staging environment that resembles production. Specifically, you need a named owner for each workflow type and its business priority, engineers who can change worker code and deployment manifests in each language runtime, access to the Temporal namespace and metrics so the results can be measured, and a window for load tests that create representative queue pressure. You also need agreement on which work is urgent, what counts as a starved tenant, and what latency each class must meet. Those answers come from your business owners and cannot be inferred from the code alone. Ask for a written list of inputs at the start of scope so gaps surface before build time is spent. Operations staff should join the rollout so they can read the new metrics and respond to alerts after handover.

Can our own engineering team set up Temporal priority and fairness alone?

Yes, a team with strong Temporal experience can do this alone, provided it has time to test under load and someone accountable for the design decisions. The hard part is rarely the setting itself. It is deciding which work deserves priority, how to group tenants for fairness, and proving the behavior under contention before production traffic arrives. An in-house team usually needs to read the Temporal documentation for the server version it runs, build a test harness that generates a representative mix of urgent and batch work, and document the results for operators. A partner is useful when the team is small, when many SDKs are involved, or when the change must pass a formal review. DeployOpen can take on the design, build and test work under a written scope, or review your design as a second opinion. Whichever route you choose, confirm the feature behavior against the documentation for your server version first.

Does task queue priority replace separate worker deployments for each tenant?

Priority and fairness let one shared worker pool serve urgent and batch work, but they do not settle every isolation question on their own. Separate deployments still make sense when tenants need different security boundaries, data residency, credentials or release schedules. Shared pools also share failure domains, so a bad deployment or a memory-heavy activity can affect every tenant on that pool. Illustrative: a healthcare team might keep regulated workloads in their own namespace and worker fleet while using fairness only for internal batch jobs. Before choosing, list your isolation requirements and check them against the Temporal documentation for your version, including how namespaces, task queues and worker options interact. That check determines which controls you can rely on and which ones you need to supplement with separate infrastructure.

How do Temporal server upgrades affect priority and fairness settings?

Upgrades can change how queue behavior is configured and observed, so every upgrade needs a retest of your priority and fairness settings. Temporal's upgrade guidance says to move one minor version at a time, going to the latest patch of the current minor first, because backward compatibility is guaranteed only between two successive minor versions. It also says schema upgrades run before server upgrades when release notes call for them. For this topic, check each release's notes for changes to task queue behavior, confirm SDK compatibility with the new server, and decide whether worker versions must move in step. Keep the priority and fairness configuration in version control so it can be applied to a test cluster. Add a load test to the upgrade checklist and run it before each production step. The Temporal upgrade guide is the natural starting point.

What goes wrong when priority or fairness is configured badly?

The usual failures are urgent work waiting behind batch work, one tenant still starving others, and gains in one place that cost latency elsewhere. Watch for rising schedule-to-start latency in the urgent class, a single tenant keeping workers saturated, worker slots filling with low-priority tasks, and surprises after a deployment changes worker concurrency. Another common mistake is expecting fairness to fix an undersized pool. If the pool is too small, priority only decides who waits longer. Test by running a representative batch load alongside a small urgent stream and measuring each class separately. Alert on the urgent class's latency rather than the pool average, and keep a runbook that tells operators how to pause a batch source before paging engineers. Confirm which metrics your Temporal version exposes before writing alert rules.

How DeployOpen scopes and delivers Temporal priority and fairness work

DeployOpen plans Temporal task queue priority and fairness as part of a written, fixed-scope engagement, so the queues, workers and workflow code are agreed before anything changes. The work is built and tested inside your own infrastructure, then handed over with documentation and an operating model your team can run.

How we scope

  • Inventory every workflow type, task queue and tenant or batch source that will share the worker pool
  • Agree which work is urgent, which is bulk, and what starvation looks like for each group
  • Record the Temporal Server deployment, namespaces and worker languages in scope before any build starts
  • Confirm the written scope, deliverables and timeline with your team in writing before work begins

How we build

  • Configure task queue priority and fairness settings in a non-production namespace that mirrors production
  • Test starvation scenarios with mixed urgent and bulk load, and record how each queue drains under pressure
  • Review workflow and activity code for changes that affect ordering, retries and idempotency
  • Keep configuration as code so each change to priority or fairness is reviewed and versioned

How we hand over

  • Deliver a runbook describing each priority level, its intended use and who may submit work at it
  • Document the load tests, their results and the settings that were chosen and why
  • Provide a checklist for adding a new tenant or batch job without breaking existing fairness guarantees
  • Walk your platform and engineering teams through the design and the operating procedures

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover
  • Retest priority and fairness behavior after Temporal Server upgrades and worker changes
  • Review new tenants, batch jobs and queue growth against the agreed design
  • Ask for a quote based on the written scope, since DeployOpen does not publish a price list

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.