From 2b204bb516c0f36b7ba94c6160149b7fc74e88ce Mon Sep 17 00:00:00 2001 From: Yuri Date: Wed, 23 Jul 2025 17:33:54 -0700 Subject: [PATCH 1/8] Add worker commands payloads --- openapi/openapiv2.json | 92 +++++++++++++++++++ openapi/openapiv3.yaml | 74 +++++++++++++++ temporal/api/worker/v1/message.proto | 21 +++++ .../workflowservice/v1/request_response.proto | 3 +- temporal/api/workflowservice/v1/service.proto | 10 ++ 5 files changed, 199 insertions(+), 1 deletion(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 99945c383..016b80b65 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -2455,6 +2455,52 @@ ] } }, + "/api/v1/namespaces/{namespace}/workers/{workerInstanceKey}": { + "get": { + "summary": "DescribeWorker returns information about the specified worker execution.", + "operationId": "DescribeWorker2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DescribeWorkerResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace this worker belongs to.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workerInstanceKey", + "description": "Worker instance key to describe.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "identity", + "description": "The identity of the client who initiated this request.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/workflow-count": { "get": { "summary": "CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace.", @@ -6235,6 +6281,52 @@ ] } }, + "/namespaces/{namespace}/workers/{workerInstanceKey}": { + "get": { + "summary": "DescribeWorker returns information about the specified worker execution.", + "operationId": "DescribeWorker", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DescribeWorkerResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace this worker belongs to.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workerInstanceKey", + "description": "Worker instance key to describe.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "identity", + "description": "The identity of the client who initiated this request.", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/workflow-count": { "get": { "summary": "CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace.", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 82fa0d4db..f9acb3c26 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -2218,6 +2218,43 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workers/{workerInstanceKey}: + get: + tags: + - WorkflowService + description: DescribeWorker returns information about the specified worker execution. + operationId: DescribeWorker + parameters: + - name: namespace + in: path + description: Namespace this worker belongs to. + required: true + schema: + type: string + - name: workerInstanceKey + in: path + description: Worker instance key to describe. + required: true + schema: + type: string + - name: identity + in: query + description: The identity of the client who initiated this request. + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeWorkerResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/workflow-count: get: tags: @@ -5601,6 +5638,43 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workers/{workerInstanceKey}: + get: + tags: + - WorkflowService + description: DescribeWorker returns information about the specified worker execution. + operationId: DescribeWorker + parameters: + - name: namespace + in: path + description: Namespace this worker belongs to. + required: true + schema: + type: string + - name: workerInstanceKey + in: path + description: Worker instance key to describe. + required: true + schema: + type: string + - name: identity + in: query + description: The identity of the client who initiated this request. + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeWorkerResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/workflow-count: get: tags: diff --git a/temporal/api/worker/v1/message.proto b/temporal/api/worker/v1/message.proto index e8a4f1bd3..1940bf5cb 100644 --- a/temporal/api/worker/v1/message.proto +++ b/temporal/api/worker/v1/message.proto @@ -11,8 +11,11 @@ option csharp_namespace = "Temporalio.Api.Worker.V1"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; +import "google/protobuf/field_mask.proto"; + import "temporal/api/deployment/v1/message.proto"; import "temporal/api/enums/v1/common.proto"; +import "temporal/api/sdk/v1/worker_config.proto"; message WorkerPollerInfo { // Number of polling RPCs that are currently in flight. @@ -142,3 +145,21 @@ message PluginInfo { // The version of the plugin, may be empty. string version = 2; } + +// Will be send to the worker as a payload of the FetchWorkerConfig command. +message FetchWorkerConfigCommandPayload { + // Worker identifier, should be unique for the namespace. + string worker_instance_key = 1; +} + +// Will be send to the worker as a payload of the UpdateWorkerConfig command. +message UpdateWorkerConfigCommandPayload { + // Worker identifier, should be unique for the namespace. + string worker_instance_key = 1; + + // The new worker config to be applied. + temporal.api.sdk.v1.WorkerConfig worker_config = 2; + + // Controls which fields from `worker_config` will be applied + google.protobuf.FieldMask update_mask = 3; +} diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index d6c342d54..843849a5a 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2550,4 +2550,5 @@ message DescribeWorkerRequest { message DescribeWorkerResponse { temporal.api.worker.v1.WorkerInfo worker_info = 1; -} \ No newline at end of file +} + diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 4acd6cf15..af995971d 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1236,13 +1236,23 @@ service WorkflowService { }; } +<<<<<<< HEAD // DescribeWorker returns information about the specified worker. rpc DescribeWorker (DescribeWorkerRequest) returns (DescribeWorkerResponse) { option (google.api.http) = { get: "/namespaces/{namespace}/workers/describe/{worker_instance_key}" additional_bindings { get: "/api/v1/namespaces/{namespace}/workers/describe/{worker_instance_key}" +======= + // DescribeWorker returns information about the specified worker execution. + rpc DescribeWorker (DescribeWorkerRequest) returns (DescribeWorkerResponse) { + option (google.api.http) = { + get: "/namespaces/{namespace}/workers/{worker_instance_key}" + additional_bindings { + get: "/api/v1/namespaces/{namespace}/workers/{worker_instance_key}" +>>>>>>> 0aaab48 (Add worker commands payloads) } }; } } + From b27a82ff54a3e15ff3b3ac6a27ac2d3a27ee157d Mon Sep 17 00:00:00 2001 From: Yuri Date: Thu, 24 Jul 2025 09:36:22 -0700 Subject: [PATCH 2/8] work on comments --- openapi/openapiv2.json | 100 ++---------------- openapi/openapiv3.yaml | 74 ------------- temporal/api/worker/v1/message.proto | 2 +- temporal/api/workflowservice/v1/service.proto | 9 -- 4 files changed, 9 insertions(+), 176 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 016b80b65..6b0db1449 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -2298,7 +2298,11 @@ }, "/api/v1/namespaces/{namespace}/workers/describe/{workerInstanceKey}": { "get": { +<<<<<<< HEAD "summary": "DescribeWorker returns information about the specified worker.", +======= + "summary": "DescribeWorker returns information about the specified worker execution.", +>>>>>>> 0afb9d8 (work on comments) "operationId": "DescribeWorker2", "responses": { "200": { @@ -2455,52 +2459,6 @@ ] } }, - "/api/v1/namespaces/{namespace}/workers/{workerInstanceKey}": { - "get": { - "summary": "DescribeWorker returns information about the specified worker execution.", - "operationId": "DescribeWorker2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1DescribeWorkerResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace this worker belongs to.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "workerInstanceKey", - "description": "Worker instance key to describe.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "identity", - "description": "The identity of the client who initiated this request.", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "WorkflowService" - ] - } - }, "/api/v1/namespaces/{namespace}/workflow-count": { "get": { "summary": "CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace.", @@ -6124,7 +6082,11 @@ }, "/namespaces/{namespace}/workers/describe/{workerInstanceKey}": { "get": { +<<<<<<< HEAD "summary": "DescribeWorker returns information about the specified worker.", +======= + "summary": "DescribeWorker returns information about the specified worker execution.", +>>>>>>> 0afb9d8 (work on comments) "operationId": "DescribeWorker", "responses": { "200": { @@ -6281,52 +6243,6 @@ ] } }, - "/namespaces/{namespace}/workers/{workerInstanceKey}": { - "get": { - "summary": "DescribeWorker returns information about the specified worker execution.", - "operationId": "DescribeWorker", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1DescribeWorkerResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace this worker belongs to.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "workerInstanceKey", - "description": "Worker instance key to describe.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "identity", - "description": "The identity of the client who initiated this request.", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "WorkflowService" - ] - } - }, "/namespaces/{namespace}/workflow-count": { "get": { "summary": "CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace.", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index f9acb3c26..82fa0d4db 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -2218,43 +2218,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workers/{workerInstanceKey}: - get: - tags: - - WorkflowService - description: DescribeWorker returns information about the specified worker execution. - operationId: DescribeWorker - parameters: - - name: namespace - in: path - description: Namespace this worker belongs to. - required: true - schema: - type: string - - name: workerInstanceKey - in: path - description: Worker instance key to describe. - required: true - schema: - type: string - - name: identity - in: query - description: The identity of the client who initiated this request. - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/DescribeWorkerResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/workflow-count: get: tags: @@ -5638,43 +5601,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workers/{workerInstanceKey}: - get: - tags: - - WorkflowService - description: DescribeWorker returns information about the specified worker execution. - operationId: DescribeWorker - parameters: - - name: namespace - in: path - description: Namespace this worker belongs to. - required: true - schema: - type: string - - name: workerInstanceKey - in: path - description: Worker instance key to describe. - required: true - schema: - type: string - - name: identity - in: query - description: The identity of the client who initiated this request. - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/DescribeWorkerResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /namespaces/{namespace}/workflow-count: get: tags: diff --git a/temporal/api/worker/v1/message.proto b/temporal/api/worker/v1/message.proto index 1940bf5cb..e3509f876 100644 --- a/temporal/api/worker/v1/message.proto +++ b/temporal/api/worker/v1/message.proto @@ -155,7 +155,7 @@ message FetchWorkerConfigCommandPayload { // Will be send to the worker as a payload of the UpdateWorkerConfig command. message UpdateWorkerConfigCommandPayload { // Worker identifier, should be unique for the namespace. - string worker_instance_key = 1; + repeated string worker_instance_key = 1; // The new worker config to be applied. temporal.api.sdk.v1.WorkerConfig worker_config = 2; diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index af995971d..3d8c7132b 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1236,21 +1236,12 @@ service WorkflowService { }; } -<<<<<<< HEAD // DescribeWorker returns information about the specified worker. rpc DescribeWorker (DescribeWorkerRequest) returns (DescribeWorkerResponse) { option (google.api.http) = { get: "/namespaces/{namespace}/workers/describe/{worker_instance_key}" additional_bindings { get: "/api/v1/namespaces/{namespace}/workers/describe/{worker_instance_key}" -======= - // DescribeWorker returns information about the specified worker execution. - rpc DescribeWorker (DescribeWorkerRequest) returns (DescribeWorkerResponse) { - option (google.api.http) = { - get: "/namespaces/{namespace}/workers/{worker_instance_key}" - additional_bindings { - get: "/api/v1/namespaces/{namespace}/workers/{worker_instance_key}" ->>>>>>> 0aaab48 (Add worker commands payloads) } }; } From 38b899c4721d6d2701be977bbb5bd670480b2f13 Mon Sep 17 00:00:00 2001 From: Yuri Date: Thu, 24 Jul 2025 12:24:58 -0700 Subject: [PATCH 3/8] move payloads to the separate file, add conventions --- api-linter.yaml | 5 ++ temporal/api/worker/v1/message.proto | 20 ----- .../v1/worker_nexus_service_commands.proto | 73 +++++++++++++++++++ 3 files changed, 78 insertions(+), 20 deletions(-) create mode 100644 temporal/api/worker/v1/worker_nexus_service_commands.proto diff --git a/api-linter.yaml b/api-linter.yaml index 290842854..c7a035b97 100644 --- a/api-linter.yaml +++ b/api-linter.yaml @@ -12,6 +12,11 @@ disabled_rules: - "core::0123::resource-annotation" # We don't require resource annotations on all messages -- https://linter.aip.dev/123/resource-annotation +- included_paths: + - "**/worker/v1/worker_nexus_service_commands.proto" + disabled_rules: + - "core::0134::request-unknown-fields" # Same rationale as `core::0131::request-unknown-fields`, but for Update RPCs -- https://linter.aip.dev/134/request-unknown-fields + - included_paths: - "**/workflowservice/v1/request_response.proto" - "**/operatorservice/v1/request_response.proto" diff --git a/temporal/api/worker/v1/message.proto b/temporal/api/worker/v1/message.proto index e3509f876..844012fc6 100644 --- a/temporal/api/worker/v1/message.proto +++ b/temporal/api/worker/v1/message.proto @@ -11,11 +11,9 @@ option csharp_namespace = "Temporalio.Api.Worker.V1"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; -import "google/protobuf/field_mask.proto"; import "temporal/api/deployment/v1/message.proto"; import "temporal/api/enums/v1/common.proto"; -import "temporal/api/sdk/v1/worker_config.proto"; message WorkerPollerInfo { // Number of polling RPCs that are currently in flight. @@ -145,21 +143,3 @@ message PluginInfo { // The version of the plugin, may be empty. string version = 2; } - -// Will be send to the worker as a payload of the FetchWorkerConfig command. -message FetchWorkerConfigCommandPayload { - // Worker identifier, should be unique for the namespace. - string worker_instance_key = 1; -} - -// Will be send to the worker as a payload of the UpdateWorkerConfig command. -message UpdateWorkerConfigCommandPayload { - // Worker identifier, should be unique for the namespace. - repeated string worker_instance_key = 1; - - // The new worker config to be applied. - temporal.api.sdk.v1.WorkerConfig worker_config = 2; - - // Controls which fields from `worker_config` will be applied - google.protobuf.FieldMask update_mask = 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..ac01123ca --- /dev/null +++ b/temporal/api/worker/v1/worker_nexus_service_commands.proto @@ -0,0 +1,73 @@ +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"; + +import "google/protobuf/field_mask.proto"; +import "temporal/api/sdk/v1/worker_config.proto"; + +// (-- +///////////////////////////////////////////////////////////////////// +// This file contains: +// - Conventions between server and worker. +// - Definitions for commands and payloads for server-worker communication via Nexus +// +// WORKER COMMANDS AND CONVENTIONS: +// +// Worker commands are used to manage worker configurations, operations, etc. +// Command names should match names defined in the server API. +// Currently supported commands: +// - FetchWorkerConfig +// - UpdateWorkerConfig. +// +// 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 +// +// COMMUNICATION PROTOCOL: +// - Transport: Nexus messages on dedicated channel +// - Server identifier: "sys-worker-service" +// - Task queue: "temporal-sys/worker-tq/{namespace_name}/{process_key}" +// --) + +// Will be send to the worker as a payload of the FetchWorkerConfig command. +message FetchWorkerConfigRequest { + // List of worker identifiers. For now only a single worker instance key is supported. + repeated string worker_instance_key = 1; +} + +message FetchWorkerConfigResponse { + message WorkerConfigEntry { + // Worker instance key the config is for. + string worker_instance_key = 1; + + temporal.api.sdk.v1.WorkerConfig worker_config = 2; + } + repeated WorkerConfigEntry worker_configs = 1; +} + +// Will be send to the worker as a payload of the UpdateWorkerConfig command. +message UpdateWorkerConfigRequest { + // List of worker identifiers. + repeated string worker_instance_key = 1; + + // The new worker config to be applied. + temporal.api.sdk.v1.WorkerConfig worker_config = 2; + + // Controls which fields from `worker_config` will be applied + google.protobuf.FieldMask update_mask = 3; +} + +message UpdateWorkerConfigResponse { +} \ No newline at end of file From b08ef43b97c6a2783f1d675e141bdf6b7a5ec48e Mon Sep 17 00:00:00 2001 From: Yuri Date: Thu, 24 Jul 2025 16:26:13 -0700 Subject: [PATCH 4/8] work on comments --- .../worker/v1/worker_nexus_service_commands.proto | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/temporal/api/worker/v1/worker_nexus_service_commands.proto b/temporal/api/worker/v1/worker_nexus_service_commands.proto index ac01123ca..713a0a323 100644 --- a/temporal/api/worker/v1/worker_nexus_service_commands.proto +++ b/temporal/api/worker/v1/worker_nexus_service_commands.proto @@ -18,14 +18,10 @@ import "temporal/api/sdk/v1/worker_config.proto"; // - Conventions between server and worker. // - Definitions for commands and payloads for server-worker communication via Nexus // -// WORKER COMMANDS AND CONVENTIONS: +// WORKER COMMANDS CONVENTIONS: // // Worker commands are used to manage worker configurations, operations, etc. // Command names should match names defined in the server API. -// Currently supported commands: -// - FetchWorkerConfig -// - UpdateWorkerConfig. -// // Command names are provided in StartOperationRequest.Operation field. // // PAYLOAD CONVENTIONS: @@ -36,12 +32,12 @@ import "temporal/api/sdk/v1/worker_config.proto"; // - Empty payload if response is not needed/not expected // // COMMUNICATION PROTOCOL: -// - Transport: Nexus messages on dedicated channel +// - Transport: Nexus tasks on task queue // - Server identifier: "sys-worker-service" // - Task queue: "temporal-sys/worker-tq/{namespace_name}/{process_key}" // --) -// Will be send to the worker as a payload of the FetchWorkerConfig command. +// Will be sent to the worker as a payload of the FetchWorkerConfig command. message FetchWorkerConfigRequest { // List of worker identifiers. For now only a single worker instance key is supported. repeated string worker_instance_key = 1; @@ -57,7 +53,7 @@ message FetchWorkerConfigResponse { repeated WorkerConfigEntry worker_configs = 1; } -// Will be send to the worker as a payload of the UpdateWorkerConfig command. +// Will be sent to the worker as a payload of the UpdateWorkerConfig command. message UpdateWorkerConfigRequest { // List of worker identifiers. repeated string worker_instance_key = 1; From 4e1d0ccd8c54f98462226232a5af9b6c87d2637e Mon Sep 17 00:00:00 2001 From: Yuri Date: Thu, 24 Jul 2025 17:17:16 -0700 Subject: [PATCH 5/8] extract DescribeWorker API into separate PR --- openapi/openapiv2.json | 94 ------------------- openapi/openapiv3.yaml | 69 -------------- .../workflowservice/v1/request_response.proto | 1 - 3 files changed, 164 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 6b0db1449..cca375e3d 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -2296,49 +2296,6 @@ ] } }, - "/api/v1/namespaces/{namespace}/workers/describe/{workerInstanceKey}": { - "get": { -<<<<<<< HEAD - "summary": "DescribeWorker returns information about the specified worker.", -======= - "summary": "DescribeWorker returns information about the specified worker execution.", ->>>>>>> 0afb9d8 (work on comments) - "operationId": "DescribeWorker2", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1DescribeWorkerResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace this worker belongs to.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "workerInstanceKey", - "description": "Worker instance key to describe.", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "WorkflowService" - ] - } - }, "/api/v1/namespaces/{namespace}/workers/fetch-config": { "post": { "summary": "FetchWorkerConfig returns the worker configuration for a specific worker.", @@ -6080,49 +6037,6 @@ ] } }, - "/namespaces/{namespace}/workers/describe/{workerInstanceKey}": { - "get": { -<<<<<<< HEAD - "summary": "DescribeWorker returns information about the specified worker.", -======= - "summary": "DescribeWorker returns information about the specified worker execution.", ->>>>>>> 0afb9d8 (work on comments) - "operationId": "DescribeWorker", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1DescribeWorkerResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "namespace", - "description": "Namespace this worker belongs to.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "workerInstanceKey", - "description": "Worker instance key to describe.", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "WorkflowService" - ] - } - }, "/namespaces/{namespace}/workers/fetch-config": { "post": { "summary": "FetchWorkerConfig returns the worker configuration for a specific worker.", @@ -10961,14 +10875,6 @@ } } }, - "v1DescribeWorkerResponse": { - "type": "object", - "properties": { - "workerInfo": { - "$ref": "#/definitions/v1WorkerInfo" - } - } - }, "v1DescribeWorkflowExecutionResponse": { "type": "object", "properties": { diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 82fa0d4db..e31ac3364 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -2087,38 +2087,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /api/v1/namespaces/{namespace}/workers/describe/{workerInstanceKey}: - get: - tags: - - WorkflowService - description: DescribeWorker returns information about the specified worker. - operationId: DescribeWorker - parameters: - - name: namespace - in: path - description: Namespace this worker belongs to. - required: true - schema: - type: string - - name: workerInstanceKey - in: path - description: Worker instance key to describe. - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/DescribeWorkerResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/workers/fetch-config: post: tags: @@ -5470,38 +5438,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /namespaces/{namespace}/workers/describe/{workerInstanceKey}: - get: - tags: - - WorkflowService - description: DescribeWorker returns information about the specified worker. - operationId: DescribeWorker - parameters: - - name: namespace - in: path - description: Namespace this worker belongs to. - required: true - schema: - type: string - - name: workerInstanceKey - in: path - description: Worker instance key to describe. - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/DescribeWorkerResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /namespaces/{namespace}/workers/fetch-config: post: tags: @@ -7985,11 +7921,6 @@ components: Only set if `report_task_queue_stats` is set to true in the request. (-- api-linter: core::0140::prepositions=disabled aip.dev/not-precedent: "by" is used to clarify the key. --) - DescribeWorkerResponse: - type: object - properties: - workerInfo: - $ref: '#/components/schemas/WorkerInfo' DescribeWorkflowExecutionResponse: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 843849a5a..7751f6d8c 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2551,4 +2551,3 @@ message DescribeWorkerRequest { message DescribeWorkerResponse { temporal.api.worker.v1.WorkerInfo worker_info = 1; } - From 1753fef853f08379df171d58e569fcd015bc8eee Mon Sep 17 00:00:00 2001 From: Yuri Date: Thu, 24 Jul 2025 17:18:19 -0700 Subject: [PATCH 6/8] remove extra line --- temporal/api/worker/v1/message.proto | 1 - temporal/api/workflowservice/v1/service.proto | 1 - 2 files changed, 2 deletions(-) diff --git a/temporal/api/worker/v1/message.proto b/temporal/api/worker/v1/message.proto index 844012fc6..e8a4f1bd3 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/deployment/v1/message.proto"; import "temporal/api/enums/v1/common.proto"; diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 3d8c7132b..4acd6cf15 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1246,4 +1246,3 @@ service WorkflowService { }; } } - From ee2bd590b4ad3d0b6df8d6ea948dd3cf8f518129 Mon Sep 17 00:00:00 2001 From: Yuri Date: Fri, 25 Jul 2025 16:23:38 -0700 Subject: [PATCH 7/8] regenerate openapi files --- openapi/openapiv2.json | 86 ++++++++++++++++++++++++++++++++++++++++++ openapi/openapiv3.yaml | 69 +++++++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index cca375e3d..99945c383 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -2296,6 +2296,45 @@ ] } }, + "/api/v1/namespaces/{namespace}/workers/describe/{workerInstanceKey}": { + "get": { + "summary": "DescribeWorker returns information about the specified worker.", + "operationId": "DescribeWorker2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DescribeWorkerResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace this worker belongs to.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workerInstanceKey", + "description": "Worker instance key to describe.", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/workers/fetch-config": { "post": { "summary": "FetchWorkerConfig returns the worker configuration for a specific worker.", @@ -6037,6 +6076,45 @@ ] } }, + "/namespaces/{namespace}/workers/describe/{workerInstanceKey}": { + "get": { + "summary": "DescribeWorker returns information about the specified worker.", + "operationId": "DescribeWorker", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1DescribeWorkerResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "description": "Namespace this worker belongs to.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "workerInstanceKey", + "description": "Worker instance key to describe.", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/workers/fetch-config": { "post": { "summary": "FetchWorkerConfig returns the worker configuration for a specific worker.", @@ -10875,6 +10953,14 @@ } } }, + "v1DescribeWorkerResponse": { + "type": "object", + "properties": { + "workerInfo": { + "$ref": "#/definitions/v1WorkerInfo" + } + } + }, "v1DescribeWorkflowExecutionResponse": { "type": "object", "properties": { diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index e31ac3364..82fa0d4db 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -2087,6 +2087,38 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/workers/describe/{workerInstanceKey}: + get: + tags: + - WorkflowService + description: DescribeWorker returns information about the specified worker. + operationId: DescribeWorker + parameters: + - name: namespace + in: path + description: Namespace this worker belongs to. + required: true + schema: + type: string + - name: workerInstanceKey + in: path + description: Worker instance key to describe. + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeWorkerResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/workers/fetch-config: post: tags: @@ -5438,6 +5470,38 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/workers/describe/{workerInstanceKey}: + get: + tags: + - WorkflowService + description: DescribeWorker returns information about the specified worker. + operationId: DescribeWorker + parameters: + - name: namespace + in: path + description: Namespace this worker belongs to. + required: true + schema: + type: string + - name: workerInstanceKey + in: path + description: Worker instance key to describe. + required: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DescribeWorkerResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/workers/fetch-config: post: tags: @@ -7921,6 +7985,11 @@ components: Only set if `report_task_queue_stats` is set to true in the request. (-- api-linter: core::0140::prepositions=disabled aip.dev/not-precedent: "by" is used to clarify the key. --) + DescribeWorkerResponse: + type: object + properties: + workerInfo: + $ref: '#/components/schemas/WorkerInfo' DescribeWorkflowExecutionResponse: type: object properties: From 7fa5cdf192f1d7ee07cf3ee86482c5075a7e9e4c Mon Sep 17 00:00:00 2001 From: Yuri Date: Wed, 30 Jul 2025 15:58:21 -0700 Subject: [PATCH 8/8] rename request/response to be different from API commands --- .../v1/worker_nexus_service_commands.proto | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/temporal/api/worker/v1/worker_nexus_service_commands.proto b/temporal/api/worker/v1/worker_nexus_service_commands.proto index 713a0a323..4c7e36575 100644 --- a/temporal/api/worker/v1/worker_nexus_service_commands.proto +++ b/temporal/api/worker/v1/worker_nexus_service_commands.proto @@ -38,23 +38,24 @@ import "temporal/api/sdk/v1/worker_config.proto"; // --) // Will be sent to the worker as a payload of the FetchWorkerConfig command. -message FetchWorkerConfigRequest { +message FetchWorkerConfigRequestPayload { // List of worker identifiers. For now only a single worker instance key is supported. repeated string worker_instance_key = 1; } -message FetchWorkerConfigResponse { - message WorkerConfigEntry { - // Worker instance key the config is for. - string worker_instance_key = 1; +message WorkerConfigEntry { + // Worker instance key the config is for. + string worker_instance_key = 1; - temporal.api.sdk.v1.WorkerConfig worker_config = 2; - } + temporal.api.sdk.v1.WorkerConfig worker_config = 2; +} + +message FetchWorkerConfigResponsePayload { repeated WorkerConfigEntry worker_configs = 1; } // Will be sent to the worker as a payload of the UpdateWorkerConfig command. -message UpdateWorkerConfigRequest { +message UpdateWorkerConfigRequestPayload { // List of worker identifiers. repeated string worker_instance_key = 1; @@ -65,5 +66,6 @@ message UpdateWorkerConfigRequest { google.protobuf.FieldMask update_mask = 3; } -message UpdateWorkerConfigResponse { +message UpdateWorkerConfigResponsePayload { + repeated WorkerConfigEntry worker_configs = 1; } \ No newline at end of file