Skip to content

Commit ed408d0

Browse files
jpvottaclaude
andcommitted
Fold in Inheritance and active-backlog subsections
Merges content from PR #4501 (inheritance precedence chains for Priority fields including fairness_key and fairness_weight) and PR #4504 (Enabling or disabling Fairness with an active backlog) into this PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9258681 commit ed408d0

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

docs/develop/task-queue-priority-fairness.mdx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,34 @@ When you use Priority and Fairness together, Priority determines which "sub-queu
524524
alt="High-level of how priority and fairness work together"
525525
/>
526526

527+
### Inheritance
528+
529+
Each field of Priority (`priority_key`, `fairness_key`, `fairness_weight`) is resolved independently.
530+
531+
**Activity inheritance order** (highest precedence first):
532+
533+
1. [Fairness weight overrides](#fairness-weight-overrides) on the Task Queue (`fairness_weight` only)
534+
2. Value set explicitly in the Activity options
535+
3. Inherited from the calling Workflow
536+
4. Default value (`priority_key=3`, `fairness_key=""`, `fairness_weight=1.0`)
537+
538+
**Workflow inheritance order** (highest precedence first):
539+
540+
1. [Fairness weight overrides](#fairness-weight-overrides) on the Task Queue (`fairness_weight` only)
541+
2. Value set explicitly in the Workflow start options
542+
3. Inherited from the parent Workflow (Child Workflows only)
543+
4. Default value (`priority_key=3`, `fairness_key=""`, `fairness_weight=1.0`)
544+
545+
Continue-As-New inherits from the current execution unless explicit values are passed.
546+
547+
### Enabling or disabling Fairness with an active backlog
548+
549+
When Fairness is enabled on a Namespace, Task Queues in the Namespace begin honoring fairness keys on Tasks for dispatch ordering. Existing queued Tasks are dispatched first, in their original priority + FIFO order. Fairness keys on Tasks already in the backlog do not retroactively affect their dispatch order.
550+
551+
When Fairness is disabled on a Namespace, Task Queues in the Namespace stop honoring fairness keys for dispatch ordering. The existing fairness-ordered backlog is dispatched first, in its original fairness order. After the backlog drains, Task Queues dispatch in priority + FIFO order.
552+
553+
In both directions, the existing backlog is dispatched before any new Tasks queued under the new mode. New Tasks dispatch only after the backlog fully drains. Tasks are not lost in either transition.
554+
527555
### Set rate limits at the Task Queue level
528556

529557
When you're starting to scale your Temporal Services, you may decide to set [Requests Per Second (RPS)](/references/dynamic-configuration#service-level-rps-limits) limits to test your workload or experiment with provisioning benchmarks. You can set the RPS limit at the Task Queue level with `queue-rps-limit` in the CLI.

0 commit comments

Comments
 (0)