From 22ab5e708e6b6eef9d9b82c58c1540829656e208 Mon Sep 17 00:00:00 2001 From: Kannan Rajah Date: Wed, 14 Jan 2026 13:57:49 -0800 Subject: [PATCH 01/14] Add worker control task protos for activity cancellation Add WorkerControlTasks, WorkerControlTask, and CancelActivityTask to worker/v1/message.proto for pushing control messages to workers via Nexus control queue. --- temporal/api/worker/v1/message.proto | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/temporal/api/worker/v1/message.proto b/temporal/api/worker/v1/message.proto index 3df3aaa33..ec39722c0 100644 --- a/temporal/api/worker/v1/message.proto +++ b/temporal/api/worker/v1/message.proto @@ -11,6 +11,7 @@ option csharp_namespace = "Temporalio.Api.Worker.V1"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; +import "temporal/api/common/v1/message.proto"; import "temporal/api/deployment/v1/message.proto"; import "temporal/api/enums/v1/common.proto"; @@ -139,3 +140,29 @@ message PluginInfo { // The version of the plugin, may be empty. string version = 2; } + +// Container for batching multiple control tasks delivered to a worker in one Nexus operation. +message WorkerControlTasks { + repeated WorkerControlTask tasks = 1; +} + +// A single control task for a worker. +message WorkerControlTask { + // Timestamp when this task was created. + google.protobuf.Timestamp create_time = 1; + + oneof task { + CancelActivityTask cancel_activity = 2; + } +} + +// Request to cancel running activities on this worker. +message CancelActivityTask { + // The workflow execution that owns the activities. + temporal.api.common.v1.WorkflowExecution workflow_execution = 1; + // The scheduled event IDs of activities to cancel. + // If empty, cancel all activities for this workflow running on this worker. + repeated int64 scheduled_event_ids = 2; + // Human-readable reason for cancellation. + string reason = 3; +} From e9d56b91db9ebc7ae6e2c31593ba788c4d91f6c4 Mon Sep 17 00:00:00 2001 From: Kannan Rajah Date: Tue, 3 Feb 2026 20:25:03 -0800 Subject: [PATCH 02/14] Refactor worker control protos: separate file and use task tokens - Move Nexus command payloads to worker_nexus_service_commands.proto - Rename to CancelActivitiesRequestPayload/ResponsePayload - Use task_tokens instead of workflow_execution + scheduled_event_ids - Add file-level documentation for Nexus conventions --- temporal/api/worker/v1/message.proto | 27 ---------- .../v1/worker_nexus_service_commands.proto | 49 +++++++++++++++++++ 2 files changed, 49 insertions(+), 27 deletions(-) create mode 100644 temporal/api/worker/v1/worker_nexus_service_commands.proto diff --git a/temporal/api/worker/v1/message.proto b/temporal/api/worker/v1/message.proto index ec39722c0..3df3aaa33 100644 --- a/temporal/api/worker/v1/message.proto +++ b/temporal/api/worker/v1/message.proto @@ -11,7 +11,6 @@ option csharp_namespace = "Temporalio.Api.Worker.V1"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; -import "temporal/api/common/v1/message.proto"; import "temporal/api/deployment/v1/message.proto"; import "temporal/api/enums/v1/common.proto"; @@ -140,29 +139,3 @@ message PluginInfo { // The version of the plugin, may be empty. string version = 2; } - -// Container for batching multiple control tasks delivered to a worker in one Nexus operation. -message WorkerControlTasks { - repeated WorkerControlTask tasks = 1; -} - -// A single control task for a worker. -message WorkerControlTask { - // Timestamp when this task was created. - google.protobuf.Timestamp create_time = 1; - - oneof task { - CancelActivityTask cancel_activity = 2; - } -} - -// Request to cancel running activities on this worker. -message CancelActivityTask { - // The workflow execution that owns the activities. - temporal.api.common.v1.WorkflowExecution workflow_execution = 1; - // The scheduled event IDs of activities to cancel. - // If empty, cancel all activities for this workflow running on this worker. - repeated int64 scheduled_event_ids = 2; - // Human-readable reason for cancellation. - string reason = 3; -} diff --git a/temporal/api/worker/v1/worker_nexus_service_commands.proto b/temporal/api/worker/v1/worker_nexus_service_commands.proto new file mode 100644 index 000000000..d4903d504 --- /dev/null +++ b/temporal/api/worker/v1/worker_nexus_service_commands.proto @@ -0,0 +1,49 @@ +syntax = "proto3"; + +package temporal.api.worker.v1; + +option go_package = "go.temporal.io/api/worker/v1;worker"; +option java_package = "io.temporal.api.worker.v1"; +option java_multiple_files = true; +option java_outer_classname = "WorkerNexusServiceCommandsProto"; +option ruby_package = "Temporalio::Api::Worker::V1"; +option csharp_namespace = "Temporalio.Api.Worker.V1"; + +// (-- +///////////////////////////////////////////////////////////////////// +// This file contains: +// - Conventions between server and worker. +// - Definitions for commands and payloads for server-worker communication via Nexus +// +// COMMUNICATION PROTOCOL: +// - Transport: Nexus tasks on task queue +// - Server identifier: "sys-worker-service" +// - Task queue: /temporal-sys/worker-commands/{namespace}/{worker_grouping_key} +// +// WORKER COMMANDS CONVENTIONS: +// +// - Worker commands are used to manage worker configurations, operations, etc. +// - Command names should match names defined in the server API. +// - Command names are provided in StartOperationRequest.Operation field. +// +// PAYLOAD CONVENTIONS: +// +// - In/out payloads namings follow the same convention as the regular API: +// - CommandNameRequest (input payload) +// - CommandNameResponse (output payload). +// - Empty payload if response is not needed/not expected +// +// --) + +// Request payload for the "cancel-activities" Nexus operation. +message CancelActivitiesRequestPayload { + // Task tokens identifying the activities to cancel. + // Each token corresponds to a specific activity task that the worker received. + repeated bytes task_tokens = 1; +} + +// Response payload for the "cancel-activities" Nexus operation. +message CancelActivitiesResponsePayload { + // Empty for now. Can be extended to include cancellation status per activity. +} + From 1643b184347436a48d9a8b4a2f275cdee783777a Mon Sep 17 00:00:00 2001 From: Kannan Rajah Date: Wed, 11 Feb 2026 16:44:15 -0800 Subject: [PATCH 03/14] Rename proto and Nexus service name --- temporal/api/worker/v1/worker_nexus_service_commands.proto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/temporal/api/worker/v1/worker_nexus_service_commands.proto b/temporal/api/worker/v1/worker_nexus_service_commands.proto index d4903d504..16b00c13b 100644 --- a/temporal/api/worker/v1/worker_nexus_service_commands.proto +++ b/temporal/api/worker/v1/worker_nexus_service_commands.proto @@ -17,7 +17,7 @@ option csharp_namespace = "Temporalio.Api.Worker.V1"; // // COMMUNICATION PROTOCOL: // - Transport: Nexus tasks on task queue -// - Server identifier: "sys-worker-service" +// - Service name: "temporal.api.worker.v1.WorkerService" // - Task queue: /temporal-sys/worker-commands/{namespace}/{worker_grouping_key} // // WORKER COMMANDS CONVENTIONS: @@ -36,14 +36,14 @@ option csharp_namespace = "Temporalio.Api.Worker.V1"; // --) // Request payload for the "cancel-activities" Nexus operation. -message CancelActivitiesRequestPayload { +message CancelActivitiesRequest { // Task tokens identifying the activities to cancel. // Each token corresponds to a specific activity task that the worker received. repeated bytes task_tokens = 1; } // Response payload for the "cancel-activities" Nexus operation. -message CancelActivitiesResponsePayload { +message CancelActivitiesResponse { // Empty for now. Can be extended to include cancellation status per activity. } From c5a0a89986f1350c97fe1540c8f153b0fd1f1196 Mon Sep 17 00:00:00 2001 From: Kannan Rajah Date: Thu, 12 Feb 2026 10:45:51 -0800 Subject: [PATCH 04/14] Add Nexus service definition for worker commands Adds a nexusrpc.yaml file defining the temporal.api.worker.v1.WorkerService for server-to-worker communication via Nexus. Uses $goRef to reference proto-generated types. --- .../worker/v1/worker_service.nexusrpc.yaml | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 temporal/api/worker/v1/worker_service.nexusrpc.yaml diff --git a/temporal/api/worker/v1/worker_service.nexusrpc.yaml b/temporal/api/worker/v1/worker_service.nexusrpc.yaml new file mode 100644 index 000000000..d451b689f --- /dev/null +++ b/temporal/api/worker/v1/worker_service.nexusrpc.yaml @@ -0,0 +1,25 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nexus-rpc/nexus-rpc-gen/main/schemas/nexus-rpc-gen.json +# +# Nexus service definition for server-to-worker communication. +# See worker_nexus_service_commands.proto for protocol details and conventions. +# +# Task queue format: /temporal-sys/worker-commands/{namespace}/{worker_grouping_key} + +nexusrpc: 1.0.0 + +services: + temporal.api.worker.v1.WorkerService: + description: > + Internal Nexus service for server-to-worker communication. + Used by the Temporal server to send commands to workers. + operations: + cancel-activities: + description: > + Cancels running activities on a worker. The server sends this when + activities need to be cancelled (e.g., workflow cancellation or + explicit activity cancellation). + input: + $goRef: "go.temporal.io/api/worker/v1.CancelActivitiesRequest" + output: + $goRef: "go.temporal.io/api/worker/v1.CancelActivitiesResponse" + From 6f53c224beb149e528f19b5c778c4acc2394a275 Mon Sep 17 00:00:00 2001 From: Kannan Rajah Date: Thu, 12 Feb 2026 10:50:01 -0800 Subject: [PATCH 05/14] Simplify proto comments, reference YAML for service definition --- .../v1/worker_nexus_service_commands.proto | 27 +++---------------- 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/temporal/api/worker/v1/worker_nexus_service_commands.proto b/temporal/api/worker/v1/worker_nexus_service_commands.proto index 16b00c13b..0976ee884 100644 --- a/temporal/api/worker/v1/worker_nexus_service_commands.proto +++ b/temporal/api/worker/v1/worker_nexus_service_commands.proto @@ -10,40 +10,19 @@ option ruby_package = "Temporalio::Api::Worker::V1"; option csharp_namespace = "Temporalio.Api.Worker.V1"; // (-- -///////////////////////////////////////////////////////////////////// -// This file contains: -// - Conventions between server and worker. -// - Definitions for commands and payloads for server-worker communication via Nexus -// -// COMMUNICATION PROTOCOL: -// - Transport: Nexus tasks on task queue -// - Service name: "temporal.api.worker.v1.WorkerService" -// - Task queue: /temporal-sys/worker-commands/{namespace}/{worker_grouping_key} -// -// WORKER COMMANDS CONVENTIONS: -// -// - Worker commands are used to manage worker configurations, operations, etc. -// - Command names should match names defined in the server API. -// - Command names are provided in StartOperationRequest.Operation field. -// -// PAYLOAD CONVENTIONS: -// -// - In/out payloads namings follow the same convention as the regular API: -// - CommandNameRequest (input payload) -// - CommandNameResponse (output payload). -// - Empty payload if response is not needed/not expected +// Internal Nexus service for server-to-worker communication. +// See worker_service.nexusrpc.yaml for the service definition. // +// Task queue format: /temporal-sys/worker-commands/{namespace}/{worker_grouping_key} // --) // Request payload for the "cancel-activities" Nexus operation. message CancelActivitiesRequest { // Task tokens identifying the activities to cancel. - // Each token corresponds to a specific activity task that the worker received. repeated bytes task_tokens = 1; } // Response payload for the "cancel-activities" Nexus operation. message CancelActivitiesResponse { - // Empty for now. Can be extended to include cancellation status per activity. } From 6c21af480457b4650a545aa5b92d4c2723e5b9f2 Mon Sep 17 00:00:00 2001 From: Kannan Rajah Date: Thu, 12 Feb 2026 11:42:59 -0800 Subject: [PATCH 06/14] Move task queue format to YAML, keep proto minimal --- temporal/api/worker/v1/worker_nexus_service_commands.proto | 2 -- 1 file changed, 2 deletions(-) diff --git a/temporal/api/worker/v1/worker_nexus_service_commands.proto b/temporal/api/worker/v1/worker_nexus_service_commands.proto index 0976ee884..b6a450113 100644 --- a/temporal/api/worker/v1/worker_nexus_service_commands.proto +++ b/temporal/api/worker/v1/worker_nexus_service_commands.proto @@ -12,8 +12,6 @@ option csharp_namespace = "Temporalio.Api.Worker.V1"; // (-- // Internal Nexus service for server-to-worker communication. // See worker_service.nexusrpc.yaml for the service definition. -// -// Task queue format: /temporal-sys/worker-commands/{namespace}/{worker_grouping_key} // --) // Request payload for the "cancel-activities" Nexus operation. From 8506d65c28123f6ba4d5198e68ae11f0c2d16a4c Mon Sep 17 00:00:00 2001 From: Kannan Rajah Date: Fri, 27 Feb 2026 14:21:24 -0800 Subject: [PATCH 07/14] Use WorkerCommandsRequest with oneof for extensibility Change from CancelActivitiesRequest to WorkerCommandsRequest with repeated WorkerCommand using oneof type. This allows adding new command types without changing the Nexus operation. - Rename operation: cancel-activities -> execute-commands - Request: WorkerCommandsRequest with WorkerCommand.CancelActivity - Response: WorkerCommandsResponse with WorkerCommandResult.CancelActivityResult Made-with: Cursor --- .../v1/worker_nexus_service_commands.proto | 31 +++++++++++++++---- .../worker/v1/worker_service.nexusrpc.yaml | 12 +++---- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/temporal/api/worker/v1/worker_nexus_service_commands.proto b/temporal/api/worker/v1/worker_nexus_service_commands.proto index b6a450113..34338b5c1 100644 --- a/temporal/api/worker/v1/worker_nexus_service_commands.proto +++ b/temporal/api/worker/v1/worker_nexus_service_commands.proto @@ -14,13 +14,32 @@ option csharp_namespace = "Temporalio.Api.Worker.V1"; // See worker_service.nexusrpc.yaml for the service definition. // --) -// Request payload for the "cancel-activities" Nexus operation. -message CancelActivitiesRequest { - // Task tokens identifying the activities to cancel. - repeated bytes task_tokens = 1; +// Request payload for the "execute-commands" Nexus operation. +message WorkerCommandsRequest { + repeated WorkerCommand commands = 1; + + message WorkerCommand { + oneof type { + CancelActivity cancel_activity = 1; + } + } + + message CancelActivity { + bytes task_token = 1; + } } -// Response payload for the "cancel-activities" Nexus operation. -message CancelActivitiesResponse { +// Response payload for the "execute-commands" Nexus operation. +message WorkerCommandsResponse { + repeated WorkerCommandResult results = 1; + + message WorkerCommandResult { + oneof type { + CancelActivityResult cancel_activity = 1; + } + } + + message CancelActivityResult { + } } diff --git a/temporal/api/worker/v1/worker_service.nexusrpc.yaml b/temporal/api/worker/v1/worker_service.nexusrpc.yaml index d451b689f..f10d44fe8 100644 --- a/temporal/api/worker/v1/worker_service.nexusrpc.yaml +++ b/temporal/api/worker/v1/worker_service.nexusrpc.yaml @@ -13,13 +13,13 @@ services: Internal Nexus service for server-to-worker communication. Used by the Temporal server to send commands to workers. operations: - cancel-activities: + execute-commands: description: > - Cancels running activities on a worker. The server sends this when - activities need to be cancelled (e.g., workflow cancellation or - explicit activity cancellation). + Executes worker commands sent by the server. Commands include + activity cancellation, and can be extended to support other + worker operations. input: - $goRef: "go.temporal.io/api/worker/v1.CancelActivitiesRequest" + $goRef: "go.temporal.io/api/worker/v1.WorkerCommandsRequest" output: - $goRef: "go.temporal.io/api/worker/v1.CancelActivitiesResponse" + $goRef: "go.temporal.io/api/worker/v1.WorkerCommandsResponse" From 5074e8ad028cdc449b2723ca81b44ecd1f0fe91e Mon Sep 17 00:00:00 2001 From: Kannan Rajah Date: Fri, 27 Feb 2026 14:29:15 -0800 Subject: [PATCH 08/14] Use symmetric CancelActivity naming in request and response Made-with: Cursor --- temporal/api/worker/v1/worker_nexus_service_commands.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/temporal/api/worker/v1/worker_nexus_service_commands.proto b/temporal/api/worker/v1/worker_nexus_service_commands.proto index 34338b5c1..b66442467 100644 --- a/temporal/api/worker/v1/worker_nexus_service_commands.proto +++ b/temporal/api/worker/v1/worker_nexus_service_commands.proto @@ -35,11 +35,11 @@ message WorkerCommandsResponse { message WorkerCommandResult { oneof type { - CancelActivityResult cancel_activity = 1; + CancelActivity cancel_activity = 1; } } - message CancelActivityResult { + message CancelActivity { } } From f06f14928ed0a4b7691eb3c75a759a66079a5e94 Mon Sep 17 00:00:00 2001 From: Kannan Rajah Date: Fri, 27 Feb 2026 14:34:26 -0800 Subject: [PATCH 09/14] Move worker service protos to temporal/api/nexusservices/workerservice/v1 New package: temporal.api.nexusservices.workerservice.v1 Made-with: Cursor --- .../v1/worker_nexus_service_commands.proto | 12 ++++++------ .../workerservice}/v1/worker_service.nexusrpc.yaml | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) rename temporal/api/{worker => nexusservices/workerservice}/v1/worker_nexus_service_commands.proto (65%) rename temporal/api/{worker => nexusservices/workerservice}/v1/worker_service.nexusrpc.yaml (76%) diff --git a/temporal/api/worker/v1/worker_nexus_service_commands.proto b/temporal/api/nexusservices/workerservice/v1/worker_nexus_service_commands.proto similarity index 65% rename from temporal/api/worker/v1/worker_nexus_service_commands.proto rename to temporal/api/nexusservices/workerservice/v1/worker_nexus_service_commands.proto index b66442467..38e67de08 100644 --- a/temporal/api/worker/v1/worker_nexus_service_commands.proto +++ b/temporal/api/nexusservices/workerservice/v1/worker_nexus_service_commands.proto @@ -1,13 +1,13 @@ syntax = "proto3"; -package temporal.api.worker.v1; +package temporal.api.nexusservices.workerservice.v1; -option go_package = "go.temporal.io/api/worker/v1;worker"; -option java_package = "io.temporal.api.worker.v1"; +option go_package = "go.temporal.io/api/nexusservices/workerservice/v1;workerservice"; +option java_package = "io.temporal.api.nexusservices.workerservice.v1"; option java_multiple_files = true; -option java_outer_classname = "WorkerNexusServiceCommandsProto"; -option ruby_package = "Temporalio::Api::Worker::V1"; -option csharp_namespace = "Temporalio.Api.Worker.V1"; +option java_outer_classname = "WorkerServiceCommandsProto"; +option ruby_package = "Temporalio::Api::Nexusservices::Workerservice::V1"; +option csharp_namespace = "Temporalio.Api.Nexusservices.Workerservice.V1"; // (-- // Internal Nexus service for server-to-worker communication. diff --git a/temporal/api/worker/v1/worker_service.nexusrpc.yaml b/temporal/api/nexusservices/workerservice/v1/worker_service.nexusrpc.yaml similarity index 76% rename from temporal/api/worker/v1/worker_service.nexusrpc.yaml rename to temporal/api/nexusservices/workerservice/v1/worker_service.nexusrpc.yaml index f10d44fe8..bf1f7d41c 100644 --- a/temporal/api/worker/v1/worker_service.nexusrpc.yaml +++ b/temporal/api/nexusservices/workerservice/v1/worker_service.nexusrpc.yaml @@ -8,7 +8,7 @@ nexusrpc: 1.0.0 services: - temporal.api.worker.v1.WorkerService: + temporal.api.nexusservices.workerservice.v1.WorkerService: description: > Internal Nexus service for server-to-worker communication. Used by the Temporal server to send commands to workers. @@ -19,7 +19,7 @@ services: activity cancellation, and can be extended to support other worker operations. input: - $goRef: "go.temporal.io/api/worker/v1.WorkerCommandsRequest" + $goRef: "go.temporal.io/api/nexusservices/workerservice/v1.WorkerCommandsRequest" output: - $goRef: "go.temporal.io/api/worker/v1.WorkerCommandsResponse" + $goRef: "go.temporal.io/api/nexusservices/workerservice/v1.WorkerCommandsResponse" From 09ee5c472fecdfc266f3720f9144eca8f7c6fa80 Mon Sep 17 00:00:00 2001 From: Kannan Rajah Date: Fri, 27 Feb 2026 14:34:48 -0800 Subject: [PATCH 10/14] Simplify execute-commands operation description Made-with: Cursor --- .../workerservice/v1/worker_service.nexusrpc.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/temporal/api/nexusservices/workerservice/v1/worker_service.nexusrpc.yaml b/temporal/api/nexusservices/workerservice/v1/worker_service.nexusrpc.yaml index bf1f7d41c..d44948584 100644 --- a/temporal/api/nexusservices/workerservice/v1/worker_service.nexusrpc.yaml +++ b/temporal/api/nexusservices/workerservice/v1/worker_service.nexusrpc.yaml @@ -14,10 +14,7 @@ services: Used by the Temporal server to send commands to workers. operations: execute-commands: - description: > - Executes worker commands sent by the server. Commands include - activity cancellation, and can be extended to support other - worker operations. + description: Executes worker commands sent by the server. input: $goRef: "go.temporal.io/api/nexusservices/workerservice/v1.WorkerCommandsRequest" output: From ab6c53b22d7f7a5603799480a1786fa14242711a Mon Sep 17 00:00:00 2001 From: Kannan Rajah Date: Fri, 27 Feb 2026 14:36:35 -0800 Subject: [PATCH 11/14] Rename proto file to request_response.proto Made-with: Cursor --- ...rker_nexus_service_commands.proto => request_response.proto} | 2 +- .../nexusservices/workerservice/v1/worker_service.nexusrpc.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename temporal/api/nexusservices/workerservice/v1/{worker_nexus_service_commands.proto => request_response.proto} (95%) diff --git a/temporal/api/nexusservices/workerservice/v1/worker_nexus_service_commands.proto b/temporal/api/nexusservices/workerservice/v1/request_response.proto similarity index 95% rename from temporal/api/nexusservices/workerservice/v1/worker_nexus_service_commands.proto rename to temporal/api/nexusservices/workerservice/v1/request_response.proto index 38e67de08..60425ea69 100644 --- a/temporal/api/nexusservices/workerservice/v1/worker_nexus_service_commands.proto +++ b/temporal/api/nexusservices/workerservice/v1/request_response.proto @@ -5,7 +5,7 @@ package temporal.api.nexusservices.workerservice.v1; option go_package = "go.temporal.io/api/nexusservices/workerservice/v1;workerservice"; option java_package = "io.temporal.api.nexusservices.workerservice.v1"; option java_multiple_files = true; -option java_outer_classname = "WorkerServiceCommandsProto"; +option java_outer_classname = "RequestResponseProto"; option ruby_package = "Temporalio::Api::Nexusservices::Workerservice::V1"; option csharp_namespace = "Temporalio.Api.Nexusservices.Workerservice.V1"; diff --git a/temporal/api/nexusservices/workerservice/v1/worker_service.nexusrpc.yaml b/temporal/api/nexusservices/workerservice/v1/worker_service.nexusrpc.yaml index d44948584..5f61e7eb5 100644 --- a/temporal/api/nexusservices/workerservice/v1/worker_service.nexusrpc.yaml +++ b/temporal/api/nexusservices/workerservice/v1/worker_service.nexusrpc.yaml @@ -1,7 +1,7 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/nexus-rpc/nexus-rpc-gen/main/schemas/nexus-rpc-gen.json # # Nexus service definition for server-to-worker communication. -# See worker_nexus_service_commands.proto for protocol details and conventions. +# See request_response.proto for protocol details and conventions. # # Task queue format: /temporal-sys/worker-commands/{namespace}/{worker_grouping_key} From 106652b2fd371f659577936d3b239b2a0449f0aa Mon Sep 17 00:00:00 2001 From: Kannan Rajah Date: Fri, 27 Feb 2026 14:37:19 -0800 Subject: [PATCH 12/14] Rename YAML file to service.yaml Made-with: Cursor --- .../api/nexusservices/workerservice/v1/request_response.proto | 2 +- .../v1/{worker_service.nexusrpc.yaml => service.yaml} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename temporal/api/nexusservices/workerservice/v1/{worker_service.nexusrpc.yaml => service.yaml} (92%) diff --git a/temporal/api/nexusservices/workerservice/v1/request_response.proto b/temporal/api/nexusservices/workerservice/v1/request_response.proto index 60425ea69..c4fcc5f24 100644 --- a/temporal/api/nexusservices/workerservice/v1/request_response.proto +++ b/temporal/api/nexusservices/workerservice/v1/request_response.proto @@ -11,7 +11,7 @@ option csharp_namespace = "Temporalio.Api.Nexusservices.Workerservice.V1"; // (-- // Internal Nexus service for server-to-worker communication. -// See worker_service.nexusrpc.yaml for the service definition. +// See service.yaml for the service definition. // --) // Request payload for the "execute-commands" Nexus operation. diff --git a/temporal/api/nexusservices/workerservice/v1/worker_service.nexusrpc.yaml b/temporal/api/nexusservices/workerservice/v1/service.yaml similarity index 92% rename from temporal/api/nexusservices/workerservice/v1/worker_service.nexusrpc.yaml rename to temporal/api/nexusservices/workerservice/v1/service.yaml index 5f61e7eb5..eac181772 100644 --- a/temporal/api/nexusservices/workerservice/v1/worker_service.nexusrpc.yaml +++ b/temporal/api/nexusservices/workerservice/v1/service.yaml @@ -1,7 +1,7 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/nexus-rpc/nexus-rpc-gen/main/schemas/nexus-rpc-gen.json # # Nexus service definition for server-to-worker communication. -# See request_response.proto for protocol details and conventions. +# See request_response.proto for message definitions. # # Task queue format: /temporal-sys/worker-commands/{namespace}/{worker_grouping_key} From 9f19af6bf464aeb4ff64d1aea40ab5bd33cd1e3a Mon Sep 17 00:00:00 2001 From: Kannan Rajah Date: Fri, 27 Feb 2026 14:44:51 -0800 Subject: [PATCH 13/14] Use camelCase operation name and add multi-language refs - Rename operation: execute-commands -> executeCommands - Add refs for all languages: Go, Java, Python, TypeScript, .NET, Ruby Made-with: Cursor --- .../workerservice/v1/request_response.proto | 4 ++-- .../api/nexusservices/workerservice/v1/service.yaml | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/temporal/api/nexusservices/workerservice/v1/request_response.proto b/temporal/api/nexusservices/workerservice/v1/request_response.proto index c4fcc5f24..01a8cf035 100644 --- a/temporal/api/nexusservices/workerservice/v1/request_response.proto +++ b/temporal/api/nexusservices/workerservice/v1/request_response.proto @@ -14,7 +14,7 @@ option csharp_namespace = "Temporalio.Api.Nexusservices.Workerservice.V1"; // See service.yaml for the service definition. // --) -// Request payload for the "execute-commands" Nexus operation. +// Request payload for the "executeCommands" Nexus operation. message WorkerCommandsRequest { repeated WorkerCommand commands = 1; @@ -29,7 +29,7 @@ message WorkerCommandsRequest { } } -// Response payload for the "execute-commands" Nexus operation. +// Response payload for the "executeCommands" Nexus operation. message WorkerCommandsResponse { repeated WorkerCommandResult results = 1; diff --git a/temporal/api/nexusservices/workerservice/v1/service.yaml b/temporal/api/nexusservices/workerservice/v1/service.yaml index eac181772..ad42b3bba 100644 --- a/temporal/api/nexusservices/workerservice/v1/service.yaml +++ b/temporal/api/nexusservices/workerservice/v1/service.yaml @@ -13,10 +13,20 @@ services: Internal Nexus service for server-to-worker communication. Used by the Temporal server to send commands to workers. operations: - execute-commands: + executeCommands: description: Executes worker commands sent by the server. input: $goRef: "go.temporal.io/api/nexusservices/workerservice/v1.WorkerCommandsRequest" + $javaRef: "io.temporal.api.nexusservices.workerservice.v1.WorkerCommandsRequest" + $pythonRef: "temporalio.api.nexusservices.workerservice.v1.WorkerCommandsRequest" + $typescriptRef: "@temporalio/api/nexusservices/workerservice/v1.WorkerCommandsRequest" + $dotnetRef: "Temporalio.Api.Nexusservices.Workerservice.V1.WorkerCommandsRequest" + $rubyRef: "Temporalio::Api::Nexusservices::Workerservice::V1::WorkerCommandsRequest" output: $goRef: "go.temporal.io/api/nexusservices/workerservice/v1.WorkerCommandsResponse" + $javaRef: "io.temporal.api.nexusservices.workerservice.v1.WorkerCommandsResponse" + $pythonRef: "temporalio.api.nexusservices.workerservice.v1.WorkerCommandsResponse" + $typescriptRef: "@temporalio/api/nexusservices/workerservice/v1.WorkerCommandsResponse" + $dotnetRef: "Temporalio.Api.Nexusservices.Workerservice.V1.WorkerCommandsResponse" + $rubyRef: "Temporalio::Api::Nexusservices::Workerservice::V1::WorkerCommandsResponse" From 32523fb1caf0b409805578565f32e1432bbda5f8 Mon Sep 17 00:00:00 2001 From: Kannan Rajah Date: Fri, 27 Feb 2026 15:05:55 -0800 Subject: [PATCH 14/14] Add documentation --- .../api/nexusservices/workerservice/v1/request_response.proto | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/temporal/api/nexusservices/workerservice/v1/request_response.proto b/temporal/api/nexusservices/workerservice/v1/request_response.proto index 01a8cf035..ef14decbd 100644 --- a/temporal/api/nexusservices/workerservice/v1/request_response.proto +++ b/temporal/api/nexusservices/workerservice/v1/request_response.proto @@ -24,6 +24,7 @@ message WorkerCommandsRequest { } } + // Cancel an activity if it is still running. Otherwise, do nothing. message CancelActivity { bytes task_token = 1; } @@ -39,7 +40,7 @@ message WorkerCommandsResponse { } } + // Treat both successful cancellation and no-op (activity is no longer running) as success. message CancelActivity { } } -