Skip to content

Commit c3c6bd7

Browse files
rkannan82claude
authored andcommitted
Add attributes needed by server to propagate control tasks to worker (#711)
<!-- Describe what has changed in this PR --> **What changed?** Added worker_control_task_queue to poll requests: - PollActivityTaskQueueRequest - PollWorkflowTaskQueueRequest Note: worker_instance_key was already added to these requests in #686. Added worker_instance_key and worker_control_task_queue to: - RespondWorkflowTaskCompletedRequest: This API is used to eagerly fetch activity. <!-- Tell your future self why have you made these changes --> **Why?** To enable server to send control tasks to worker. Each worker provides a worker_control_task_queue (a dedicated per-worker Nexus task queue) so the server can send control tasks directly to it. Example flow: - User cancels a workflow. - Server sends activity cancellation tasks to all workers that could be processing activities belonging to that workflow. - Worker will receive the cancellation message even when activity heartbeat is not enabled. <!-- Are there any breaking changes on binary or code level? --> Breaking changes: None [Server PR](temporalio/temporal#9231) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0393ada commit c3c6bd7

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

temporal/api/workflowservice/v1/request_response.proto

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,11 @@ message PollWorkflowTaskQueueRequest {
265265
// A unique key for this worker instance, used for tracking worker lifecycle.
266266
// This is guaranteed to be unique, whereas identity is not guaranteed to be unique.
267267
string worker_instance_key = 8;
268+
269+
// A dedicated per-worker Nexus task queue on which the server sends control
270+
// tasks (e.g. activity cancellation) to this specific worker instance.
271+
string worker_control_task_queue = 9;
272+
268273
// Deprecated. Use deployment_options instead.
269274
// Each worker process should provide an ID unique to the specific set of code it is running
270275
// "checksum" in this field name isn't very accurate, it should be though of as an id.
@@ -385,6 +390,14 @@ message RespondWorkflowTaskCompletedRequest {
385390
// Worker deployment options that user has set in the worker.
386391
temporal.api.deployment.v1.WorkerDeploymentOptions deployment_options = 17;
387392

393+
// A unique key for this worker instance, used for tracking worker lifecycle.
394+
// This is guaranteed to be unique, whereas identity is not guaranteed to be unique.
395+
string worker_instance_key = 19;
396+
397+
// A dedicated per-worker Nexus task queue on which the server sends control
398+
// tasks (e.g. activity cancellation) to this specific worker instance.
399+
string worker_control_task_queue = 20;
400+
388401
// SDK capability details.
389402
message Capabilities {
390403
// True if the SDK can handle speculative workflow task with command events. If true, the
@@ -450,6 +463,11 @@ message PollActivityTaskQueueRequest {
450463
// A unique key for this worker instance, used for tracking worker lifecycle.
451464
// This is guaranteed to be unique, whereas identity is not guaranteed to be unique.
452465
string worker_instance_key = 8;
466+
467+
// A dedicated per-worker Nexus task queue on which the server sends control
468+
// tasks (e.g. activity cancellation) to this specific worker instance.
469+
string worker_control_task_queue = 9;
470+
453471
temporal.api.taskqueue.v1.TaskQueueMetadata task_queue_metadata = 4;
454472
// Information about this worker's build identifier and if it is choosing to use the versioning
455473
// feature. See the `WorkerVersionCapabilities` docstring for more.

0 commit comments

Comments
 (0)