Skip to content

Commit 7df3c3e

Browse files
rkannan82claude
andauthored
Add new task queue kind to send worker commands (#763)
## What Add `TASK_QUEUE_KIND_WORKER_COMMANDS` (value 3) to `TaskQueueKind` enum. ## Why Worker-commands task queues are used for server-to-worker communication (e.g. activity cancellations). They need to be distinguished from user-defined queues so the server can handle them differently in metrics and other areas. SDKs will set this kind when polling worker-commands queues. ## How did you test it? Proto-only change, no runtime behavior yet. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6f298e7 commit 7df3c3e

3 files changed

Lines changed: 17 additions & 6 deletions

File tree

openapi/openapiv2.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,14 +1895,15 @@
18951895
},
18961896
{
18971897
"name": "taskQueue.kind",
1898-
"description": "Default: TASK_QUEUE_KIND_NORMAL.\n\n - TASK_QUEUE_KIND_UNSPECIFIED: Tasks from any non workflow task may be unspecified.\n\nTask queue kind is used to differentiate whether a workflow task queue is sticky or \nnormal. If a task is not a workflow task, Task queue kind will sometimes be \nunspecified.\n - TASK_QUEUE_KIND_NORMAL: Tasks from a normal workflow task queue always include complete workflow history\n\nThe task queue specified by the user is always a normal task queue. There can be as many\nworkers as desired for a single normal task queue. All those workers may pick up tasks from\nthat queue.\n - TASK_QUEUE_KIND_STICKY: A sticky queue only includes new history since the last workflow task, and they are\nper-worker.\n\nSticky queues are created dynamically by each worker during their start up. They only exist\nfor the lifetime of the worker process. Tasks in a sticky task queue are only available to\nthe worker that created the sticky queue.\n\nSticky queues are only for workflow tasks. There are no sticky task queues for activities.",
1898+
"description": "Default: TASK_QUEUE_KIND_NORMAL.\n\n - TASK_QUEUE_KIND_UNSPECIFIED: Tasks from any non workflow task may be unspecified.\n\nTask queue kind is used to differentiate whether a workflow task queue is sticky or \nnormal. If a task is not a workflow task, Task queue kind will sometimes be \nunspecified.\n - TASK_QUEUE_KIND_NORMAL: Tasks from a normal workflow task queue always include complete workflow history\n\nThe task queue specified by the user is always a normal task queue. There can be as many\nworkers as desired for a single normal task queue. All those workers may pick up tasks from\nthat queue.\n - TASK_QUEUE_KIND_STICKY: A sticky queue only includes new history since the last workflow task, and they are\nper-worker.\n\nSticky queues are created dynamically by each worker during their start up. They only exist\nfor the lifetime of the worker process. Tasks in a sticky task queue are only available to\nthe worker that created the sticky queue.\n\nSticky queues are only for workflow tasks. There are no sticky task queues for activities.\n - TASK_QUEUE_KIND_WORKER_COMMANDS: A worker-commands task queue is used for server-to-worker communication (e.g. activity\ncancellations). These queues are ephemeral and per-worker-process — they exist only for\nthe lifetime of the worker process. Used with TASK_QUEUE_TYPE_NEXUS and polled via\nPollNexusTaskQueue.",
18991899
"in": "query",
19001900
"required": false,
19011901
"type": "string",
19021902
"enum": [
19031903
"TASK_QUEUE_KIND_UNSPECIFIED",
19041904
"TASK_QUEUE_KIND_NORMAL",
1905-
"TASK_QUEUE_KIND_STICKY"
1905+
"TASK_QUEUE_KIND_STICKY",
1906+
"TASK_QUEUE_KIND_WORKER_COMMANDS"
19061907
],
19071908
"default": "TASK_QUEUE_KIND_UNSPECIFIED"
19081909
},
@@ -6632,14 +6633,15 @@
66326633
},
66336634
{
66346635
"name": "taskQueue.kind",
6635-
"description": "Default: TASK_QUEUE_KIND_NORMAL.\n\n - TASK_QUEUE_KIND_UNSPECIFIED: Tasks from any non workflow task may be unspecified.\n\nTask queue kind is used to differentiate whether a workflow task queue is sticky or \nnormal. If a task is not a workflow task, Task queue kind will sometimes be \nunspecified.\n - TASK_QUEUE_KIND_NORMAL: Tasks from a normal workflow task queue always include complete workflow history\n\nThe task queue specified by the user is always a normal task queue. There can be as many\nworkers as desired for a single normal task queue. All those workers may pick up tasks from\nthat queue.\n - TASK_QUEUE_KIND_STICKY: A sticky queue only includes new history since the last workflow task, and they are\nper-worker.\n\nSticky queues are created dynamically by each worker during their start up. They only exist\nfor the lifetime of the worker process. Tasks in a sticky task queue are only available to\nthe worker that created the sticky queue.\n\nSticky queues are only for workflow tasks. There are no sticky task queues for activities.",
6636+
"description": "Default: TASK_QUEUE_KIND_NORMAL.\n\n - TASK_QUEUE_KIND_UNSPECIFIED: Tasks from any non workflow task may be unspecified.\n\nTask queue kind is used to differentiate whether a workflow task queue is sticky or \nnormal. If a task is not a workflow task, Task queue kind will sometimes be \nunspecified.\n - TASK_QUEUE_KIND_NORMAL: Tasks from a normal workflow task queue always include complete workflow history\n\nThe task queue specified by the user is always a normal task queue. There can be as many\nworkers as desired for a single normal task queue. All those workers may pick up tasks from\nthat queue.\n - TASK_QUEUE_KIND_STICKY: A sticky queue only includes new history since the last workflow task, and they are\nper-worker.\n\nSticky queues are created dynamically by each worker during their start up. They only exist\nfor the lifetime of the worker process. Tasks in a sticky task queue are only available to\nthe worker that created the sticky queue.\n\nSticky queues are only for workflow tasks. There are no sticky task queues for activities.\n - TASK_QUEUE_KIND_WORKER_COMMANDS: A worker-commands task queue is used for server-to-worker communication (e.g. activity\ncancellations). These queues are ephemeral and per-worker-process — they exist only for\nthe lifetime of the worker process. Used with TASK_QUEUE_TYPE_NEXUS and polled via\nPollNexusTaskQueue.",
66366637
"in": "query",
66376638
"required": false,
66386639
"type": "string",
66396640
"enum": [
66406641
"TASK_QUEUE_KIND_UNSPECIFIED",
66416642
"TASK_QUEUE_KIND_NORMAL",
6642-
"TASK_QUEUE_KIND_STICKY"
6643+
"TASK_QUEUE_KIND_STICKY",
6644+
"TASK_QUEUE_KIND_WORKER_COMMANDS"
66436645
],
66446646
"default": "TASK_QUEUE_KIND_UNSPECIFIED"
66456647
},
@@ -16861,10 +16863,11 @@
1686116863
"enum": [
1686216864
"TASK_QUEUE_KIND_UNSPECIFIED",
1686316865
"TASK_QUEUE_KIND_NORMAL",
16864-
"TASK_QUEUE_KIND_STICKY"
16866+
"TASK_QUEUE_KIND_STICKY",
16867+
"TASK_QUEUE_KIND_WORKER_COMMANDS"
1686516868
],
1686616869
"default": "TASK_QUEUE_KIND_UNSPECIFIED",
16867-
"description": " - TASK_QUEUE_KIND_UNSPECIFIED: Tasks from any non workflow task may be unspecified.\n\nTask queue kind is used to differentiate whether a workflow task queue is sticky or \nnormal. If a task is not a workflow task, Task queue kind will sometimes be \nunspecified.\n - TASK_QUEUE_KIND_NORMAL: Tasks from a normal workflow task queue always include complete workflow history\n\nThe task queue specified by the user is always a normal task queue. There can be as many\nworkers as desired for a single normal task queue. All those workers may pick up tasks from\nthat queue.\n - TASK_QUEUE_KIND_STICKY: A sticky queue only includes new history since the last workflow task, and they are\nper-worker.\n\nSticky queues are created dynamically by each worker during their start up. They only exist\nfor the lifetime of the worker process. Tasks in a sticky task queue are only available to\nthe worker that created the sticky queue.\n\nSticky queues are only for workflow tasks. There are no sticky task queues for activities."
16870+
"description": " - TASK_QUEUE_KIND_UNSPECIFIED: Tasks from any non workflow task may be unspecified.\n\nTask queue kind is used to differentiate whether a workflow task queue is sticky or \nnormal. If a task is not a workflow task, Task queue kind will sometimes be \nunspecified.\n - TASK_QUEUE_KIND_NORMAL: Tasks from a normal workflow task queue always include complete workflow history\n\nThe task queue specified by the user is always a normal task queue. There can be as many\nworkers as desired for a single normal task queue. All those workers may pick up tasks from\nthat queue.\n - TASK_QUEUE_KIND_STICKY: A sticky queue only includes new history since the last workflow task, and they are\nper-worker.\n\nSticky queues are created dynamically by each worker during their start up. They only exist\nfor the lifetime of the worker process. Tasks in a sticky task queue are only available to\nthe worker that created the sticky queue.\n\nSticky queues are only for workflow tasks. There are no sticky task queues for activities.\n - TASK_QUEUE_KIND_WORKER_COMMANDS: A worker-commands task queue is used for server-to-worker communication (e.g. activity\ncancellations). These queues are ephemeral and per-worker-process — they exist only for\nthe lifetime of the worker process. Used with TASK_QUEUE_TYPE_NEXUS and polled via\nPollNexusTaskQueue."
1686816871
},
1686916872
"v1TaskQueueReachability": {
1687016873
"type": "object",

openapi/openapiv3.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,6 +1812,7 @@ paths:
18121812
- TASK_QUEUE_KIND_UNSPECIFIED
18131813
- TASK_QUEUE_KIND_NORMAL
18141814
- TASK_QUEUE_KIND_STICKY
1815+
- TASK_QUEUE_KIND_WORKER_COMMANDS
18151816
type: string
18161817
format: enum
18171818
- name: taskQueue.normalName
@@ -6046,6 +6047,7 @@ paths:
60466047
- TASK_QUEUE_KIND_UNSPECIFIED
60476048
- TASK_QUEUE_KIND_NORMAL
60486049
- TASK_QUEUE_KIND_STICKY
6050+
- TASK_QUEUE_KIND_WORKER_COMMANDS
60496051
type: string
60506052
format: enum
60516053
- name: taskQueue.normalName
@@ -14787,6 +14789,7 @@ components:
1478714789
- TASK_QUEUE_KIND_UNSPECIFIED
1478814790
- TASK_QUEUE_KIND_NORMAL
1478914791
- TASK_QUEUE_KIND_STICKY
14792+
- TASK_QUEUE_KIND_WORKER_COMMANDS
1479014793
type: string
1479114794
description: 'Default: TASK_QUEUE_KIND_NORMAL.'
1479214795
format: enum

temporal/api/enums/v1/task_queue.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ enum TaskQueueKind {
3131
//
3232
// Sticky queues are only for workflow tasks. There are no sticky task queues for activities.
3333
TASK_QUEUE_KIND_STICKY = 2;
34+
// A worker-commands task queue is used for server-to-worker communication (e.g. activity
35+
// cancellations). These queues are ephemeral and per-worker-process — they exist only for
36+
// the lifetime of the worker process. Used with TASK_QUEUE_TYPE_NEXUS and polled via
37+
// PollNexusTaskQueue.
38+
TASK_QUEUE_KIND_WORKER_COMMANDS = 3;
3439
}
3540

3641
enum TaskQueueType {

0 commit comments

Comments
 (0)