From 7f1d60e2b93e03b62b2d6b69124c9cad9f55245d Mon Sep 17 00:00:00 2001 From: Jay Pipes Date: Thu, 19 Feb 2026 15:59:43 -0500 Subject: [PATCH 01/40] feature: add compute provider to worker deployment (#704) feature: introduce compute config Introduces a new `compute.v1` package of proto messages that house the various instructions and information needed by worker control plane controllers `temporal.api.compute.v1.ComputeConfig` has three fields, `task_queues`, `provider` and `scaler` that store the configuration information for the server-owned worker setup and how the worker control plane should treat worker lifecycle events (such as when no pollers exist for a task queue that has received a task). The `temporal.api.compute.v1.ComputeConfig.task_queues` field is a list of task queue name and task type tuples. When Temporal Server receives a task with any of these name+type combinations and finds no active pollers, it will trigger a launch of a server-owned Worker using the configuration information in the `provider` field. The `temporal.api.compute.v1.ComputeConfig.provider` field is of type `temporal.api.compute.v1.ComputeProvider`. This message is a simple wrapper around a blob of bytes that contains configuration settings for a worker control plane controller. The configuration settings for the worker control plane controller are specific to different compute providers. The first compute provider we are modeling is AWS Lambda, and the `ProviderDetailAWSLambda` message houses the ARN of the AWS Lambda Function to be invoked and an optional ARN of the IAM Role that should be assumed by a worker control plane controller when invoking the function. The `temporal.api.compute.v1.ComputeConfig.scaler` field is of type `temporal.api.compute.v1.ComputeScaler`. This message contains instructions for when the worker lifecycle controller should scale up or down the number of workers in a WorkerDeployment or WorkerDeploymentVersion. Adds a new field `compute_config` to `WorkerDeploymentInfo` and `WorkerDeploymentVersionInfo` that contains a `temporal.api.compute.v1.ComputeConfig` message. Both WorkerDeployment and WorkerDeploymentVersion have this field in order to handle versioned workers properly. For example, if the user wants to use PINNED temporal versioning, they will be creating a WorkerDeploymentVersion that is specific to, say, a qualified Lambda Function ARN. Therefore we need to place compute provider configuration on a WorkerDeploymentVersion in addition to WorkerDeployment. Adds three new gRPC API methods to WorkflowService: * `CreateWorkerDeployment` creates a new WorkerDeployment containing the supplied compute configuration. * `UpdateWorkerDeploymentComputeConfig` updates an existing WorkerDeployment's compute configuration. * `UpdateWorkerDeploymentComputeConfig` updates an existing WorkerDeploymentVersion's compute configuration. Signed-off-by: Jay Pipes Signed-off-by: Jay Pipes --- .gitignore | 4 +- Makefile | 2 +- openapi/openapiv2.json | 202 +++++++++++++++ openapi/openapiv3.yaml | 241 ++++++++++++++++++ temporal/api/common/v1/message.proto | 9 + temporal/api/compute/v1/config.proto | 31 +++ temporal/api/compute/v1/provider.proto | 40 +++ temporal/api/compute/v1/scaler.proto | 22 ++ temporal/api/deployment/v1/message.proto | 11 +- .../workflowservice/v1/request_response.proto | 32 +++ temporal/api/workflowservice/v1/service.proto | 15 ++ 11 files changed, 606 insertions(+), 3 deletions(-) create mode 100644 temporal/api/compute/v1/config.proto create mode 100644 temporal/api/compute/v1/provider.proto create mode 100644 temporal/api/compute/v1/scaler.proto diff --git a/.gitignore b/.gitignore index 8655883e5..efbf7b661 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ /.gen /.vscode /.stamp -*~ \ No newline at end of file +*~ +*.swp +*.swo diff --git a/Makefile b/Makefile index b4b33bdb5..965fa9b78 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ STAMPDIR := .stamp COLOR := "\e[1;36m%s\e[0m\n" PROTO_ROOT := . -PROTO_FILES = $(shell find temporal -name "*.proto") +PROTO_FILES = $(shell find temporal -name "*.proto" -not -name "*.swp") PROTO_DIRS = $(sort $(dir $(PROTO_FILES))) PROTO_OUT := .gen PROTO_IMPORTS = \ diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index ebcbea209..1cbea361b 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -2488,6 +2488,51 @@ "tags": [ "WorkflowService" ] + }, + "post": { + "summary": "Creates a new Worker Deployment.", + "description": "Experimental. This API might significantly change or be removed in a\nfuture release.", + "operationId": "CreateWorkerDeployment2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CreateWorkerDeploymentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentName", + "description": "The name of the Worker Deployment to create. If a Worker Deployment with\nthis name already exists, an error will be returned.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceCreateWorkerDeploymentBody" + } + } + ], + "tags": [ + "WorkflowService" + ] } }, "/api/v1/namespaces/{namespace}/worker-deployments/{deploymentName}/set-current-version": { @@ -6988,6 +7033,51 @@ "tags": [ "WorkflowService" ] + }, + "post": { + "summary": "Creates a new Worker Deployment.", + "description": "Experimental. This API might significantly change or be removed in a\nfuture release.", + "operationId": "CreateWorkerDeployment", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CreateWorkerDeploymentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentName", + "description": "The name of the Worker Deployment to create. If a Worker Deployment with\nthis name already exists, an error will be returned.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceCreateWorkerDeploymentBody" + } + } + ], + "tags": [ + "WorkflowService" + ] } }, "/namespaces/{namespace}/worker-deployments/{deploymentName}/set-current-version": { @@ -9144,6 +9234,28 @@ } } }, + "WorkflowServiceCreateWorkerDeploymentBody": { + "type": "object", + "properties": { + "workerVersioningMode": { + "$ref": "#/definitions/v1WorkerVersioningMode", + "description": "Optional. Indicates the Worker Deployment should use a particular\nversioning strategy.\n\nIf empty, defaults to UNVERSIONED." + }, + "computeConfig": { + "$ref": "#/definitions/v1ComputeConfig", + "description": "Optional. Contains the new worker compute configuration for the Worker\nDeployment. Used as the default compute configuration for new Worker\nDeployment Versions created for this Worker Deployment." + }, + "identity": { + "type": "string", + "description": "Optional. The identity of the client who initiated this request." + }, + "requestId": { + "type": "string", + "description": "A unique identifier for this create request for idempotence. Typically UUIDv4." + } + }, + "description": "Creates a new WorkerDeployment." + }, "WorkflowServiceCreateWorkflowRuleBody": { "type": "object", "properties": { @@ -11892,6 +12004,66 @@ }, "description": "Used by the worker versioning APIs, represents an unordered set of one or more versions which are\nconsidered to be compatible with each other. Currently the versions are always worker build IDs." }, + "v1ComputeConfig": { + "type": "object", + "properties": { + "taskQueues": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1TaskQueueNameType" + }, + "description": "When a task matching any of these task queue name + type tuples is\nreceived by the Temporal Server and there are no active pollers to send\nthe task to, workers will be launched using the configuration\ninformation in the provider field." + }, + "provider": { + "$ref": "#/definitions/v1ComputeProvider", + "description": "Stores instructions for a worker control plane controller how to respond\nto worker lifeycle events." + }, + "scaler": { + "$ref": "#/definitions/v1ComputeScaler", + "description": "Informs a worker lifecycle controller *when* and *how often* to perform\ncertain worker lifecycle actions like starting a serverless worker." + } + }, + "description": "ComputeConfig stores configuration that helps a worker control plane\ncontroller understand *when* and *how* to respond to worker lifecycle\nevents." + }, + "v1ComputeProvider": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of the compute provider. This string is implementation-specific and\ncan be used by implementations to understand how to interpret the\ncontents of the provider_details field." + }, + "detailJson": { + "type": "string", + "title": "will be an unencrypted, JSON-encoded object of provider-specific\ninformation" + }, + "detailPayload": { + "$ref": "#/definitions/v1Payload", + "description": "will be an encrypted, encoded bytestring containing\nprovider-specific information. The implementation must understand\nhow to decrypt the payload." + }, + "nexusEndpoint": { + "type": "string", + "description": "Optional. If the compute provider is a Nexus service, this should point\nthere." + } + }, + "description": "ComputeProvider stores information used by a worker control plane controller\nto respond to worker lifecycle events. For example, when a Task is received\non a TaskQueue that has no active pollers, a serverless worker lifecycle\ncontroller might need to invoke an AWS Lambda Function that itself ends up\ncalling the SDK's worker.New() function." + }, + "v1ComputeScaler": { + "type": "object", + "properties": { + "minInstances": { + "type": "integer", + "format": "int32", + "description": "The lower limit for the number of Workers (in the WorkerDeployment) to\nwhich the ComputeScaler can scale down." + }, + "maxInstances": { + "type": "integer", + "format": "int32", + "description": "The upper limit for the number of Workers (in the WorkerDeployment) to\nwhich the ComputeScaler can scale up. Must be greater than or equal to\nmin_instances." + } + }, + "description": "ComputeScaler instructs the Temporal Service when to scale up or down the number of\nWorkers that comprise a WorkerDeployment." + }, "v1ConfigMetadata": { "type": "object", "properties": { @@ -12059,6 +12231,16 @@ } } }, + "v1CreateWorkerDeploymentResponse": { + "type": "object", + "properties": { + "conflictToken": { + "type": "string", + "format": "byte", + "description": "This value is returned so that it can be optionally passed to APIs that\nwrite to the WorkerDeployment state to ensure that the state did not\nchange between this API call and a future write." + } + } + }, "v1CreateWorkflowRuleResponse": { "type": "object", "properties": { @@ -16077,6 +16259,18 @@ "default": "TASK_QUEUE_KIND_UNSPECIFIED", "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." }, + "v1TaskQueueNameType": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/v1TaskQueueType" + } + }, + "description": "Uniquely identifies a combination of task queue name and type." + }, "v1TaskQueueReachability": { "type": "object", "properties": { @@ -16747,6 +16941,10 @@ "routingConfigUpdateState": { "$ref": "#/definitions/v1RoutingConfigUpdateState", "description": "Indicates whether the routing_config has been fully propagated to all\nrelevant task queues and their partitions." + }, + "computeConfig": { + "$ref": "#/definitions/v1ComputeConfig", + "description": "Contains information used by worker control plane controllers to handle\nscale events." } }, "description": "A Worker Deployment (Deployment, for short) represents all workers serving \na shared set of Task Queues. Typically, a Deployment represents one service or \napplication.\nA Deployment contains multiple Deployment Versions, each representing a different \nversion of workers. (see documentation of WorkerDeploymentVersionInfo)\nDeployment records are created in Temporal server automatically when their\nfirst poller arrives to the server.\nExperimental. Worker Deployments are experimental and might significantly change in the future." @@ -16855,6 +17053,10 @@ "metadata": { "$ref": "#/definitions/v1VersionMetadata", "description": "Arbitrary user-provided metadata attached to this version." + }, + "computeConfig": { + "$ref": "#/definitions/v1ComputeConfig", + "description": "Contains information used by worker control plane controllers to handle\nscale events." } }, "description": "A Worker Deployment Version (Version, for short) represents all workers of the same \ncode and config within a Deployment. Workers of the same Version are expected to \nbehave exactly the same so when executions move between them there are no \nnon-determinism issues.\nWorker Deployment Versions are created in Temporal server automatically when \ntheir first poller arrives to the server.\nExperimental. Worker Deployments are experimental and might significantly change in the future." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 091a9998e..8c464501a 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -2203,6 +2203,48 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + post: + tags: + - WorkflowService + description: |- + Creates a new Worker Deployment. + + Experimental. This API might significantly change or be removed in a + future release. + operationId: CreateWorkerDeployment + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deploymentName + in: path + description: |- + The name of the Worker Deployment to create. If a Worker Deployment with + this name already exists, an error will be returned. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWorkerDeploymentRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWorkerDeploymentResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' delete: tags: - WorkflowService @@ -6236,6 +6278,48 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + post: + tags: + - WorkflowService + description: |- + Creates a new Worker Deployment. + + Experimental. This API might significantly change or be removed in a + future release. + operationId: CreateWorkerDeployment + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deploymentName + in: path + description: |- + The name of the Worker Deployment to create. If a Worker Deployment with + this name already exists, an error will be returned. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWorkerDeploymentRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWorkerDeploymentResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' delete: tags: - WorkflowService @@ -9031,6 +9115,88 @@ components: description: |- Used by the worker versioning APIs, represents an unordered set of one or more versions which are considered to be compatible with each other. Currently the versions are always worker build IDs. + ComputeConfig: + type: object + properties: + taskQueues: + type: array + items: + $ref: '#/components/schemas/TaskQueueNameType' + description: |- + When a task matching any of these task queue name + type tuples is + received by the Temporal Server and there are no active pollers to send + the task to, workers will be launched using the configuration + information in the provider field. + provider: + allOf: + - $ref: '#/components/schemas/ComputeProvider' + description: |- + Stores instructions for a worker control plane controller how to respond + to worker lifeycle events. + scaler: + allOf: + - $ref: '#/components/schemas/ComputeScaler' + description: |- + Informs a worker lifecycle controller *when* and *how often* to perform + certain worker lifecycle actions like starting a serverless worker. + description: |- + ComputeConfig stores configuration that helps a worker control plane + controller understand *when* and *how* to respond to worker lifecycle + events. + ComputeProvider: + type: object + properties: + type: + type: string + description: |- + Type of the compute provider. This string is implementation-specific and + can be used by implementations to understand how to interpret the + contents of the provider_details field. + detailJson: + type: string + description: |- + will be an unencrypted, JSON-encoded object of provider-specific + information + (-- api-linter: core::0146::any=disabled + aip.dev/not-precedent: This needs to be extensible to + externally-written compute providers --) + detailPayload: + allOf: + - $ref: '#/components/schemas/Payload' + description: |- + will be an encrypted, encoded bytestring containing + provider-specific information. The implementation must understand + how to decrypt the payload. + nexusEndpoint: + type: string + description: |- + Optional. If the compute provider is a Nexus service, this should point + there. + description: |- + ComputeProvider stores information used by a worker control plane controller + to respond to worker lifecycle events. For example, when a Task is received + on a TaskQueue that has no active pollers, a serverless worker lifecycle + controller might need to invoke an AWS Lambda Function that itself ends up + calling the SDK's worker.New() function. + ComputeScaler: + type: object + properties: + minInstances: + type: integer + description: |- + The lower limit for the number of Workers (in the WorkerDeployment) to + which the ComputeScaler can scale down. + format: int32 + maxInstances: + type: integer + description: |- + The upper limit for the number of Workers (in the WorkerDeployment) to + which the ComputeScaler can scale up. Must be greater than or equal to + min_instances. + format: int32 + description: |- + ComputeScaler instructs the Temporal Service when to scale up or down the number of + Workers that comprise a WorkerDeployment. ConfigMetadata: type: object properties: @@ -9179,6 +9345,52 @@ components: conflictToken: type: string format: bytes + CreateWorkerDeploymentRequest: + type: object + properties: + namespace: + type: string + deploymentName: + type: string + description: |- + The name of the Worker Deployment to create. If a Worker Deployment with + this name already exists, an error will be returned. + workerVersioningMode: + enum: + - WORKER_VERSIONING_MODE_UNSPECIFIED + - WORKER_VERSIONING_MODE_UNVERSIONED + - WORKER_VERSIONING_MODE_VERSIONED + type: string + description: |- + Optional. Indicates the Worker Deployment should use a particular + versioning strategy. + + If empty, defaults to UNVERSIONED. + format: enum + computeConfig: + allOf: + - $ref: '#/components/schemas/ComputeConfig' + description: |- + Optional. Contains the new worker compute configuration for the Worker + Deployment. Used as the default compute configuration for new Worker + Deployment Versions created for this Worker Deployment. + identity: + type: string + description: Optional. The identity of the client who initiated this request. + requestId: + type: string + description: A unique identifier for this create request for idempotence. Typically UUIDv4. + description: Creates a new WorkerDeployment. + CreateWorkerDeploymentResponse: + type: object + properties: + conflictToken: + type: string + description: |- + This value is returned so that it can be optionally passed to APIs that + write to the WorkerDeployment state to ensure that the state did not + change between this API call and a future write. + format: bytes CreateWorkflowRuleRequest: type: object properties: @@ -14190,6 +14402,23 @@ components: type: number format: float description: If set, overrides the fairness weights for the corresponding fairness keys. + TaskQueueNameType: + type: object + properties: + name: + type: string + type: + enum: + - TASK_QUEUE_TYPE_UNSPECIFIED + - TASK_QUEUE_TYPE_WORKFLOW + - TASK_QUEUE_TYPE_ACTIVITY + - TASK_QUEUE_TYPE_NEXUS + type: string + format: enum + description: |- + Uniquely identifies a combination of task queue name and type. + (-- api-linter: core::0123::resource-annotation=disabled + aip.dev/not-precedent: this isn't a resource --) TaskQueueReachability: type: object properties: @@ -15260,6 +15489,12 @@ components: Indicates whether the routing_config has been fully propagated to all relevant task queues and their partitions. format: enum + computeConfig: + allOf: + - $ref: '#/components/schemas/ComputeConfig' + description: |- + Contains information used by worker control plane controllers to handle + scale events. description: "A Worker Deployment (Deployment, for short) represents all workers serving \n a shared set of Task Queues. Typically, a Deployment represents one service or \n application.\n A Deployment contains multiple Deployment Versions, each representing a different \n version of workers. (see documentation of WorkerDeploymentVersionInfo)\n Deployment records are created in Temporal server automatically when their\n first poller arrives to the server.\n Experimental. Worker Deployments are experimental and might significantly change in the future." WorkerDeploymentInfo_WorkerDeploymentVersionSummary: type: object @@ -15471,6 +15706,12 @@ components: allOf: - $ref: '#/components/schemas/VersionMetadata' description: Arbitrary user-provided metadata attached to this version. + computeConfig: + allOf: + - $ref: '#/components/schemas/ComputeConfig' + description: |- + Contains information used by worker control plane controllers to handle + scale events. description: "A Worker Deployment Version (Version, for short) represents all workers of the same \n code and config within a Deployment. Workers of the same Version are expected to \n behave exactly the same so when executions move between them there are no \n non-determinism issues.\n Worker Deployment Versions are created in Temporal server automatically when \n their first poller arrives to the server.\n Experimental. Worker Deployments are experimental and might significantly change in the future." WorkerDeploymentVersionInfo_VersionTaskQueueInfo: type: object diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index aa5b3f370..6cf468670 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -15,6 +15,7 @@ import "google/protobuf/empty.proto"; import "temporal/api/enums/v1/common.proto"; import "temporal/api/enums/v1/event_type.proto"; import "temporal/api/enums/v1/reset.proto"; +import "temporal/api/enums/v1/task_queue.proto"; message DataBlob { temporal.api.enums.v1.EncodingType encoding_type = 1; @@ -79,6 +80,14 @@ message ActivityType { string name = 1; } +// Uniquely identifies a combination of task queue name and type. +// (-- api-linter: core::0123::resource-annotation=disabled +// aip.dev/not-precedent: this isn't a resource --) +message TaskQueueNameType { + string name = 1; + temporal.api.enums.v1.TaskQueueType type = 2; +} + // How retries ought to be handled, usable by both workflows and activities message RetryPolicy { // Interval of the first retry. If retryBackoffCoefficient is 1.0 then it is used for all retries. diff --git a/temporal/api/compute/v1/config.proto b/temporal/api/compute/v1/config.proto new file mode 100644 index 000000000..0055defd0 --- /dev/null +++ b/temporal/api/compute/v1/config.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package temporal.api.compute.v1; + +option go_package = "go.temporal.io/api/compute/v1;compute"; +option java_package = "io.temporal.api.compute.v1"; +option java_multiple_files = true; +option java_outer_classname = "ConfigProto"; +option ruby_package = "Temporalio::Api::Compute::V1"; +option csharp_namespace = "Temporalio.Api.Compute.V1"; + +import "temporal/api/compute/v1/provider.proto"; +import "temporal/api/compute/v1/scaler.proto"; +import "temporal/api/common/v1/message.proto"; + +// ComputeConfig stores configuration that helps a worker control plane +// controller understand *when* and *how* to respond to worker lifecycle +// events. +message ComputeConfig { + // When a task matching any of these task queue name + type tuples is + // received by the Temporal Server and there are no active pollers to send + // the task to, workers will be launched using the configuration + // information in the provider field. + repeated temporal.api.common.v1.TaskQueueNameType task_queues = 1; + // Stores instructions for a worker control plane controller how to respond + // to worker lifeycle events. + temporal.api.compute.v1.ComputeProvider provider = 2; + // Informs a worker lifecycle controller *when* and *how often* to perform + // certain worker lifecycle actions like starting a serverless worker. + temporal.api.compute.v1.ComputeScaler scaler = 3; +} diff --git a/temporal/api/compute/v1/provider.proto b/temporal/api/compute/v1/provider.proto new file mode 100644 index 000000000..0ce446f6a --- /dev/null +++ b/temporal/api/compute/v1/provider.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; + +package temporal.api.compute.v1; + +option go_package = "go.temporal.io/api/compute/v1;compute"; +option java_package = "io.temporal.api.compute.v1"; +option java_multiple_files = true; +option java_outer_classname = "ProviderProto"; +option ruby_package = "Temporalio::Api::Compute::V1"; +option csharp_namespace = "Temporalio.Api.Compute.V1"; + +import "temporal/api/common/v1/message.proto"; + +// ComputeProvider stores information used by a worker control plane controller +// to respond to worker lifecycle events. For example, when a Task is received +// on a TaskQueue that has no active pollers, a serverless worker lifecycle +// controller might need to invoke an AWS Lambda Function that itself ends up +// calling the SDK's worker.New() function. +message ComputeProvider { + // Type of the compute provider. This string is implementation-specific and + // can be used by implementations to understand how to interpret the + // contents of the provider_details field. + string type = 1; + // Contains provider-specific instructions and configuration. + oneof detail { + // will be an unencrypted, JSON-encoded object of provider-specific + // information + // (-- api-linter: core::0146::any=disabled + // aip.dev/not-precedent: This needs to be extensible to + // externally-written compute providers --) + string detail_json = 2; + // will be an encrypted, encoded bytestring containing + // provider-specific information. The implementation must understand + // how to decrypt the payload. + temporal.api.common.v1.Payload detail_payload = 3; + } + // Optional. If the compute provider is a Nexus service, this should point + // there. + string nexus_endpoint = 10; +} diff --git a/temporal/api/compute/v1/scaler.proto b/temporal/api/compute/v1/scaler.proto new file mode 100644 index 000000000..7fbb7da74 --- /dev/null +++ b/temporal/api/compute/v1/scaler.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +package temporal.api.compute.v1; + +option go_package = "go.temporal.io/api/compute/v1;compute"; +option java_package = "io.temporal.api.compute.v1"; +option java_multiple_files = true; +option java_outer_classname = "ScalerProto"; +option ruby_package = "Temporalio::Api::Compute::V1"; +option csharp_namespace = "Temporalio.Api.Compute.V1"; + +// ComputeScaler instructs the Temporal Service when to scale up or down the number of +// Workers that comprise a WorkerDeployment. +message ComputeScaler { + // The lower limit for the number of Workers (in the WorkerDeployment) to + // which the ComputeScaler can scale down. + int32 min_instances = 1; + // The upper limit for the number of Workers (in the WorkerDeployment) to + // which the ComputeScaler can scale up. Must be greater than or equal to + // min_instances. + int32 max_instances = 2; +} diff --git a/temporal/api/deployment/v1/message.proto b/temporal/api/deployment/v1/message.proto index b4b7883dd..a42a1a50f 100644 --- a/temporal/api/deployment/v1/message.proto +++ b/temporal/api/deployment/v1/message.proto @@ -14,6 +14,7 @@ import "google/protobuf/timestamp.proto"; import "temporal/api/enums/v1/deployment.proto"; import "temporal/api/enums/v1/task_queue.proto"; import "temporal/api/common/v1/message.proto"; +import "temporal/api/compute/v1/config.proto"; // Worker Deployment options set in SDK that need to be sent to server in every poll. // Experimental. Worker Deployments are experimental and might significantly change in the future. @@ -158,6 +159,10 @@ message WorkerDeploymentVersionInfo { // Arbitrary user-provided metadata attached to this version. VersionMetadata metadata = 10; + + // Contains information used by worker control plane controllers to handle + // scale events. + temporal.api.compute.v1.ComputeConfig compute_config = 20; } // Information about workflow drainage to help the user determine when it is safe @@ -211,6 +216,10 @@ message WorkerDeploymentInfo { // relevant task queues and their partitions. temporal.api.enums.v1.RoutingConfigUpdateState routing_config_update_state = 7; + // Contains information used by worker control plane controllers to handle + // scale events. + temporal.api.compute.v1.ComputeConfig compute_config = 20; + message WorkerDeploymentVersionSummary { // Deprecated. Use `deployment_version`. string version = 1 [deprecated = true]; @@ -311,4 +320,4 @@ message InheritedAutoUpgradeInfo { temporal.api.deployment.v1.WorkerDeploymentVersion source_deployment_version = 1; // The revision number of the source deployment version of the parent/previous workflow. int64 source_deployment_revision_number = 2; -} \ No newline at end of file +} diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 2d9dd7b83..1ebecdf02 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -25,6 +25,7 @@ import "temporal/api/common/v1/message.proto"; import "temporal/api/history/v1/message.proto"; import "temporal/api/workflow/v1/message.proto"; import "temporal/api/command/v1/message.proto"; +import "temporal/api/compute/v1/config.proto"; import "temporal/api/deployment/v1/message.proto"; import "temporal/api/failure/v1/message.proto"; import "temporal/api/filter/v1/message.proto"; @@ -2340,6 +2341,37 @@ message SetWorkerDeploymentRampingVersionResponse { float previous_percentage = 3 [deprecated = true]; } +// Creates a new WorkerDeployment. +message CreateWorkerDeploymentRequest { + string namespace = 1; + // The name of the Worker Deployment to create. If a Worker Deployment with + // this name already exists, an error will be returned. + string deployment_name = 2; + + // Optional. Indicates the Worker Deployment should use a particular + // versioning strategy. + // + // If empty, defaults to UNVERSIONED. + temporal.api.enums.v1.WorkerVersioningMode worker_versioning_mode = 3; + + // Optional. Contains the new worker compute configuration for the Worker + // Deployment. Used as the default compute configuration for new Worker + // Deployment Versions created for this Worker Deployment. + temporal.api.compute.v1.ComputeConfig compute_config = 6; + + // Optional. The identity of the client who initiated this request. + string identity = 15; + // A unique identifier for this create request for idempotence. Typically UUIDv4. + string request_id = 16; +} + +message CreateWorkerDeploymentResponse { + // This value is returned so that it can be optionally passed to APIs that + // write to the WorkerDeployment state to ensure that the state did not + // change between this API call and a future write. + bytes conflict_token = 1; +} + message ListWorkerDeploymentsRequest { string namespace = 1; int32 page_size = 2; diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index cbd71e2ba..e7edcd43f 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1116,6 +1116,21 @@ service WorkflowService { }; } + // Creates a new Worker Deployment. + // + // Experimental. This API might significantly change or be removed in a + // future release. + rpc CreateWorkerDeployment (CreateWorkerDeploymentRequest) returns (CreateWorkerDeploymentResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/worker-deployments/{deployment_name}" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/worker-deployments/{deployment_name}" + body: "*" + } + }; + } + // Updates the user-given metadata attached to a Worker Deployment Version. // Experimental. This API might significantly change or be removed in a future release. rpc UpdateWorkerDeploymentVersionMetadata (UpdateWorkerDeploymentVersionMetadataRequest) returns (UpdateWorkerDeploymentVersionMetadataResponse) { From d73e5355de6abf366d0625ff969043069b918e30 Mon Sep 17 00:00:00 2001 From: ShahabT Date: Fri, 20 Feb 2026 12:15:02 -0800 Subject: [PATCH 02/40] Cleanup WD compute config initial protos --- temporal/api/compute/v1/config.proto | 9 ++------- temporal/api/deployment/v1/message.proto | 14 +++++--------- .../api/workflowservice/v1/request_response.proto | 12 +++--------- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/temporal/api/compute/v1/config.proto b/temporal/api/compute/v1/config.proto index 0055defd0..712c617bc 100644 --- a/temporal/api/compute/v1/config.proto +++ b/temporal/api/compute/v1/config.proto @@ -17,15 +17,10 @@ import "temporal/api/common/v1/message.proto"; // controller understand *when* and *how* to respond to worker lifecycle // events. message ComputeConfig { - // When a task matching any of these task queue name + type tuples is - // received by the Temporal Server and there are no active pollers to send - // the task to, workers will be launched using the configuration - // information in the provider field. - repeated temporal.api.common.v1.TaskQueueNameType task_queues = 1; // Stores instructions for a worker control plane controller how to respond // to worker lifeycle events. - temporal.api.compute.v1.ComputeProvider provider = 2; + temporal.api.compute.v1.ComputeProvider provider = 1; // Informs a worker lifecycle controller *when* and *how often* to perform // certain worker lifecycle actions like starting a serverless worker. - temporal.api.compute.v1.ComputeScaler scaler = 3; + temporal.api.compute.v1.ComputeScaler scaler = 2; } diff --git a/temporal/api/deployment/v1/message.proto b/temporal/api/deployment/v1/message.proto index a42a1a50f..11a2ccfa2 100644 --- a/temporal/api/deployment/v1/message.proto +++ b/temporal/api/deployment/v1/message.proto @@ -159,10 +159,6 @@ message WorkerDeploymentVersionInfo { // Arbitrary user-provided metadata attached to this version. VersionMetadata metadata = 10; - - // Contains information used by worker control plane controllers to handle - // scale events. - temporal.api.compute.v1.ComputeConfig compute_config = 20; } // Information about workflow drainage to help the user determine when it is safe @@ -193,8 +189,8 @@ message WorkerDeploymentInfo { // Deployment Versions that are currently tracked in this Deployment. A DeploymentVersion will be // cleaned up automatically if all the following conditions meet: // - It does not receive new executions (is not current or ramping) - // - It has no active pollers (see WorkerDeploymentVersionInfo.pollers_status) - // - It is drained (see WorkerDeploymentVersionInfo.drainage_status) + // - It has no active pollers (see WorkerDeploymentVersionInfo.pollers_status) + // - It is drained (see WorkerDeploymentVersionInfo.drainage_status) repeated WorkerDeploymentVersionSummary version_summaries = 2; google.protobuf.Timestamp create_time = 3; @@ -218,7 +214,7 @@ message WorkerDeploymentInfo { // Contains information used by worker control plane controllers to handle // scale events. - temporal.api.compute.v1.ComputeConfig compute_config = 20; + temporal.api.compute.v1.ComputeConfig compute_config = 20; message WorkerDeploymentVersionSummary { // Deprecated. Use `deployment_version`. @@ -280,7 +276,7 @@ message VersionMetadata { message RoutingConfig { // Specifies which Deployment Version should receive new workflow executions and tasks of // existing unversioned or AutoUpgrade workflows. - // Nil value means no Version in this Deployment (except Ramping Version, if present) receives traffic other than tasks of previously Pinned workflows. In absence of a Current Version, remaining traffic after any ramp (if set) goes to unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.). + // Nil value means no Version in this Deployment (except Ramping Version, if present) receives traffic other than tasks of previously Pinned workflows. In absence of a Current Version, remaining traffic after any ramp (if set) goes to unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.). // Note: Current Version is overridden by the Ramping Version for a portion of traffic when ramp percentage // is non-zero (see `ramping_deployment_version` and `ramping_version_percentage`). temporal.api.deployment.v1.WorkerDeploymentVersion current_deployment_version = 7; @@ -308,7 +304,7 @@ message RoutingConfig { // Last time ramping version percentage was changed. // If ramping version is changed, this is also updated, even if the percentage stays the same. google.protobuf.Timestamp ramping_version_percentage_changed_time = 6; - // Monotonically increasing value which is incremented on every mutation + // Monotonically increasing value which is incremented on every mutation // to any field of this message to achieve eventual consistency between task queues and their partitions. int64 revision_number = 10; } diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 1ebecdf02..9ab47ad94 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2348,21 +2348,15 @@ message CreateWorkerDeploymentRequest { // this name already exists, an error will be returned. string deployment_name = 2; - // Optional. Indicates the Worker Deployment should use a particular - // versioning strategy. - // - // If empty, defaults to UNVERSIONED. - temporal.api.enums.v1.WorkerVersioningMode worker_versioning_mode = 3; - // Optional. Contains the new worker compute configuration for the Worker // Deployment. Used as the default compute configuration for new Worker // Deployment Versions created for this Worker Deployment. - temporal.api.compute.v1.ComputeConfig compute_config = 6; + temporal.api.compute.v1.ComputeConfig compute_config = 3; // Optional. The identity of the client who initiated this request. - string identity = 15; + string identity = 4; // A unique identifier for this create request for idempotence. Typically UUIDv4. - string request_id = 16; + string request_id = 5; } message CreateWorkerDeploymentResponse { From e9a0371f6bd17fb9190613367b65803dbf4f3497 Mon Sep 17 00:00:00 2001 From: ShahabT Date: Fri, 20 Feb 2026 12:24:30 -0800 Subject: [PATCH 03/40] Auto-update api-go based on serverless branch --- .github/workflows/trigger-api-go-update.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/trigger-api-go-update.yml b/.github/workflows/trigger-api-go-update.yml index e5424cd54..ed31a9c78 100644 --- a/.github/workflows/trigger-api-go-update.yml +++ b/.github/workflows/trigger-api-go-update.yml @@ -4,6 +4,7 @@ on: push: branches: - master + - serverless workflow_dispatch: inputs: branch: From 18643155b3b2dbfba168e530c4d90bc49e330b46 Mon Sep 17 00:00:00 2001 From: ShahabT Date: Fri, 20 Feb 2026 12:24:30 -0800 Subject: [PATCH 04/40] Fix compile --- openapi/openapiv2.json | 34 ++------------- openapi/openapiv3.yaml | 62 +++++++--------------------- temporal/api/compute/v1/config.proto | 1 - 3 files changed, 18 insertions(+), 79 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 1cbea361b..608e07542 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -9237,10 +9237,6 @@ "WorkflowServiceCreateWorkerDeploymentBody": { "type": "object", "properties": { - "workerVersioningMode": { - "$ref": "#/definitions/v1WorkerVersioningMode", - "description": "Optional. Indicates the Worker Deployment should use a particular\nversioning strategy.\n\nIf empty, defaults to UNVERSIONED." - }, "computeConfig": { "$ref": "#/definitions/v1ComputeConfig", "description": "Optional. Contains the new worker compute configuration for the Worker\nDeployment. Used as the default compute configuration for new Worker\nDeployment Versions created for this Worker Deployment." @@ -12007,14 +12003,6 @@ "v1ComputeConfig": { "type": "object", "properties": { - "taskQueues": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1TaskQueueNameType" - }, - "description": "When a task matching any of these task queue name + type tuples is\nreceived by the Temporal Server and there are no active pollers to send\nthe task to, workers will be launched using the configuration\ninformation in the provider field." - }, "provider": { "$ref": "#/definitions/v1ComputeProvider", "description": "Stores instructions for a worker control plane controller how to respond\nto worker lifeycle events." @@ -15377,7 +15365,7 @@ "properties": { "currentDeploymentVersion": { "$ref": "#/definitions/v1WorkerDeploymentVersion", - "description": "Specifies which Deployment Version should receive new workflow executions and tasks of\nexisting unversioned or AutoUpgrade workflows.\nNil value means no Version in this Deployment (except Ramping Version, if present) receives traffic other than tasks of previously Pinned workflows. In absence of a Current Version, remaining traffic after any ramp (if set) goes to unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.). \nNote: Current Version is overridden by the Ramping Version for a portion of traffic when ramp percentage\nis non-zero (see `ramping_deployment_version` and `ramping_version_percentage`)." + "description": "Specifies which Deployment Version should receive new workflow executions and tasks of\nexisting unversioned or AutoUpgrade workflows.\nNil value means no Version in this Deployment (except Ramping Version, if present) receives traffic other than tasks of previously Pinned workflows. In absence of a Current Version, remaining traffic after any ramp (if set) goes to unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.).\nNote: Current Version is overridden by the Ramping Version for a portion of traffic when ramp percentage\nis non-zero (see `ramping_deployment_version` and `ramping_version_percentage`)." }, "currentVersion": { "type": "string", @@ -15414,7 +15402,7 @@ "revisionNumber": { "type": "string", "format": "int64", - "description": "Monotonically increasing value which is incremented on every mutation \nto any field of this message to achieve eventual consistency between task queues and their partitions." + "description": "Monotonically increasing value which is incremented on every mutation\nto any field of this message to achieve eventual consistency between task queues and their partitions." } } }, @@ -16259,18 +16247,6 @@ "default": "TASK_QUEUE_KIND_UNSPECIFIED", "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." }, - "v1TaskQueueNameType": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/v1TaskQueueType" - } - }, - "description": "Uniquely identifies a combination of task queue name and type." - }, "v1TaskQueueReachability": { "type": "object", "properties": { @@ -16921,7 +16897,7 @@ "type": "object", "$ref": "#/definitions/WorkerDeploymentInfoWorkerDeploymentVersionSummary" }, - "title": "Deployment Versions that are currently tracked in this Deployment. A DeploymentVersion will be\ncleaned up automatically if all the following conditions meet:\n- It does not receive new executions (is not current or ramping)\n- It has no active pollers (see WorkerDeploymentVersionInfo.pollers_status) \n- It is drained (see WorkerDeploymentVersionInfo.drainage_status)" + "title": "Deployment Versions that are currently tracked in this Deployment. A DeploymentVersion will be\ncleaned up automatically if all the following conditions meet:\n- It does not receive new executions (is not current or ramping)\n- It has no active pollers (see WorkerDeploymentVersionInfo.pollers_status)\n- It is drained (see WorkerDeploymentVersionInfo.drainage_status)" }, "createTime": { "type": "string", @@ -17053,10 +17029,6 @@ "metadata": { "$ref": "#/definitions/v1VersionMetadata", "description": "Arbitrary user-provided metadata attached to this version." - }, - "computeConfig": { - "$ref": "#/definitions/v1ComputeConfig", - "description": "Contains information used by worker control plane controllers to handle\nscale events." } }, "description": "A Worker Deployment Version (Version, for short) represents all workers of the same \ncode and config within a Deployment. Workers of the same Version are expected to \nbehave exactly the same so when executions move between them there are no \nnon-determinism issues.\nWorker Deployment Versions are created in Temporal server automatically when \ntheir first poller arrives to the server.\nExperimental. Worker Deployments are experimental and might significantly change in the future." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 8c464501a..d23a71b4b 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -9118,15 +9118,6 @@ components: ComputeConfig: type: object properties: - taskQueues: - type: array - items: - $ref: '#/components/schemas/TaskQueueNameType' - description: |- - When a task matching any of these task queue name + type tuples is - received by the Temporal Server and there are no active pollers to send - the task to, workers will be launched using the configuration - information in the provider field. provider: allOf: - $ref: '#/components/schemas/ComputeProvider' @@ -9355,18 +9346,6 @@ components: description: |- The name of the Worker Deployment to create. If a Worker Deployment with this name already exists, an error will be returned. - workerVersioningMode: - enum: - - WORKER_VERSIONING_MODE_UNSPECIFIED - - WORKER_VERSIONING_MODE_UNVERSIONED - - WORKER_VERSIONING_MODE_VERSIONED - type: string - description: |- - Optional. Indicates the Worker Deployment should use a particular - versioning strategy. - - If empty, defaults to UNVERSIONED. - format: enum computeConfig: allOf: - $ref: '#/components/schemas/ComputeConfig' @@ -12947,7 +12926,12 @@ components: currentDeploymentVersion: allOf: - $ref: '#/components/schemas/WorkerDeploymentVersion' - description: "Specifies which Deployment Version should receive new workflow executions and tasks of\n existing unversioned or AutoUpgrade workflows.\n Nil value means no Version in this Deployment (except Ramping Version, if present) receives traffic other than tasks of previously Pinned workflows. In absence of a Current Version, remaining traffic after any ramp (if set) goes to unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.). \n Note: Current Version is overridden by the Ramping Version for a portion of traffic when ramp percentage\n is non-zero (see `ramping_deployment_version` and `ramping_version_percentage`)." + description: |- + Specifies which Deployment Version should receive new workflow executions and tasks of + existing unversioned or AutoUpgrade workflows. + Nil value means no Version in this Deployment (except Ramping Version, if present) receives traffic other than tasks of previously Pinned workflows. In absence of a Current Version, remaining traffic after any ramp (if set) goes to unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.). + Note: Current Version is overridden by the Ramping Version for a portion of traffic when ramp percentage + is non-zero (see `ramping_deployment_version` and `ramping_version_percentage`). currentVersion: type: string description: Deprecated. Use `current_deployment_version`. @@ -12987,7 +12971,9 @@ components: format: date-time revisionNumber: type: string - description: "Monotonically increasing value which is incremented on every mutation \n to any field of this message to achieve eventual consistency between task queues and their partitions." + description: |- + Monotonically increasing value which is incremented on every mutation + to any field of this message to achieve eventual consistency between task queues and their partitions. Schedule: type: object properties: @@ -14402,23 +14388,6 @@ components: type: number format: float description: If set, overrides the fairness weights for the corresponding fairness keys. - TaskQueueNameType: - type: object - properties: - name: - type: string - type: - enum: - - TASK_QUEUE_TYPE_UNSPECIFIED - - TASK_QUEUE_TYPE_WORKFLOW - - TASK_QUEUE_TYPE_ACTIVITY - - TASK_QUEUE_TYPE_NEXUS - type: string - format: enum - description: |- - Uniquely identifies a combination of task queue name and type. - (-- api-linter: core::0123::resource-annotation=disabled - aip.dev/not-precedent: this isn't a resource --) TaskQueueReachability: type: object properties: @@ -15460,7 +15429,12 @@ components: type: array items: $ref: '#/components/schemas/WorkerDeploymentInfo_WorkerDeploymentVersionSummary' - description: "Deployment Versions that are currently tracked in this Deployment. A DeploymentVersion will be\n cleaned up automatically if all the following conditions meet:\n - It does not receive new executions (is not current or ramping)\n - It has no active pollers (see WorkerDeploymentVersionInfo.pollers_status) \n - It is drained (see WorkerDeploymentVersionInfo.drainage_status)" + description: |- + Deployment Versions that are currently tracked in this Deployment. A DeploymentVersion will be + cleaned up automatically if all the following conditions meet: + - It does not receive new executions (is not current or ramping) + - It has no active pollers (see WorkerDeploymentVersionInfo.pollers_status) + - It is drained (see WorkerDeploymentVersionInfo.drainage_status) createTime: type: string format: date-time @@ -15706,12 +15680,6 @@ components: allOf: - $ref: '#/components/schemas/VersionMetadata' description: Arbitrary user-provided metadata attached to this version. - computeConfig: - allOf: - - $ref: '#/components/schemas/ComputeConfig' - description: |- - Contains information used by worker control plane controllers to handle - scale events. description: "A Worker Deployment Version (Version, for short) represents all workers of the same \n code and config within a Deployment. Workers of the same Version are expected to \n behave exactly the same so when executions move between them there are no \n non-determinism issues.\n Worker Deployment Versions are created in Temporal server automatically when \n their first poller arrives to the server.\n Experimental. Worker Deployments are experimental and might significantly change in the future." WorkerDeploymentVersionInfo_VersionTaskQueueInfo: type: object diff --git a/temporal/api/compute/v1/config.proto b/temporal/api/compute/v1/config.proto index 712c617bc..9423ce5ed 100644 --- a/temporal/api/compute/v1/config.proto +++ b/temporal/api/compute/v1/config.proto @@ -11,7 +11,6 @@ option csharp_namespace = "Temporalio.Api.Compute.V1"; import "temporal/api/compute/v1/provider.proto"; import "temporal/api/compute/v1/scaler.proto"; -import "temporal/api/common/v1/message.proto"; // ComputeConfig stores configuration that helps a worker control plane // controller understand *when* and *how* to respond to worker lifecycle From 128d99e4c182c418bb7ae5a3308ace5ec7e26a97 Mon Sep 17 00:00:00 2001 From: ShahabT Date: Fri, 20 Feb 2026 12:55:18 -0800 Subject: [PATCH 05/40] Fix trigger-api-go-update.yml to work on non-master branches --- .github/workflows/trigger-api-go-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trigger-api-go-update.yml b/.github/workflows/trigger-api-go-update.yml index ed31a9c78..97008ca18 100644 --- a/.github/workflows/trigger-api-go-update.yml +++ b/.github/workflows/trigger-api-go-update.yml @@ -57,7 +57,7 @@ jobs: esac gh workflow run update-proto.yml -R https://github.com/temporalio/api-go \ - -r master \ + -r "${BRANCH}" \ -f branch="${BRANCH}" \ -f commit_author="${COMMIT_AUTHOR}" \ -f commit_author_email="${COMMIT_AUTHOR_EMAIL}" \ From 18e3e3f02d34ecacbd189d353be6f0512f3a710d Mon Sep 17 00:00:00 2001 From: ShahabT Date: Fri, 20 Feb 2026 13:06:52 -0800 Subject: [PATCH 06/40] comment change --- temporal/api/workflowservice/v1/request_response.proto | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 9ab47ad94..b04df0a7c 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2349,8 +2349,7 @@ message CreateWorkerDeploymentRequest { string deployment_name = 2; // Optional. Contains the new worker compute configuration for the Worker - // Deployment. Used as the default compute configuration for new Worker - // Deployment Versions created for this Worker Deployment. + // Deployment. Used for worker scale management. temporal.api.compute.v1.ComputeConfig compute_config = 3; // Optional. The identity of the client who initiated this request. From 2c8564b7b1a6ef945ea0beb9fc9e1b584588086c Mon Sep 17 00:00:00 2001 From: ShahabT Date: Wed, 18 Mar 2026 13:53:42 -0700 Subject: [PATCH 07/40] Add serverless_deployments capability flag --- openapi/openapiv2.json | 6 +++++- openapi/openapiv3.yaml | 9 +++++++-- temporal/api/workflowservice/v1/request_response.proto | 5 +++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 608e07542..e0c4ebedd 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -9239,7 +9239,7 @@ "properties": { "computeConfig": { "$ref": "#/definitions/v1ComputeConfig", - "description": "Optional. Contains the new worker compute configuration for the Worker\nDeployment. Used as the default compute configuration for new Worker\nDeployment Versions created for this Worker Deployment." + "description": "Optional. Contains the new worker compute configuration for the Worker\nDeployment. Used for worker scale management." }, "identity": { "type": "string", @@ -13055,6 +13055,10 @@ "nexus": { "type": "boolean", "description": "True if the server supports Nexus operations.\nThis flag is dependent both on server version and for Nexus to be enabled via server configuration." + }, + "serverlessDeployments": { + "type": "boolean", + "description": "True if the server supports serverless deployments.\nThis flag is dependent both on server version and for serverless deployments\nto be enabled via server configuration." } }, "description": "System capability details." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index d23a71b4b..e65cf5e3a 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -9351,8 +9351,7 @@ components: - $ref: '#/components/schemas/ComputeConfig' description: |- Optional. Contains the new worker compute configuration for the Worker - Deployment. Used as the default compute configuration for new Worker - Deployment Versions created for this Worker Deployment. + Deployment. Used for worker scale management. identity: type: string description: Optional. The identity of the client who initiated this request. @@ -10171,6 +10170,12 @@ components: description: |- True if the server supports Nexus operations. This flag is dependent both on server version and for Nexus to be enabled via server configuration. + serverlessDeployments: + type: boolean + description: |- + True if the server supports serverless deployments. + This flag is dependent both on server version and for serverless deployments + to be enabled via server configuration. description: System capability details. GetWorkerBuildIdCompatibilityResponse: type: object diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index b04df0a7c..3803f7c60 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1268,6 +1268,11 @@ message GetSystemInfoResponse { // This flag is dependent both on server version and for Nexus to be enabled via server configuration. bool nexus = 11; + // True if the server supports serverless deployments. + // This flag is dependent both on server version and for serverless deployments + // to be enabled via server configuration. + bool serverless_deployments = 12; + } } From 06713e4adf0316baafd70109c0a58d7438b0f686 Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Mon, 23 Mar 2026 13:01:29 -0700 Subject: [PATCH 08/40] Add Create and Update for Worker Deployment Version, update scaler config and enable per-task-type compute providers (#731) **What changed?** * Enables validating, creating and updating compute providers at the worker deployment version level, as that is where it at the most basic belongs * Making the scaler config more flexible to allow for pluggable scalers * Allowing for different compute providers depending on task types and regions --- openapi/openapiv2.json | 484 +++++++++++++++++- openapi/openapiv3.yaml | 451 ++++++++++++++-- temporal/api/compute/v1/config.proto | 32 +- temporal/api/compute/v1/provider.proto | 19 +- temporal/api/compute/v1/scaler.proto | 20 +- temporal/api/deployment/v1/message.proto | 8 +- .../workflowservice/v1/request_response.proto | 95 +++- temporal/api/workflowservice/v1/service.proto | 41 ++ 8 files changed, 1051 insertions(+), 99 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 98b5d0b71..53e8723ed 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -2190,6 +2190,53 @@ ] } }, + "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}": { + "post": { + "summary": "Creates a new Worker Deployment Version.", + "description": "Experimental. This API might significantly change or be removed in a\nfuture release.", + "operationId": "CreateWorkerDeploymentVersion2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CreateWorkerDeploymentVersionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentVersion.deploymentName", + "description": "Identifies the Worker Deployment this Version is part of.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceCreateWorkerDeploymentVersionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}/{deploymentVersion.buildId}": { "get": { "summary": "Describes a worker deployment version.\nExperimental. This API might significantly change or be removed in a future release.", @@ -2313,6 +2360,59 @@ ] } }, + "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}/{deploymentVersion.buildId}/update-compute-config": { + "post": { + "summary": "Updates the compute config attached to a Worker Deployment Version.\nExperimental. This API might significantly change or be removed in a future release.", + "operationId": "UpdateWorkerDeploymentVersionComputeConfig2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateWorkerDeploymentVersionComputeConfigResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentVersion.deploymentName", + "description": "Identifies the Worker Deployment this Version is part of.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentVersion.buildId", + "description": "A unique identifier for this Version within the Deployment it is a part of.\nNot necessarily unique within the namespace.\nThe combination of `deployment_name` and `build_id` uniquely identifies this\nVersion within the namespace, because Deployment names are unique within a namespace.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateWorkerDeploymentVersionComputeConfigBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}/{deploymentVersion.buildId}/update-metadata": { "post": { "summary": "Updates the user-given metadata attached to a Worker Deployment Version.\nExperimental. This API might significantly change or be removed in a future release.", @@ -2366,6 +2466,59 @@ ] } }, + "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}/{deploymentVersion.buildId}/validate-compute-config": { + "post": { + "summary": "Validates the compute config without attaching it to a Worker Deployment Version.\nExperimental. This API might significantly change or be removed in a future release.", + "operationId": "ValidateWorkerDeploymentVersionComputeConfig2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ValidateWorkerDeploymentVersionComputeConfigResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentVersion.deploymentName", + "description": "Identifies the Worker Deployment this Version is part of.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentVersion.buildId", + "description": "A unique identifier for this Version within the Deployment it is a part of.\nNot necessarily unique within the namespace.\nThe combination of `deployment_name` and `build_id` uniquely identifies this\nVersion within the namespace, because Deployment names are unique within a namespace.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceValidateWorkerDeploymentVersionComputeConfigBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/worker-deployments": { "get": { "summary": "Lists all Worker Deployments that are tracked in the Namespace.\nExperimental. This API might significantly change or be removed in a future release.", @@ -6735,6 +6888,53 @@ ] } }, + "/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}": { + "post": { + "summary": "Creates a new Worker Deployment Version.", + "description": "Experimental. This API might significantly change or be removed in a\nfuture release.", + "operationId": "CreateWorkerDeploymentVersion", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CreateWorkerDeploymentVersionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentVersion.deploymentName", + "description": "Identifies the Worker Deployment this Version is part of.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceCreateWorkerDeploymentVersionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}/{deploymentVersion.buildId}": { "get": { "summary": "Describes a worker deployment version.\nExperimental. This API might significantly change or be removed in a future release.", @@ -6858,6 +7058,59 @@ ] } }, + "/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}/{deploymentVersion.buildId}/update-compute-config": { + "post": { + "summary": "Updates the compute config attached to a Worker Deployment Version.\nExperimental. This API might significantly change or be removed in a future release.", + "operationId": "UpdateWorkerDeploymentVersionComputeConfig", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateWorkerDeploymentVersionComputeConfigResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentVersion.deploymentName", + "description": "Identifies the Worker Deployment this Version is part of.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentVersion.buildId", + "description": "A unique identifier for this Version within the Deployment it is a part of.\nNot necessarily unique within the namespace.\nThe combination of `deployment_name` and `build_id` uniquely identifies this\nVersion within the namespace, because Deployment names are unique within a namespace.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateWorkerDeploymentVersionComputeConfigBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}/{deploymentVersion.buildId}/update-metadata": { "post": { "summary": "Updates the user-given metadata attached to a Worker Deployment Version.\nExperimental. This API might significantly change or be removed in a future release.", @@ -6911,6 +7164,59 @@ ] } }, + "/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}/{deploymentVersion.buildId}/validate-compute-config": { + "post": { + "summary": "Validates the compute config without attaching it to a Worker Deployment Version.\nExperimental. This API might significantly change or be removed in a future release.", + "operationId": "ValidateWorkerDeploymentVersionComputeConfig", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ValidateWorkerDeploymentVersionComputeConfigResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentVersion.deploymentName", + "description": "Identifies the Worker Deployment this Version is part of.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentVersion.buildId", + "description": "A unique identifier for this Version within the Deployment it is a part of.\nNot necessarily unique within the namespace.\nThe combination of `deployment_name` and `build_id` uniquely identifies this\nVersion within the namespace, because Deployment names are unique within a namespace.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceValidateWorkerDeploymentVersionComputeConfigBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/worker-deployments": { "get": { "summary": "Lists all Worker Deployments that are tracked in the Namespace.\nExperimental. This API might significantly change or be removed in a future release.", @@ -9047,6 +9353,18 @@ } } }, + "UpdateWorkerDeploymentVersionComputeConfigRequestScalingGroupUpdate": { + "type": "object", + "properties": { + "scalingGroup": { + "$ref": "#/definitions/v1ComputeConfigScalingGroup" + }, + "updateMask": { + "type": "string", + "title": "Controls which fields from `scaling_group` will be applied" + } + } + }, "VersioningOverridePinnedOverride": { "type": "object", "properties": { @@ -9237,6 +9555,31 @@ "WorkflowServiceCreateWorkerDeploymentBody": { "type": "object", "properties": { + "identity": { + "type": "string", + "description": "Optional. The identity of the client who initiated this request." + }, + "requestId": { + "type": "string", + "description": "A unique identifier for this create request for idempotence. Typically UUIDv4." + } + }, + "description": "Creates a new WorkerDeployment." + }, + "WorkflowServiceCreateWorkerDeploymentVersionBody": { + "type": "object", + "properties": { + "deploymentVersion": { + "type": "object", + "properties": { + "buildId": { + "type": "string", + "description": "A unique identifier for this Version within the Deployment it is a part of.\nNot necessarily unique within the namespace.\nThe combination of `deployment_name` and `build_id` uniquely identifies this\nVersion within the namespace, because Deployment names are unique within a namespace." + } + }, + "description": "Required.", + "title": "Required." + }, "computeConfig": { "$ref": "#/definitions/v1ComputeConfig", "description": "Optional. Contains the new worker compute configuration for the Worker\nDeployment. Used for worker scale management." @@ -9247,10 +9590,10 @@ }, "requestId": { "type": "string", - "description": "A unique identifier for this create request for idempotence. Typically UUIDv4." + "description": "A unique identifier for this create request for idempotence. Typically UUIDv4.\nIf a second request with the same ID is recieved, it is considered a successful no-op.\nRetrying with a different request ID for the same deployment name + build ID is an error." } }, - "description": "Creates a new WorkerDeployment." + "description": "Creates a new WorkerDeploymentVersion." }, "WorkflowServiceCreateWorkflowRuleBody": { "type": "object", @@ -10571,6 +10914,44 @@ } } }, + "WorkflowServiceUpdateWorkerDeploymentVersionComputeConfigBody": { + "type": "object", + "properties": { + "deploymentVersion": { + "type": "object", + "description": "Required.", + "title": "Required." + }, + "computeConfigScalingGroups": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/UpdateWorkerDeploymentVersionComputeConfigRequestScalingGroupUpdate" + }, + "description": "Optional. Contains the compute config scaling groups to add or updated for the Worker\nDeployment." + }, + "removeComputeConfigScalingGroups": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Optional. Contains the compute config scaling groups to remove from the Worker Deployment." + }, + "identity": { + "type": "string", + "description": "Optional. The identity of the client who initiated this request." + }, + "requestId": { + "type": "string", + "description": "A unique identifier for this create request for idempotence. Typically UUIDv4.\nIf a second request with the same ID is recieved, it is considered a successful no-op.\nRetrying with a different request ID for the same deployment name + build ID is an error." + }, + "conflictToken": { + "type": "string", + "format": "byte", + "description": "Optional. This value is returned so that it can be optionally passed to APIs\nthat write to the Worker Deployment state to ensure that the state\ndid not change between this API call and a future write." + } + }, + "description": "Used to update the compute config of a Worker Deployment Version." + }, "WorkflowServiceUpdateWorkerDeploymentVersionMetadataBody": { "type": "object", "properties": { @@ -10676,6 +11057,25 @@ }, "description": "Keep the parameters in sync with:\n - temporal.api.batch.v1.BatchOperationUpdateWorkflowExecutionOptions.\n - temporal.api.workflow.v1.PostResetOperation.UpdateWorkflowOptions." }, + "WorkflowServiceValidateWorkerDeploymentVersionComputeConfigBody": { + "type": "object", + "properties": { + "deploymentVersion": { + "type": "object", + "description": "Required.", + "title": "Required." + }, + "computeConfig": { + "$ref": "#/definitions/v1ComputeConfig", + "description": "Required. Contains the new worker compute configuration for the Worker Deployment." + }, + "identity": { + "type": "string", + "description": "Optional. The identity of the client who initiated this request." + } + }, + "description": "Used to validate the compute config without attaching it to a Worker Deployment Version." + }, "protobufAny": { "type": "object", "properties": { @@ -12003,6 +12403,26 @@ "v1ComputeConfig": { "type": "object", "properties": { + "scalingGroups": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v1ComputeConfigScalingGroup" + }, + "description": "Each scaling group describes a compute config for a specific subset of the worker \ndeployment version: covering a specific set of task types and/or regions.\nHaving different configurations for different task types, allows independent\ntuning of activity and workflow task processing (for example).\n\nThe key of the map is the ID of the scaling group used to reference it in subsequent\nupdate calls." + } + }, + "description": "ComputeConfig stores configuration that helps a worker control plane\ncontroller understand *when* and *how* to respond to worker lifecycle\nevents." + }, + "v1ComputeConfigScalingGroup": { + "type": "object", + "properties": { + "taskQueueTypes": { + "type": "array", + "items": { + "$ref": "#/definitions/v1TaskQueueType" + }, + "description": "Optional. The set of task queue types this scaling group serves. \nIf not provided, this scaling group serves all not otherwise defined\ntask types." + }, "provider": { "$ref": "#/definitions/v1ComputeProvider", "description": "Stores instructions for a worker control plane controller how to respond\nto worker lifeycle events." @@ -12011,8 +12431,7 @@ "$ref": "#/definitions/v1ComputeScaler", "description": "Informs a worker lifecycle controller *when* and *how often* to perform\ncertain worker lifecycle actions like starting a serverless worker." } - }, - "description": "ComputeConfig stores configuration that helps a worker control plane\ncontroller understand *when* and *how* to respond to worker lifecycle\nevents." + } }, "v1ComputeProvider": { "type": "object", @@ -12021,13 +12440,9 @@ "type": "string", "description": "Type of the compute provider. This string is implementation-specific and\ncan be used by implementations to understand how to interpret the\ncontents of the provider_details field." }, - "detailJson": { - "type": "string", - "title": "will be an unencrypted, JSON-encoded object of provider-specific\ninformation" - }, - "detailPayload": { + "details": { "$ref": "#/definitions/v1Payload", - "description": "will be an encrypted, encoded bytestring containing\nprovider-specific information. The implementation must understand\nhow to decrypt the payload." + "description": "Contains provider-specific instructions and configuration.\nFor server-implemented providers, use the SDK's default content\nconverter to ensure the server can understand it.\nFor remote-implemented providers, you might use your own content\nconverters according to what the remote endpoints understand." }, "nexusEndpoint": { "type": "string", @@ -12039,15 +12454,13 @@ "v1ComputeScaler": { "type": "object", "properties": { - "minInstances": { - "type": "integer", - "format": "int32", - "description": "The lower limit for the number of Workers (in the WorkerDeployment) to\nwhich the ComputeScaler can scale down." + "type": { + "type": "string", + "description": "Type of the compute scaler. this string is implementation-specific and\ncan be used by implementations to understand how to interpret the\ncontents of the scaler_details field." }, - "maxInstances": { - "type": "integer", - "format": "int32", - "description": "The upper limit for the number of Workers (in the WorkerDeployment) to\nwhich the ComputeScaler can scale up. Must be greater than or equal to\nmin_instances." + "details": { + "$ref": "#/definitions/v1Payload", + "description": "Contains scaler-specific instructions and configuration.\nFor server-implemented scalers, use the SDK's default content\nconverter to ensure the server can understand it.\nFor remote-implemented scalers, you might use your own content\nconverters according to what the remote endpoints understand." } }, "description": "ComputeScaler instructs the Temporal Service when to scale up or down the number of\nWorkers that comprise a WorkerDeployment." @@ -12229,6 +12642,16 @@ } } }, + "v1CreateWorkerDeploymentVersionResponse": { + "type": "object", + "properties": { + "conflictToken": { + "type": "string", + "format": "byte", + "description": "This value is returned so that it can be optionally passed to APIs that\nwrite to the WorkerDeployment state to ensure that the state did not\nchange between this API call and a future write." + } + } + }, "v1CreateWorkflowRuleResponse": { "type": "object", "properties": { @@ -13056,9 +13479,9 @@ "type": "boolean", "description": "True if the server supports Nexus operations.\nThis flag is dependent both on server version and for Nexus to be enabled via server configuration." }, - "serverlessDeployments": { + "serverScaledDeployments": { "type": "boolean", - "description": "True if the server supports serverless deployments.\nThis flag is dependent both on server version and for serverless deployments\nto be enabled via server configuration." + "description": "True if the server supports server-scaled deployments.\nThis flag is dependent both on server version and for server-scaled deployments\nto be enabled via server configuration." } }, "description": "System capability details." @@ -16704,6 +17127,16 @@ } } }, + "v1UpdateWorkerDeploymentVersionComputeConfigResponse": { + "type": "object", + "properties": { + "conflictToken": { + "type": "string", + "format": "byte", + "description": "This value is returned so that it can be optionally passed to APIs that\nwrite to the WorkerDeployment state to ensure that the state did not\nchange between this API call and a future write." + } + } + }, "v1UpdateWorkerDeploymentVersionMetadataResponse": { "type": "object", "properties": { @@ -16777,6 +17210,9 @@ }, "description": "Information a user can set, often for use by user interfaces." }, + "v1ValidateWorkerDeploymentVersionComputeConfigResponse": { + "type": "object" + }, "v1VersionDrainageInfo": { "type": "object", "properties": { @@ -16939,10 +17375,6 @@ "routingConfigUpdateState": { "$ref": "#/definitions/v1RoutingConfigUpdateState", "description": "Indicates whether the routing_config has been fully propagated to all\nrelevant task queues and their partitions." - }, - "computeConfig": { - "$ref": "#/definitions/v1ComputeConfig", - "description": "Contains information used by worker control plane controllers to handle\nscale events." } }, "description": "A Worker Deployment (Deployment, for short) represents all workers serving \na shared set of Task Queues. Typically, a Deployment represents one service or \napplication.\nA Deployment contains multiple Deployment Versions, each representing a different \nversion of workers. (see documentation of WorkerDeploymentVersionInfo)\nDeployment records are created in Temporal server automatically when their\nfirst poller arrives to the server.\nExperimental. Worker Deployments are experimental and might significantly change in the future." @@ -17051,6 +17483,10 @@ "metadata": { "$ref": "#/definitions/v1VersionMetadata", "description": "Arbitrary user-provided metadata attached to this version." + }, + "computeConfig": { + "$ref": "#/definitions/v1ComputeConfig", + "description": "Optional. Contains the new worker compute configuration for the Worker\nDeployment. Used for worker scale management." } }, "description": "A Worker Deployment Version (Version, for short) represents all workers of the same \ncode and config within a Deployment. Workers of the same Version are expected to \nbehave exactly the same so when executions move between them there are no \nnon-determinism issues.\nWorker Deployment Versions are created in Temporal server automatically when \ntheir first poller arrives to the server.\nExperimental. Worker Deployments are experimental and might significantly change in the future." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 8f0106008..11902ead1 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -1958,6 +1958,46 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}: + post: + tags: + - WorkflowService + description: |- + Creates a new Worker Deployment Version. + + Experimental. This API might significantly change or be removed in a + future release. + operationId: CreateWorkerDeploymentVersion + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deployment_version.deployment_name + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWorkerDeploymentVersionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWorkerDeploymentVersionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}: get: tags: @@ -2091,6 +2131,49 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + ? /api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/update-compute-config + : post: + tags: + - WorkflowService + description: |- + Updates the compute config attached to a Worker Deployment Version. + Experimental. This API might significantly change or be removed in a future release. + operationId: UpdateWorkerDeploymentVersionComputeConfig + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deployment_version.deployment_name + in: path + required: true + schema: + type: string + - name: deployment_version.build_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateWorkerDeploymentVersionComputeConfigRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateWorkerDeploymentVersionComputeConfigResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' ? /api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/update-metadata : post: tags: @@ -2134,6 +2217,49 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + ? /api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/validate-compute-config + : post: + tags: + - WorkflowService + description: |- + Validates the compute config without attaching it to a Worker Deployment Version. + Experimental. This API might significantly change or be removed in a future release. + operationId: ValidateWorkerDeploymentVersionComputeConfig + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deployment_version.deployment_name + in: path + required: true + schema: + type: string + - name: deployment_version.build_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateWorkerDeploymentVersionComputeConfigRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateWorkerDeploymentVersionComputeConfigResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/worker-deployments: get: tags: @@ -6033,6 +6159,46 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}: + post: + tags: + - WorkflowService + description: |- + Creates a new Worker Deployment Version. + + Experimental. This API might significantly change or be removed in a + future release. + operationId: CreateWorkerDeploymentVersion + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deployment_version.deployment_name + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWorkerDeploymentVersionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWorkerDeploymentVersionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}: get: tags: @@ -6166,6 +6332,49 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + ? /namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/update-compute-config + : post: + tags: + - WorkflowService + description: |- + Updates the compute config attached to a Worker Deployment Version. + Experimental. This API might significantly change or be removed in a future release. + operationId: UpdateWorkerDeploymentVersionComputeConfig + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deployment_version.deployment_name + in: path + required: true + schema: + type: string + - name: deployment_version.build_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateWorkerDeploymentVersionComputeConfigRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateWorkerDeploymentVersionComputeConfigResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' ? /namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/update-metadata : post: tags: @@ -6209,6 +6418,49 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + ? /namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/validate-compute-config + : post: + tags: + - WorkflowService + description: |- + Validates the compute config without attaching it to a Worker Deployment Version. + Experimental. This API might significantly change or be removed in a future release. + operationId: ValidateWorkerDeploymentVersionComputeConfig + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deployment_version.deployment_name + in: path + required: true + schema: + type: string + - name: deployment_version.build_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateWorkerDeploymentVersionComputeConfigRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateWorkerDeploymentVersionComputeConfigResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/worker-deployments: get: tags: @@ -9118,6 +9370,29 @@ components: ComputeConfig: type: object properties: + scalingGroups: + type: object + additionalProperties: + $ref: '#/components/schemas/ComputeConfigScalingGroup' + description: "Each scaling group describes a compute config for a specific subset of the worker \n deployment version: covering a specific set of task types and/or regions.\n Having different configurations for different task types, allows independent\n tuning of activity and workflow task processing (for example).\n\n The key of the map is the ID of the scaling group used to reference it in subsequent\n update calls." + description: |- + ComputeConfig stores configuration that helps a worker control plane + controller understand *when* and *how* to respond to worker lifecycle + events. + ComputeConfigScalingGroup: + type: object + properties: + taskQueueTypes: + type: array + items: + enum: + - TASK_QUEUE_TYPE_UNSPECIFIED + - TASK_QUEUE_TYPE_WORKFLOW + - TASK_QUEUE_TYPE_ACTIVITY + - TASK_QUEUE_TYPE_NEXUS + type: string + format: enum + description: "Optional. The set of task queue types this scaling group serves. \n If not provided, this scaling group serves all not otherwise defined\n task types." provider: allOf: - $ref: '#/components/schemas/ComputeProvider' @@ -9130,10 +9405,6 @@ components: description: |- Informs a worker lifecycle controller *when* and *how often* to perform certain worker lifecycle actions like starting a serverless worker. - description: |- - ComputeConfig stores configuration that helps a worker control plane - controller understand *when* and *how* to respond to worker lifecycle - events. ComputeProvider: type: object properties: @@ -9143,21 +9414,15 @@ components: Type of the compute provider. This string is implementation-specific and can be used by implementations to understand how to interpret the contents of the provider_details field. - detailJson: - type: string - description: |- - will be an unencrypted, JSON-encoded object of provider-specific - information - (-- api-linter: core::0146::any=disabled - aip.dev/not-precedent: This needs to be extensible to - externally-written compute providers --) - detailPayload: + details: allOf: - $ref: '#/components/schemas/Payload' description: |- - will be an encrypted, encoded bytestring containing - provider-specific information. The implementation must understand - how to decrypt the payload. + Contains provider-specific instructions and configuration. + For server-implemented providers, use the SDK's default content + converter to ensure the server can understand it. + For remote-implemented providers, you might use your own content + converters according to what the remote endpoints understand. nexusEndpoint: type: string description: |- @@ -9172,19 +9437,21 @@ components: ComputeScaler: type: object properties: - minInstances: - type: integer + type: + type: string description: |- - The lower limit for the number of Workers (in the WorkerDeployment) to - which the ComputeScaler can scale down. - format: int32 - maxInstances: - type: integer + Type of the compute scaler. this string is implementation-specific and + can be used by implementations to understand how to interpret the + contents of the scaler_details field. + details: + allOf: + - $ref: '#/components/schemas/Payload' description: |- - The upper limit for the number of Workers (in the WorkerDeployment) to - which the ComputeScaler can scale up. Must be greater than or equal to - min_instances. - format: int32 + Contains scaler-specific instructions and configuration. + For server-implemented scalers, use the SDK's default content + converter to ensure the server can understand it. + For remote-implemented scalers, you might use your own content + converters according to what the remote endpoints understand. description: |- ComputeScaler instructs the Temporal Service when to scale up or down the number of Workers that comprise a WorkerDeployment. @@ -9346,6 +9613,32 @@ components: description: |- The name of the Worker Deployment to create. If a Worker Deployment with this name already exists, an error will be returned. + identity: + type: string + description: Optional. The identity of the client who initiated this request. + requestId: + type: string + description: A unique identifier for this create request for idempotence. Typically UUIDv4. + description: Creates a new WorkerDeployment. + CreateWorkerDeploymentResponse: + type: object + properties: + conflictToken: + type: string + description: |- + This value is returned so that it can be optionally passed to APIs that + write to the WorkerDeployment state to ensure that the state did not + change between this API call and a future write. + format: bytes + CreateWorkerDeploymentVersionRequest: + type: object + properties: + namespace: + type: string + deploymentVersion: + allOf: + - $ref: '#/components/schemas/WorkerDeploymentVersion' + description: Required. computeConfig: allOf: - $ref: '#/components/schemas/ComputeConfig' @@ -9357,9 +9650,12 @@ components: description: Optional. The identity of the client who initiated this request. requestId: type: string - description: A unique identifier for this create request for idempotence. Typically UUIDv4. - description: Creates a new WorkerDeployment. - CreateWorkerDeploymentResponse: + description: |- + A unique identifier for this create request for idempotence. Typically UUIDv4. + If a second request with the same ID is recieved, it is considered a successful no-op. + Retrying with a different request ID for the same deployment name + build ID is an error. + description: Creates a new WorkerDeploymentVersion. + CreateWorkerDeploymentVersionResponse: type: object properties: conflictToken: @@ -10170,11 +10466,11 @@ components: description: |- True if the server supports Nexus operations. This flag is dependent both on server version and for Nexus to be enabled via server configuration. - serverlessDeployments: + serverScaledDeployments: type: boolean description: |- - True if the server supports serverless deployments. - This flag is dependent both on server version and for serverless deployments + True if the server supports server-scaled deployments. + This flag is dependent both on server version and for server-scaled deployments to be enabled via server configuration. description: System capability details. GetWorkerBuildIdCompatibilityResponse: @@ -15103,6 +15399,63 @@ components: allOf: - $ref: '#/components/schemas/WorkerConfig' description: The worker configuration. Will be returned if the command was sent to a single worker. + UpdateWorkerDeploymentVersionComputeConfigRequest: + type: object + properties: + namespace: + type: string + deploymentVersion: + allOf: + - $ref: '#/components/schemas/WorkerDeploymentVersion' + description: Required. + computeConfigScalingGroups: + type: object + additionalProperties: + $ref: '#/components/schemas/UpdateWorkerDeploymentVersionComputeConfigRequest_ScalingGroupUpdate' + description: |- + Optional. Contains the compute config scaling groups to add or updated for the Worker + Deployment. + removeComputeConfigScalingGroups: + type: array + items: + type: string + description: Optional. Contains the compute config scaling groups to remove from the Worker Deployment. + identity: + type: string + description: Optional. The identity of the client who initiated this request. + requestId: + type: string + description: |- + A unique identifier for this create request for idempotence. Typically UUIDv4. + If a second request with the same ID is recieved, it is considered a successful no-op. + Retrying with a different request ID for the same deployment name + build ID is an error. + conflictToken: + type: string + description: |- + Optional. This value is returned so that it can be optionally passed to APIs + that write to the Worker Deployment state to ensure that the state + did not change between this API call and a future write. + format: bytes + description: Used to update the compute config of a Worker Deployment Version. + UpdateWorkerDeploymentVersionComputeConfigRequest_ScalingGroupUpdate: + type: object + properties: + scalingGroup: + $ref: '#/components/schemas/ComputeConfigScalingGroup' + updateMask: + type: string + description: Controls which fields from `scaling_group` will be applied + format: field-mask + UpdateWorkerDeploymentVersionComputeConfigResponse: + type: object + properties: + conflictToken: + type: string + description: |- + This value is returned so that it can be optionally passed to APIs that + write to the WorkerDeployment state to ensure that the state did not + change between this API call and a future write. + format: bytes UpdateWorkerDeploymentVersionMetadataRequest: type: object properties: @@ -15269,6 +15622,26 @@ components: that is a single JSON string for use in user interfaces. User interface formatting may apply to this text in common use. The payload data section is limited to 20000 bytes by default. description: Information a user can set, often for use by user interfaces. + ValidateWorkerDeploymentVersionComputeConfigRequest: + type: object + properties: + namespace: + type: string + deploymentVersion: + allOf: + - $ref: '#/components/schemas/WorkerDeploymentVersion' + description: Required. + computeConfig: + allOf: + - $ref: '#/components/schemas/ComputeConfig' + description: Required. Contains the new worker compute configuration for the Worker Deployment. + identity: + type: string + description: Optional. The identity of the client who initiated this request. + description: Used to validate the compute config without attaching it to a Worker Deployment Version. + ValidateWorkerDeploymentVersionComputeConfigResponse: + type: object + properties: {} VersionDrainageInfo: type: object properties: @@ -15484,12 +15857,6 @@ components: Indicates whether the routing_config has been fully propagated to all relevant task queues and their partitions. format: enum - computeConfig: - allOf: - - $ref: '#/components/schemas/ComputeConfig' - description: |- - Contains information used by worker control plane controllers to handle - scale events. description: "A Worker Deployment (Deployment, for short) represents all workers serving \n a shared set of Task Queues. Typically, a Deployment represents one service or \n application.\n A Deployment contains multiple Deployment Versions, each representing a different \n version of workers. (see documentation of WorkerDeploymentVersionInfo)\n Deployment records are created in Temporal server automatically when their\n first poller arrives to the server.\n Experimental. Worker Deployments are experimental and might significantly change in the future." WorkerDeploymentInfo_WorkerDeploymentVersionSummary: type: object @@ -15701,6 +16068,12 @@ components: allOf: - $ref: '#/components/schemas/VersionMetadata' description: Arbitrary user-provided metadata attached to this version. + computeConfig: + allOf: + - $ref: '#/components/schemas/ComputeConfig' + description: |- + Optional. Contains the new worker compute configuration for the Worker + Deployment. Used for worker scale management. description: "A Worker Deployment Version (Version, for short) represents all workers of the same \n code and config within a Deployment. Workers of the same Version are expected to \n behave exactly the same so when executions move between them there are no \n non-determinism issues.\n Worker Deployment Versions are created in Temporal server automatically when \n their first poller arrives to the server.\n Experimental. Worker Deployments are experimental and might significantly change in the future." WorkerDeploymentVersionInfo_VersionTaskQueueInfo: type: object diff --git a/temporal/api/compute/v1/config.proto b/temporal/api/compute/v1/config.proto index 9423ce5ed..04909a854 100644 --- a/temporal/api/compute/v1/config.proto +++ b/temporal/api/compute/v1/config.proto @@ -11,15 +11,35 @@ option csharp_namespace = "Temporalio.Api.Compute.V1"; import "temporal/api/compute/v1/provider.proto"; import "temporal/api/compute/v1/scaler.proto"; +import "temporal/api/enums/v1/task_queue.proto"; + +message ComputeConfigScalingGroup { + // Optional. The set of task queue types this scaling group serves. + // If not provided, this scaling group serves all not otherwise defined + // task types. + repeated temporal.api.enums.v1.TaskQueueType task_queue_types = 1; -// ComputeConfig stores configuration that helps a worker control plane -// controller understand *when* and *how* to respond to worker lifecycle -// events. -message ComputeConfig { // Stores instructions for a worker control plane controller how to respond // to worker lifeycle events. - temporal.api.compute.v1.ComputeProvider provider = 1; + temporal.api.compute.v1.ComputeProvider provider = 3; + // Informs a worker lifecycle controller *when* and *how often* to perform // certain worker lifecycle actions like starting a serverless worker. - temporal.api.compute.v1.ComputeScaler scaler = 2; + temporal.api.compute.v1.ComputeScaler scaler = 4; +} + +// ComputeConfig stores configuration that helps a worker control plane +// controller understand *when* and *how* to respond to worker lifecycle +// events. +message ComputeConfig { + + // Each scaling group describes a compute config for a specific subset of the worker + // deployment version: covering a specific set of task types and/or regions. + // Having different configurations for different task types, allows independent + // tuning of activity and workflow task processing (for example). + // + // The key of the map is the ID of the scaling group used to reference it in subsequent + // update calls. + map scaling_groups = 1; } + diff --git a/temporal/api/compute/v1/provider.proto b/temporal/api/compute/v1/provider.proto index 0ce446f6a..ed0baf9d5 100644 --- a/temporal/api/compute/v1/provider.proto +++ b/temporal/api/compute/v1/provider.proto @@ -21,19 +21,14 @@ message ComputeProvider { // can be used by implementations to understand how to interpret the // contents of the provider_details field. string type = 1; + // Contains provider-specific instructions and configuration. - oneof detail { - // will be an unencrypted, JSON-encoded object of provider-specific - // information - // (-- api-linter: core::0146::any=disabled - // aip.dev/not-precedent: This needs to be extensible to - // externally-written compute providers --) - string detail_json = 2; - // will be an encrypted, encoded bytestring containing - // provider-specific information. The implementation must understand - // how to decrypt the payload. - temporal.api.common.v1.Payload detail_payload = 3; - } + // For server-implemented providers, use the SDK's default content + // converter to ensure the server can understand it. + // For remote-implemented providers, you might use your own content + // converters according to what the remote endpoints understand. + temporal.api.common.v1.Payload details = 2; + // Optional. If the compute provider is a Nexus service, this should point // there. string nexus_endpoint = 10; diff --git a/temporal/api/compute/v1/scaler.proto b/temporal/api/compute/v1/scaler.proto index 7fbb7da74..95c751800 100644 --- a/temporal/api/compute/v1/scaler.proto +++ b/temporal/api/compute/v1/scaler.proto @@ -9,14 +9,20 @@ option java_outer_classname = "ScalerProto"; option ruby_package = "Temporalio::Api::Compute::V1"; option csharp_namespace = "Temporalio.Api.Compute.V1"; +import "temporal/api/common/v1/message.proto"; + // ComputeScaler instructs the Temporal Service when to scale up or down the number of // Workers that comprise a WorkerDeployment. message ComputeScaler { - // The lower limit for the number of Workers (in the WorkerDeployment) to - // which the ComputeScaler can scale down. - int32 min_instances = 1; - // The upper limit for the number of Workers (in the WorkerDeployment) to - // which the ComputeScaler can scale up. Must be greater than or equal to - // min_instances. - int32 max_instances = 2; + // Type of the compute scaler. this string is implementation-specific and + // can be used by implementations to understand how to interpret the + // contents of the scaler_details field. + string type = 1; + + // Contains scaler-specific instructions and configuration. + // For server-implemented scalers, use the SDK's default content + // converter to ensure the server can understand it. + // For remote-implemented scalers, you might use your own content + // converters according to what the remote endpoints understand. + temporal.api.common.v1.Payload details = 2; } diff --git a/temporal/api/deployment/v1/message.proto b/temporal/api/deployment/v1/message.proto index 11a2ccfa2..4480e6d93 100644 --- a/temporal/api/deployment/v1/message.proto +++ b/temporal/api/deployment/v1/message.proto @@ -159,6 +159,10 @@ message WorkerDeploymentVersionInfo { // Arbitrary user-provided metadata attached to this version. VersionMetadata metadata = 10; + + // Optional. Contains the new worker compute configuration for the Worker + // Deployment. Used for worker scale management. + temporal.api.compute.v1.ComputeConfig compute_config = 16; } // Information about workflow drainage to help the user determine when it is safe @@ -212,10 +216,6 @@ message WorkerDeploymentInfo { // relevant task queues and their partitions. temporal.api.enums.v1.RoutingConfigUpdateState routing_config_update_state = 7; - // Contains information used by worker control plane controllers to handle - // scale events. - temporal.api.compute.v1.ComputeConfig compute_config = 20; - message WorkerDeploymentVersionSummary { // Deprecated. Use `deployment_version`. string version = 1 [deprecated = true]; diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 3803f7c60..f4c2b9f92 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1268,10 +1268,10 @@ message GetSystemInfoResponse { // This flag is dependent both on server version and for Nexus to be enabled via server configuration. bool nexus = 11; - // True if the server supports serverless deployments. - // This flag is dependent both on server version and for serverless deployments + // True if the server supports server-scaled deployments. + // This flag is dependent both on server version and for server-scaled deployments // to be enabled via server configuration. - bool serverless_deployments = 12; + bool server_scaled_deployments = 12; } } @@ -2353,10 +2353,6 @@ message CreateWorkerDeploymentRequest { // this name already exists, an error will be returned. string deployment_name = 2; - // Optional. Contains the new worker compute configuration for the Worker - // Deployment. Used for worker scale management. - temporal.api.compute.v1.ComputeConfig compute_config = 3; - // Optional. The identity of the client who initiated this request. string identity = 4; // A unique identifier for this create request for idempotence. Typically UUIDv4. @@ -2396,6 +2392,32 @@ message ListWorkerDeploymentsResponse { } } +// Creates a new WorkerDeploymentVersion. +message CreateWorkerDeploymentVersionRequest { + string namespace = 1; + // Required. + temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 2; + + // Optional. Contains the new worker compute configuration for the Worker + // Deployment. Used for worker scale management. + temporal.api.compute.v1.ComputeConfig compute_config = 4; + + // Optional. The identity of the client who initiated this request. + string identity = 3; + + // A unique identifier for this create request for idempotence. Typically UUIDv4. + // If a second request with the same ID is recieved, it is considered a successful no-op. + // Retrying with a different request ID for the same deployment name + build ID is an error. + string request_id = 5; +} + +message CreateWorkerDeploymentVersionResponse { + // This value is returned so that it can be optionally passed to APIs that + // write to the WorkerDeployment state to ensure that the state did not + // change between this API call and a future write. + bytes conflict_token = 1; +} + // Used for manual deletion of Versions. User can delete a Version only when all the // following conditions are met: // - It is not the Current or Ramping Version of its Deployment. @@ -2430,6 +2452,65 @@ message DeleteWorkerDeploymentRequest { message DeleteWorkerDeploymentResponse { } +// Used to update the compute config of a Worker Deployment Version. +message UpdateWorkerDeploymentVersionComputeConfigRequest { + string namespace = 1; + + // Required. + temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 2; + + message ScalingGroupUpdate { + temporal.api.compute.v1.ComputeConfigScalingGroup scaling_group = 1; + + // Controls which fields from `scaling_group` will be applied + google.protobuf.FieldMask update_mask = 2; + } + + // Optional. Contains the compute config scaling groups to add or updated for the Worker + // Deployment. + map compute_config_scaling_groups = 6; + + // Optional. Contains the compute config scaling groups to remove from the Worker Deployment. + repeated string remove_compute_config_scaling_groups = 7; + + // Optional. The identity of the client who initiated this request. + string identity = 3; + + // A unique identifier for this create request for idempotence. Typically UUIDv4. + // If a second request with the same ID is recieved, it is considered a successful no-op. + // Retrying with a different request ID for the same deployment name + build ID is an error. + string request_id = 4; + + // Optional. This value is returned so that it can be optionally passed to APIs + // that write to the Worker Deployment state to ensure that the state + // did not change between this API call and a future write. + bytes conflict_token = 5; +} + +message UpdateWorkerDeploymentVersionComputeConfigResponse { + // This value is returned so that it can be optionally passed to APIs that + // write to the WorkerDeployment state to ensure that the state did not + // change between this API call and a future write. + bytes conflict_token = 1; +} + +// Used to validate the compute config without attaching it to a Worker Deployment Version. +message ValidateWorkerDeploymentVersionComputeConfigRequest { + string namespace = 1; + + // Required. + temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 2; + + // Required. Contains the new worker compute configuration for the Worker Deployment. + temporal.api.compute.v1.ComputeConfig compute_config = 4; + + // Optional. The identity of the client who initiated this request. + string identity = 3; +} + +message ValidateWorkerDeploymentVersionComputeConfigResponse { +} + // Used to update the user-defined metadata of a Worker Deployment Version. message UpdateWorkerDeploymentVersionMetadataRequest { string namespace = 1; diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index e7edcd43f..db62e2b24 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1131,6 +1131,47 @@ service WorkflowService { }; } + // Creates a new Worker Deployment Version. + // + // Experimental. This API might significantly change or be removed in a + // future release. + rpc CreateWorkerDeploymentVersion (CreateWorkerDeploymentVersionRequest) returns (CreateWorkerDeploymentVersionResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}" + body: "*" + } + }; + } + + // Updates the compute config attached to a Worker Deployment Version. + // Experimental. This API might significantly change or be removed in a future release. + rpc UpdateWorkerDeploymentVersionComputeConfig (UpdateWorkerDeploymentVersionComputeConfigRequest) returns (UpdateWorkerDeploymentVersionComputeConfigResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/update-compute-config" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/update-compute-config" + body: "*" + } + }; + } + + // Validates the compute config without attaching it to a Worker Deployment Version. + // Experimental. This API might significantly change or be removed in a future release. + rpc ValidateWorkerDeploymentVersionComputeConfig (ValidateWorkerDeploymentVersionComputeConfigRequest) returns (ValidateWorkerDeploymentVersionComputeConfigResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/validate-compute-config" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/validate-compute-config" + body: "*" + } + }; + } + // Updates the user-given metadata attached to a Worker Deployment Version. // Experimental. This API might significantly change or be removed in a future release. rpc UpdateWorkerDeploymentVersionMetadata (UpdateWorkerDeploymentVersionMetadataRequest) returns (UpdateWorkerDeploymentVersionMetadataResponse) { From 983d345dc58030b2d98862aec9179248db1e70df Mon Sep 17 00:00:00 2001 From: ShahabT Date: Mon, 23 Mar 2026 18:02:38 -0700 Subject: [PATCH 09/40] Remove conflict token from CreateWorkerDeploymentVersion --- openapi/openapiv2.json | 23 ++--------------- openapi/openapiv3.yaml | 25 ++----------------- .../workflowservice/v1/request_response.proto | 13 ---------- 3 files changed, 4 insertions(+), 57 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 53e8723ed..2da1a8455 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -10943,11 +10943,6 @@ "requestId": { "type": "string", "description": "A unique identifier for this create request for idempotence. Typically UUIDv4.\nIf a second request with the same ID is recieved, it is considered a successful no-op.\nRetrying with a different request ID for the same deployment name + build ID is an error." - }, - "conflictToken": { - "type": "string", - "format": "byte", - "description": "Optional. This value is returned so that it can be optionally passed to APIs\nthat write to the Worker Deployment state to ensure that the state\ndid not change between this API call and a future write." } }, "description": "Used to update the compute config of a Worker Deployment Version." @@ -12643,14 +12638,7 @@ } }, "v1CreateWorkerDeploymentVersionResponse": { - "type": "object", - "properties": { - "conflictToken": { - "type": "string", - "format": "byte", - "description": "This value is returned so that it can be optionally passed to APIs that\nwrite to the WorkerDeployment state to ensure that the state did not\nchange between this API call and a future write." - } - } + "type": "object" }, "v1CreateWorkflowRuleResponse": { "type": "object", @@ -17128,14 +17116,7 @@ } }, "v1UpdateWorkerDeploymentVersionComputeConfigResponse": { - "type": "object", - "properties": { - "conflictToken": { - "type": "string", - "format": "byte", - "description": "This value is returned so that it can be optionally passed to APIs that\nwrite to the WorkerDeployment state to ensure that the state did not\nchange between this API call and a future write." - } - } + "type": "object" }, "v1UpdateWorkerDeploymentVersionMetadataResponse": { "type": "object", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 11902ead1..9b7e6f652 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -9657,14 +9657,7 @@ components: description: Creates a new WorkerDeploymentVersion. CreateWorkerDeploymentVersionResponse: type: object - properties: - conflictToken: - type: string - description: |- - This value is returned so that it can be optionally passed to APIs that - write to the WorkerDeployment state to ensure that the state did not - change between this API call and a future write. - format: bytes + properties: {} CreateWorkflowRuleRequest: type: object properties: @@ -15429,13 +15422,6 @@ components: A unique identifier for this create request for idempotence. Typically UUIDv4. If a second request with the same ID is recieved, it is considered a successful no-op. Retrying with a different request ID for the same deployment name + build ID is an error. - conflictToken: - type: string - description: |- - Optional. This value is returned so that it can be optionally passed to APIs - that write to the Worker Deployment state to ensure that the state - did not change between this API call and a future write. - format: bytes description: Used to update the compute config of a Worker Deployment Version. UpdateWorkerDeploymentVersionComputeConfigRequest_ScalingGroupUpdate: type: object @@ -15448,14 +15434,7 @@ components: format: field-mask UpdateWorkerDeploymentVersionComputeConfigResponse: type: object - properties: - conflictToken: - type: string - description: |- - This value is returned so that it can be optionally passed to APIs that - write to the WorkerDeployment state to ensure that the state did not - change between this API call and a future write. - format: bytes + properties: {} UpdateWorkerDeploymentVersionMetadataRequest: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index f4c2b9f92..2f62582f0 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2412,10 +2412,6 @@ message CreateWorkerDeploymentVersionRequest { } message CreateWorkerDeploymentVersionResponse { - // This value is returned so that it can be optionally passed to APIs that - // write to the WorkerDeployment state to ensure that the state did not - // change between this API call and a future write. - bytes conflict_token = 1; } // Used for manual deletion of Versions. User can delete a Version only when all the @@ -2480,18 +2476,9 @@ message UpdateWorkerDeploymentVersionComputeConfigRequest { // If a second request with the same ID is recieved, it is considered a successful no-op. // Retrying with a different request ID for the same deployment name + build ID is an error. string request_id = 4; - - // Optional. This value is returned so that it can be optionally passed to APIs - // that write to the Worker Deployment state to ensure that the state - // did not change between this API call and a future write. - bytes conflict_token = 5; } message UpdateWorkerDeploymentVersionComputeConfigResponse { - // This value is returned so that it can be optionally passed to APIs that - // write to the WorkerDeployment state to ensure that the state did not - // change between this API call and a future write. - bytes conflict_token = 1; } // Used to validate the compute config without attaching it to a Worker Deployment Version. From 1f5c61dc24d4fdfe3ada667f274bdbd83a1c8f7e Mon Sep 17 00:00:00 2001 From: ShahabT Date: Tue, 24 Mar 2026 13:04:43 -0700 Subject: [PATCH 10/40] add a missing deprecation mark for version_info.deployment_name --- openapi/openapiv2.json | 3 ++- openapi/openapiv3.yaml | 1 + temporal/api/deployment/v1/message.proto | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 2da1a8455..2865322da 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -17408,7 +17408,8 @@ "description": "Required." }, "deploymentName": { - "type": "string" + "type": "string", + "description": "Deprecated. User deployment_version.deployment_name." }, "createTime": { "type": "string", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 9b7e6f652..41d87a92f 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -15976,6 +15976,7 @@ components: description: Required. deploymentName: type: string + description: Deprecated. User deployment_version.deployment_name. createTime: type: string format: date-time diff --git a/temporal/api/deployment/v1/message.proto b/temporal/api/deployment/v1/message.proto index 4480e6d93..d047ab98b 100644 --- a/temporal/api/deployment/v1/message.proto +++ b/temporal/api/deployment/v1/message.proto @@ -103,6 +103,7 @@ message WorkerDeploymentVersionInfo { // Required. WorkerDeploymentVersion deployment_version = 11; + // Deprecated. User deployment_version.deployment_name. string deployment_name = 2; google.protobuf.Timestamp create_time = 3; From 83540240d641e886551604cb3b52b372a606dae1 Mon Sep 17 00:00:00 2001 From: ShahabT Date: Tue, 24 Mar 2026 14:50:44 -0700 Subject: [PATCH 11/40] add WORKER_DEPLOYMENT_VERSION_STATUS_CREATED --- openapi/openapiv2.json | 5 +++-- openapi/openapiv3.yaml | 2 ++ temporal/api/enums/v1/deployment.proto | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 2865322da..68c96c131 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -17481,10 +17481,11 @@ "WORKER_DEPLOYMENT_VERSION_STATUS_CURRENT", "WORKER_DEPLOYMENT_VERSION_STATUS_RAMPING", "WORKER_DEPLOYMENT_VERSION_STATUS_DRAINING", - "WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED" + "WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED", + "WORKER_DEPLOYMENT_VERSION_STATUS_CREATED" ], "default": "WORKER_DEPLOYMENT_VERSION_STATUS_UNSPECIFIED", - "description": "Specify the status of a Worker Deployment Version.\nExperimental. Worker Deployments are experimental and might significantly change in the future.\n\n - WORKER_DEPLOYMENT_VERSION_STATUS_INACTIVE: The Worker Deployment Version has been created inside the Worker Deployment but is not used by any\nworkflow executions. These Versions can still have workflows if they have an explicit Versioning Override targeting\nthis Version. Such Versioning Override could be set at workflow start time, or at a later time via `UpdateWorkflowExecutionOptions`.\n - WORKER_DEPLOYMENT_VERSION_STATUS_CURRENT: The Worker Deployment Version is the current version of the Worker Deployment. All new workflow executions \nand tasks of existing unversioned or AutoUpgrade workflows are routed to this version.\n - WORKER_DEPLOYMENT_VERSION_STATUS_RAMPING: The Worker Deployment Version is the ramping version of the Worker Deployment. A subset of new Pinned workflow executions are \nrouted to this version. Moreover, a portion of existing unversioned or AutoUpgrade workflow executions are also routed to this version.\n - WORKER_DEPLOYMENT_VERSION_STATUS_DRAINING: The Worker Deployment Version is not used by new workflows but is still used by\nopen pinned workflows. The version cannot be decommissioned safely.\n - WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED: The Worker Deployment Version is not used by new or open workflows, but might be still needed by\nQueries sent to closed workflows. The version can be decommissioned safely if user does\nnot query closed workflows. If the user does query closed workflows for some time x after\nworkflows are closed, they should decommission the version after it has been drained for that duration." + "description": "Specify the status of a Worker Deployment Version.\nExperimental. Worker Deployments are experimental and might significantly change in the future.\n\n - WORKER_DEPLOYMENT_VERSION_STATUS_INACTIVE: The Worker Deployment Version has been created inside the Worker Deployment but is not used by any\nworkflow executions. These Versions can still have workflows if they have an explicit Versioning Override targeting\nthis Version. Such Versioning Override could be set at workflow start time, or at a later time via `UpdateWorkflowExecutionOptions`.\n - WORKER_DEPLOYMENT_VERSION_STATUS_CURRENT: The Worker Deployment Version is the current version of the Worker Deployment. All new workflow executions \nand tasks of existing unversioned or AutoUpgrade workflows are routed to this version.\n - WORKER_DEPLOYMENT_VERSION_STATUS_RAMPING: The Worker Deployment Version is the ramping version of the Worker Deployment. A subset of new Pinned workflow executions are \nrouted to this version. Moreover, a portion of existing unversioned or AutoUpgrade workflow executions are also routed to this version.\n - WORKER_DEPLOYMENT_VERSION_STATUS_DRAINING: The Worker Deployment Version is not used by new workflows but is still used by\nopen pinned workflows. The version cannot be decommissioned safely.\n - WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED: The Worker Deployment Version is not used by new or open workflows, but might be still needed by\nQueries sent to closed workflows. The version can be decommissioned safely if user does\nnot query closed workflows. If the user does query closed workflows for some time x after\nworkflows are closed, they should decommission the version after it has been drained for that duration.\n - WORKER_DEPLOYMENT_VERSION_STATUS_CREATED: The Worker Deployment Version is created by user (via `CreateWorkerDeploymentVersion` API)\nbut server has not seen any poller for it yet." }, "v1WorkerHeartbeat": { "type": "object", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 41d87a92f..a7e49749b 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -15851,6 +15851,7 @@ components: - WORKER_DEPLOYMENT_VERSION_STATUS_RAMPING - WORKER_DEPLOYMENT_VERSION_STATUS_DRAINING - WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED + - WORKER_DEPLOYMENT_VERSION_STATUS_CREATED type: string description: The status of the Worker Deployment Version. format: enum @@ -15967,6 +15968,7 @@ components: - WORKER_DEPLOYMENT_VERSION_STATUS_RAMPING - WORKER_DEPLOYMENT_VERSION_STATUS_DRAINING - WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED + - WORKER_DEPLOYMENT_VERSION_STATUS_CREATED type: string description: The status of the Worker Deployment Version. format: enum diff --git a/temporal/api/enums/v1/deployment.proto b/temporal/api/enums/v1/deployment.proto index 710d7c38d..e3792d9e5 100644 --- a/temporal/api/enums/v1/deployment.proto +++ b/temporal/api/enums/v1/deployment.proto @@ -97,4 +97,7 @@ enum WorkerDeploymentVersionStatus { // not query closed workflows. If the user does query closed workflows for some time x after // workflows are closed, they should decommission the version after it has been drained for that duration. WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED = 5; + // The Worker Deployment Version is created by user (via `CreateWorkerDeploymentVersion` API) + // but server has not seen any poller for it yet. + WORKER_DEPLOYMENT_VERSION_STATUS_CREATED = 6; } From 26bafd760a634b9b29de6202d791072d0d676866 Mon Sep 17 00:00:00 2001 From: ShahabT Date: Fri, 27 Mar 2026 13:52:07 -0700 Subject: [PATCH 12/40] Add last_modifier_identity for WDV --- openapi/openapiv2.json | 4 ++++ openapi/openapiv3.yaml | 8 ++++++++ temporal/api/deployment/v1/message.proto | 7 +++++++ 3 files changed, 19 insertions(+) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 68c96c131..7f7ae34ec 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -17469,6 +17469,10 @@ "computeConfig": { "$ref": "#/definitions/v1ComputeConfig", "description": "Optional. Contains the new worker compute configuration for the Worker\nDeployment. Used for worker scale management." + }, + "lastModifierIdentity": { + "type": "string", + "title": "Identity of the last client who modified the configuration of this Version.\nAs of now, this field only covers changes through the following APIs:\n- `CreateWorkerDeploymentVersion`\n- `UpdateWorkerDeploymentVersionComputeConfig`\n- `UpdateWorkerDeploymentVersionMetadata`" } }, "description": "A Worker Deployment Version (Version, for short) represents all workers of the same \ncode and config within a Deployment. Workers of the same Version are expected to \nbehave exactly the same so when executions move between them there are no \nnon-determinism issues.\nWorker Deployment Versions are created in Temporal server automatically when \ntheir first poller arrives to the server.\nExperimental. Worker Deployments are experimental and might significantly change in the future." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index a7e49749b..1fd403f02 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -16056,6 +16056,14 @@ components: description: |- Optional. Contains the new worker compute configuration for the Worker Deployment. Used for worker scale management. + lastModifierIdentity: + type: string + description: |- + Identity of the last client who modified the configuration of this Version. + As of now, this field only covers changes through the following APIs: + - `CreateWorkerDeploymentVersion` + - `UpdateWorkerDeploymentVersionComputeConfig` + - `UpdateWorkerDeploymentVersionMetadata` description: "A Worker Deployment Version (Version, for short) represents all workers of the same \n code and config within a Deployment. Workers of the same Version are expected to \n behave exactly the same so when executions move between them there are no \n non-determinism issues.\n Worker Deployment Versions are created in Temporal server automatically when \n their first poller arrives to the server.\n Experimental. Worker Deployments are experimental and might significantly change in the future." WorkerDeploymentVersionInfo_VersionTaskQueueInfo: type: object diff --git a/temporal/api/deployment/v1/message.proto b/temporal/api/deployment/v1/message.proto index d047ab98b..6fdd28814 100644 --- a/temporal/api/deployment/v1/message.proto +++ b/temporal/api/deployment/v1/message.proto @@ -164,6 +164,13 @@ message WorkerDeploymentVersionInfo { // Optional. Contains the new worker compute configuration for the Worker // Deployment. Used for worker scale management. temporal.api.compute.v1.ComputeConfig compute_config = 16; + + // Identity of the last client who modified the configuration of this Version. + // As of now, this field only covers changes through the following APIs: + // - `CreateWorkerDeploymentVersion` + // - `UpdateWorkerDeploymentVersionComputeConfig` + // - `UpdateWorkerDeploymentVersionMetadata` + string last_modifier_identity = 17; } // Information about workflow drainage to help the user determine when it is safe From ac3371e0d068707fb78d61bdb6cd77947e9413d4 Mon Sep 17 00:00:00 2001 From: ShahabT Date: Fri, 27 Mar 2026 16:40:08 -0700 Subject: [PATCH 13/40] Support partial update in ValidateWorkerDeploymentVersionComputeConfigRequest --- openapi/openapiv2.json | 42 +++++++++++------- openapi/openapiv3.yaml | 43 +++++++++++++------ temporal/api/compute/v1/config.proto | 13 ++++++ .../workflowservice/v1/request_response.proto | 17 +++----- 4 files changed, 75 insertions(+), 40 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 7f7ae34ec..0f451ecfc 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -9353,18 +9353,6 @@ } } }, - "UpdateWorkerDeploymentVersionComputeConfigRequestScalingGroupUpdate": { - "type": "object", - "properties": { - "scalingGroup": { - "$ref": "#/definitions/v1ComputeConfigScalingGroup" - }, - "updateMask": { - "type": "string", - "title": "Controls which fields from `scaling_group` will be applied" - } - } - }, "VersioningOverridePinnedOverride": { "type": "object", "properties": { @@ -10925,7 +10913,7 @@ "computeConfigScalingGroups": { "type": "object", "additionalProperties": { - "$ref": "#/definitions/UpdateWorkerDeploymentVersionComputeConfigRequestScalingGroupUpdate" + "$ref": "#/definitions/v1ComputeConfigScalingGroupUpdate" }, "description": "Optional. Contains the compute config scaling groups to add or updated for the Worker\nDeployment." }, @@ -11060,9 +11048,19 @@ "description": "Required.", "title": "Required." }, - "computeConfig": { - "$ref": "#/definitions/v1ComputeConfig", - "description": "Required. Contains the new worker compute configuration for the Worker Deployment." + "computeConfigScalingGroups": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v1ComputeConfigScalingGroupUpdate" + }, + "description": "Optional. Contains the compute config scaling groups to add or updated for the Worker\nDeployment." + }, + "removeComputeConfigScalingGroups": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Optional. Contains the compute config scaling groups to remove from the Worker Deployment." }, "identity": { "type": "string", @@ -12428,6 +12426,18 @@ } } }, + "v1ComputeConfigScalingGroupUpdate": { + "type": "object", + "properties": { + "scalingGroup": { + "$ref": "#/definitions/v1ComputeConfigScalingGroup" + }, + "updateMask": { + "type": "string", + "title": "Controls which fields from `scaling_group` will be applied. Semantics:\n- Mask is ignored for new scaling groups (only applicable when scaling group already exists).\n- Empty mask for an existing scaling group is no-op: no change.\n- Non-empty mask for an existing scaling group will update/unset only to the fields\n mentioned in the mask.\n- Accepted paths: \"task_queue_types\", \"provider\", \"provider.type\", \"provider.details\",\n \"provider.nexus_endpoint\", \"scaler\", \"scaler.type\", \"scaler.details\"" + } + } + }, "v1ComputeProvider": { "type": "object", "properties": { diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 1fd403f02..b37f5a8cb 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -9405,6 +9405,22 @@ components: description: |- Informs a worker lifecycle controller *when* and *how often* to perform certain worker lifecycle actions like starting a serverless worker. + ComputeConfigScalingGroupUpdate: + type: object + properties: + scalingGroup: + $ref: '#/components/schemas/ComputeConfigScalingGroup' + updateMask: + type: string + description: |- + Controls which fields from `scaling_group` will be applied. Semantics: + - Mask is ignored for new scaling groups (only applicable when scaling group already exists). + - Empty mask for an existing scaling group is no-op: no change. + - Non-empty mask for an existing scaling group will update/unset only to the fields + mentioned in the mask. + - Accepted paths: "task_queue_types", "provider", "provider.type", "provider.details", + "provider.nexus_endpoint", "scaler", "scaler.type", "scaler.details" + format: field-mask ComputeProvider: type: object properties: @@ -15404,7 +15420,7 @@ components: computeConfigScalingGroups: type: object additionalProperties: - $ref: '#/components/schemas/UpdateWorkerDeploymentVersionComputeConfigRequest_ScalingGroupUpdate' + $ref: '#/components/schemas/ComputeConfigScalingGroupUpdate' description: |- Optional. Contains the compute config scaling groups to add or updated for the Worker Deployment. @@ -15423,15 +15439,6 @@ components: If a second request with the same ID is recieved, it is considered a successful no-op. Retrying with a different request ID for the same deployment name + build ID is an error. description: Used to update the compute config of a Worker Deployment Version. - UpdateWorkerDeploymentVersionComputeConfigRequest_ScalingGroupUpdate: - type: object - properties: - scalingGroup: - $ref: '#/components/schemas/ComputeConfigScalingGroup' - updateMask: - type: string - description: Controls which fields from `scaling_group` will be applied - format: field-mask UpdateWorkerDeploymentVersionComputeConfigResponse: type: object properties: {} @@ -15610,10 +15617,18 @@ components: allOf: - $ref: '#/components/schemas/WorkerDeploymentVersion' description: Required. - computeConfig: - allOf: - - $ref: '#/components/schemas/ComputeConfig' - description: Required. Contains the new worker compute configuration for the Worker Deployment. + computeConfigScalingGroups: + type: object + additionalProperties: + $ref: '#/components/schemas/ComputeConfigScalingGroupUpdate' + description: |- + Optional. Contains the compute config scaling groups to add or updated for the Worker + Deployment. + removeComputeConfigScalingGroups: + type: array + items: + type: string + description: Optional. Contains the compute config scaling groups to remove from the Worker Deployment. identity: type: string description: Optional. The identity of the client who initiated this request. diff --git a/temporal/api/compute/v1/config.proto b/temporal/api/compute/v1/config.proto index 04909a854..73e481ea9 100644 --- a/temporal/api/compute/v1/config.proto +++ b/temporal/api/compute/v1/config.proto @@ -12,6 +12,7 @@ option csharp_namespace = "Temporalio.Api.Compute.V1"; import "temporal/api/compute/v1/provider.proto"; import "temporal/api/compute/v1/scaler.proto"; import "temporal/api/enums/v1/task_queue.proto"; +import "google/protobuf/field_mask.proto"; message ComputeConfigScalingGroup { // Optional. The set of task queue types this scaling group serves. @@ -43,3 +44,15 @@ message ComputeConfig { map scaling_groups = 1; } +message ComputeConfigScalingGroupUpdate { + ComputeConfigScalingGroup scaling_group = 1; + + // Controls which fields from `scaling_group` will be applied. Semantics: + // - Mask is ignored for new scaling groups (only applicable when scaling group already exists). + // - Empty mask for an existing scaling group is no-op: no change. + // - Non-empty mask for an existing scaling group will update/unset only to the fields + // mentioned in the mask. + // - Accepted paths: "task_queue_types", "provider", "provider.type", "provider.details", + // "provider.nexus_endpoint", "scaler", "scaler.type", "scaler.details" + google.protobuf.FieldMask update_mask = 2; +} diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 2f62582f0..3de8c8812 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2455,16 +2455,9 @@ message UpdateWorkerDeploymentVersionComputeConfigRequest { // Required. temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 2; - message ScalingGroupUpdate { - temporal.api.compute.v1.ComputeConfigScalingGroup scaling_group = 1; - - // Controls which fields from `scaling_group` will be applied - google.protobuf.FieldMask update_mask = 2; - } - // Optional. Contains the compute config scaling groups to add or updated for the Worker // Deployment. - map compute_config_scaling_groups = 6; + map compute_config_scaling_groups = 6; // Optional. Contains the compute config scaling groups to remove from the Worker Deployment. repeated string remove_compute_config_scaling_groups = 7; @@ -2488,8 +2481,12 @@ message ValidateWorkerDeploymentVersionComputeConfigRequest { // Required. temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 2; - // Required. Contains the new worker compute configuration for the Worker Deployment. - temporal.api.compute.v1.ComputeConfig compute_config = 4; + // Optional. Contains the compute config scaling groups to add or updated for the Worker + // Deployment. + map compute_config_scaling_groups = 6; + + // Optional. Contains the compute config scaling groups to remove from the Worker Deployment. + repeated string remove_compute_config_scaling_groups = 7; // Optional. The identity of the client who initiated this request. string identity = 3; From afcf82b0b71dc7918abac4721aebc4934b360474 Mon Sep 17 00:00:00 2001 From: Fred Tzeng Date: Tue, 31 Mar 2026 16:06:30 -0700 Subject: [PATCH 14/40] Added start delay to StartActivityExecutionRequest --- openapi/openapiv2.json | 4 ++++ openapi/openapiv3.yaml | 4 ++++ temporal/api/workflowservice/v1/request_response.proto | 2 ++ 3 files changed, 10 insertions(+) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index ddbc48c61..87db73f9c 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -9991,6 +9991,10 @@ "priority": { "$ref": "#/definitions/v1Priority", "description": "Priority metadata." + }, + "startDelay": { + "type": "string", + "description": "Time to wait before dispatching the first activity." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index cd503dccd..8f117e98e 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -13724,6 +13724,10 @@ components: allOf: - $ref: '#/components/schemas/Priority' description: Priority metadata. + startDelay: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Time to wait before dispatching the first activity. StartActivityExecutionResponse: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 2d9dd7b83..7a0938b0f 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2811,6 +2811,8 @@ message StartActivityExecutionRequest { temporal.api.sdk.v1.UserMetadata user_metadata = 17; // Priority metadata. temporal.api.common.v1.Priority priority = 18; + // Time to wait before dispatching the first activity. + google.protobuf.Duration start_delay = 19; } message StartActivityExecutionResponse { From b5cd9753f99ef690787d5c86977260dae4a11a2c Mon Sep 17 00:00:00 2001 From: ShahabT Date: Wed, 1 Apr 2026 16:10:05 -0700 Subject: [PATCH 15/40] cleanup for merging to master --- .github/workflows/trigger-api-go-update.yml | 1 - temporal/api/common/v1/message.proto | 9 --------- 2 files changed, 10 deletions(-) diff --git a/.github/workflows/trigger-api-go-update.yml b/.github/workflows/trigger-api-go-update.yml index 97008ca18..7a23b3c73 100644 --- a/.github/workflows/trigger-api-go-update.yml +++ b/.github/workflows/trigger-api-go-update.yml @@ -4,7 +4,6 @@ on: push: branches: - master - - serverless workflow_dispatch: inputs: branch: diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index 9788a43e0..88c3a834e 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -15,7 +15,6 @@ import "google/protobuf/empty.proto"; import "temporal/api/enums/v1/common.proto"; import "temporal/api/enums/v1/event_type.proto"; import "temporal/api/enums/v1/reset.proto"; -import "temporal/api/enums/v1/task_queue.proto"; message DataBlob { temporal.api.enums.v1.EncodingType encoding_type = 1; @@ -80,14 +79,6 @@ message ActivityType { string name = 1; } -// Uniquely identifies a combination of task queue name and type. -// (-- api-linter: core::0123::resource-annotation=disabled -// aip.dev/not-precedent: this isn't a resource --) -message TaskQueueNameType { - string name = 1; - temporal.api.enums.v1.TaskQueueType type = 2; -} - // How retries ought to be handled, usable by both workflows and activities message RetryPolicy { // Interval of the first retry. If retryBackoffCoefficient is 1.0 then it is used for all retries. From c26ebcd632fdfbfb41e3083376534ed6d980bacc Mon Sep 17 00:00:00 2001 From: Fred Tzeng Date: Wed, 1 Apr 2026 16:17:55 -0700 Subject: [PATCH 16/40] Add callbacks --- temporal/api/workflowservice/v1/request_response.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 7a0938b0f..c14e83cd5 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2813,6 +2813,9 @@ message StartActivityExecutionRequest { temporal.api.common.v1.Priority priority = 18; // Time to wait before dispatching the first activity. google.protobuf.Duration start_delay = 19; + // Callbacks to be called by the server when this activity reaches a terminal state. + // Callback addresses must be whitelisted in the server's dynamic configuration. + repeated temporal.api.common.v1.Callback completion_callbacks = 20; } message StartActivityExecutionResponse { From de4432de885804a001422f7678ce70fc8797c6a3 Mon Sep 17 00:00:00 2001 From: Fred Tzeng Date: Wed, 1 Apr 2026 16:22:53 -0700 Subject: [PATCH 17/40] Regen callback openapi --- openapi/openapiv2.json | 8 ++++++++ openapi/openapiv3.yaml | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 87db73f9c..ad7dc6dd7 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -9995,6 +9995,14 @@ "startDelay": { "type": "string", "description": "Time to wait before dispatching the first activity." + }, + "completionCallbacks": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Callback" + }, + "description": "Callbacks to be called by the server when this activity reaches a terminal state.\nCallback addresses must be whitelisted in the server's dynamic configuration." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 8f117e98e..60ee36382 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -13728,6 +13728,13 @@ components: pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ type: string description: Time to wait before dispatching the first activity. + completionCallbacks: + type: array + items: + $ref: '#/components/schemas/Callback' + description: |- + Callbacks to be called by the server when this activity reaches a terminal state. + Callback addresses must be whitelisted in the server's dynamic configuration. StartActivityExecutionResponse: type: object properties: From 9ddbe24d01190fbed767d086ae18fd652a5bd43d Mon Sep 17 00:00:00 2001 From: Fred Tzeng Date: Fri, 3 Apr 2026 10:04:50 -0700 Subject: [PATCH 18/40] Add links --- temporal/api/common/v1/message.proto | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index 88c3a834e..419f08f68 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -240,9 +240,17 @@ message Link { string job_id = 1; } + // A link to an activity. + message Activity { + string namespace = 1; + string activity_id = 2; + string run_id = 3; + } + oneof variant { WorkflowEvent workflow_event = 1; BatchJob batch_job = 2; + Activity activity = 3; } } From edb4bd591cb9ca3c82029e1056412187756a1413 Mon Sep 17 00:00:00 2001 From: Fred Tzeng Date: Fri, 3 Apr 2026 10:17:06 -0700 Subject: [PATCH 19/40] Add links to SAA --- openapi/openapiv2.json | 26 +++++++++++++++++++ openapi/openapiv3.yaml | 17 ++++++++++++ .../workflowservice/v1/request_response.proto | 2 ++ 3 files changed, 45 insertions(+) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index fd0907979..f0104f74e 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -8760,6 +8760,21 @@ }, "description": "Target a worker polling on a Nexus task queue in a specific namespace." }, + "LinkActivity": { + "type": "object", + "properties": { + "namespace": { + "type": "string" + }, + "activityId": { + "type": "string" + }, + "runId": { + "type": "string" + } + }, + "description": "A link to an activity." + }, "LinkBatchJob": { "type": "object", "properties": { @@ -10003,6 +10018,14 @@ "$ref": "#/definitions/v1Callback" }, "description": "Callbacks to be called by the server when this activity reaches a terminal state.\nCallback addresses must be whitelisted in the server's dynamic configuration." + }, + "links": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apiCommonV1Link" + }, + "description": "Links to be associated with the activity." } } }, @@ -13319,6 +13342,9 @@ }, "batchJob": { "$ref": "#/definitions/LinkBatchJob" + }, + "activity": { + "$ref": "#/definitions/LinkActivity" } }, "description": "Link can be associated with history events. It might contain information about an external entity\nrelated to the history event. For example, workflow A makes a Nexus call that starts workflow B:\nin this case, a history event in workflow A could contain a Link to the workflow started event in\nworkflow B, and vice-versa." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index bea00e27b..d28d301a9 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -10373,11 +10373,23 @@ components: $ref: '#/components/schemas/Link_WorkflowEvent' batchJob: $ref: '#/components/schemas/Link_BatchJob' + activity: + $ref: '#/components/schemas/Link_Activity' description: |- Link can be associated with history events. It might contain information about an external entity related to the history event. For example, workflow A makes a Nexus call that starts workflow B: in this case, a history event in workflow A could contain a Link to the workflow started event in workflow B, and vice-versa. + Link_Activity: + type: object + properties: + namespace: + type: string + activityId: + type: string + runId: + type: string + description: A link to an activity. Link_BatchJob: type: object properties: @@ -13735,6 +13747,11 @@ components: description: |- Callbacks to be called by the server when this activity reaches a terminal state. Callback addresses must be whitelisted in the server's dynamic configuration. + links: + type: array + items: + $ref: '#/components/schemas/Link' + description: Links to be associated with the activity. StartActivityExecutionResponse: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 637d04aea..7f79c4e3a 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2820,6 +2820,8 @@ message StartActivityExecutionRequest { // Callbacks to be called by the server when this activity reaches a terminal state. // Callback addresses must be whitelisted in the server's dynamic configuration. repeated temporal.api.common.v1.Callback completion_callbacks = 20; + // Links to be associated with the activity. + repeated temporal.api.common.v1.Link links = 21; } message StartActivityExecutionResponse { From 0552413d3394a375e11210849e9515bd4aa3d947 Mon Sep 17 00:00:00 2001 From: ShahabT Date: Fri, 3 Apr 2026 10:30:21 -0700 Subject: [PATCH 20/40] revert Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 965fa9b78..b4b33bdb5 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ STAMPDIR := .stamp COLOR := "\e[1;36m%s\e[0m\n" PROTO_ROOT := . -PROTO_FILES = $(shell find temporal -name "*.proto" -not -name "*.swp") +PROTO_FILES = $(shell find temporal -name "*.proto") PROTO_DIRS = $(sort $(dir $(PROTO_FILES))) PROTO_OUT := .gen PROTO_IMPORTS = \ From b30df06f138c3ac16af210889f12d7dd1180e779 Mon Sep 17 00:00:00 2001 From: Fred Tzeng Date: Tue, 31 Mar 2026 16:06:30 -0700 Subject: [PATCH 21/40] Added start delay to StartActivityExecutionRequest --- openapi/openapiv2.json | 4 ++++ openapi/openapiv3.yaml | 4 ++++ temporal/api/workflowservice/v1/request_response.proto | 2 ++ 3 files changed, 10 insertions(+) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 5b5719cc7..911d1f05a 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -9991,6 +9991,10 @@ "priority": { "$ref": "#/definitions/v1Priority", "description": "Priority metadata." + }, + "startDelay": { + "type": "string", + "description": "Time to wait before dispatching the first activity." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index c2dbbc15d..83dbaae8e 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -13724,6 +13724,10 @@ components: allOf: - $ref: '#/components/schemas/Priority' description: Priority metadata. + startDelay: + pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ + type: string + description: Time to wait before dispatching the first activity. StartActivityExecutionResponse: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 7bfcf236e..3edc93373 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2815,6 +2815,8 @@ message StartActivityExecutionRequest { temporal.api.sdk.v1.UserMetadata user_metadata = 17; // Priority metadata. temporal.api.common.v1.Priority priority = 18; + // Time to wait before dispatching the first activity. + google.protobuf.Duration start_delay = 19; } message StartActivityExecutionResponse { From f2bb6d79c3c4605451237724ab05193c9edf9bfe Mon Sep 17 00:00:00 2001 From: Fred Tzeng Date: Wed, 1 Apr 2026 16:17:55 -0700 Subject: [PATCH 22/40] Add callbacks --- temporal/api/workflowservice/v1/request_response.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 3edc93373..637d04aea 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2817,6 +2817,9 @@ message StartActivityExecutionRequest { temporal.api.common.v1.Priority priority = 18; // Time to wait before dispatching the first activity. google.protobuf.Duration start_delay = 19; + // Callbacks to be called by the server when this activity reaches a terminal state. + // Callback addresses must be whitelisted in the server's dynamic configuration. + repeated temporal.api.common.v1.Callback completion_callbacks = 20; } message StartActivityExecutionResponse { From c371682e227192843a26a1be1df055923bafb46c Mon Sep 17 00:00:00 2001 From: Fred Tzeng Date: Wed, 1 Apr 2026 16:22:53 -0700 Subject: [PATCH 23/40] Regen callback openapi --- openapi/openapiv2.json | 8 ++++++++ openapi/openapiv3.yaml | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 911d1f05a..fd0907979 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -9995,6 +9995,14 @@ "startDelay": { "type": "string", "description": "Time to wait before dispatching the first activity." + }, + "completionCallbacks": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Callback" + }, + "description": "Callbacks to be called by the server when this activity reaches a terminal state.\nCallback addresses must be whitelisted in the server's dynamic configuration." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 83dbaae8e..bea00e27b 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -13728,6 +13728,13 @@ components: pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$ type: string description: Time to wait before dispatching the first activity. + completionCallbacks: + type: array + items: + $ref: '#/components/schemas/Callback' + description: |- + Callbacks to be called by the server when this activity reaches a terminal state. + Callback addresses must be whitelisted in the server's dynamic configuration. StartActivityExecutionResponse: type: object properties: From 64fdd82aa5d722dbbac96c4570f680460f4ba8b7 Mon Sep 17 00:00:00 2001 From: Fred Tzeng Date: Fri, 3 Apr 2026 10:04:50 -0700 Subject: [PATCH 24/40] Add links --- temporal/api/common/v1/message.proto | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index 88c3a834e..419f08f68 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -240,9 +240,17 @@ message Link { string job_id = 1; } + // A link to an activity. + message Activity { + string namespace = 1; + string activity_id = 2; + string run_id = 3; + } + oneof variant { WorkflowEvent workflow_event = 1; BatchJob batch_job = 2; + Activity activity = 3; } } From 622a6720ffdb41e97597be87c9f9b85e793c423b Mon Sep 17 00:00:00 2001 From: Fred Tzeng Date: Fri, 3 Apr 2026 10:17:06 -0700 Subject: [PATCH 25/40] Add links to SAA --- openapi/openapiv2.json | 26 +++++++++++++++++++ openapi/openapiv3.yaml | 17 ++++++++++++ .../workflowservice/v1/request_response.proto | 2 ++ 3 files changed, 45 insertions(+) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index fd0907979..f0104f74e 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -8760,6 +8760,21 @@ }, "description": "Target a worker polling on a Nexus task queue in a specific namespace." }, + "LinkActivity": { + "type": "object", + "properties": { + "namespace": { + "type": "string" + }, + "activityId": { + "type": "string" + }, + "runId": { + "type": "string" + } + }, + "description": "A link to an activity." + }, "LinkBatchJob": { "type": "object", "properties": { @@ -10003,6 +10018,14 @@ "$ref": "#/definitions/v1Callback" }, "description": "Callbacks to be called by the server when this activity reaches a terminal state.\nCallback addresses must be whitelisted in the server's dynamic configuration." + }, + "links": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apiCommonV1Link" + }, + "description": "Links to be associated with the activity." } } }, @@ -13319,6 +13342,9 @@ }, "batchJob": { "$ref": "#/definitions/LinkBatchJob" + }, + "activity": { + "$ref": "#/definitions/LinkActivity" } }, "description": "Link can be associated with history events. It might contain information about an external entity\nrelated to the history event. For example, workflow A makes a Nexus call that starts workflow B:\nin this case, a history event in workflow A could contain a Link to the workflow started event in\nworkflow B, and vice-versa." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index bea00e27b..d28d301a9 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -10373,11 +10373,23 @@ components: $ref: '#/components/schemas/Link_WorkflowEvent' batchJob: $ref: '#/components/schemas/Link_BatchJob' + activity: + $ref: '#/components/schemas/Link_Activity' description: |- Link can be associated with history events. It might contain information about an external entity related to the history event. For example, workflow A makes a Nexus call that starts workflow B: in this case, a history event in workflow A could contain a Link to the workflow started event in workflow B, and vice-versa. + Link_Activity: + type: object + properties: + namespace: + type: string + activityId: + type: string + runId: + type: string + description: A link to an activity. Link_BatchJob: type: object properties: @@ -13735,6 +13747,11 @@ components: description: |- Callbacks to be called by the server when this activity reaches a terminal state. Callback addresses must be whitelisted in the server's dynamic configuration. + links: + type: array + items: + $ref: '#/components/schemas/Link' + description: Links to be associated with the activity. StartActivityExecutionResponse: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 637d04aea..7f79c4e3a 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2820,6 +2820,8 @@ message StartActivityExecutionRequest { // Callbacks to be called by the server when this activity reaches a terminal state. // Callback addresses must be whitelisted in the server's dynamic configuration. repeated temporal.api.common.v1.Callback completion_callbacks = 20; + // Links to be associated with the activity. + repeated temporal.api.common.v1.Link links = 21; } message StartActivityExecutionResponse { From 33aed66f8bc920e6d1d691f6dab0037ea9e2518a Mon Sep 17 00:00:00 2001 From: Jay Pipes Date: Thu, 19 Feb 2026 15:59:43 -0500 Subject: [PATCH 26/40] feature: add compute provider to worker deployment (#704) feature: introduce compute config Introduces a new `compute.v1` package of proto messages that house the various instructions and information needed by worker control plane controllers `temporal.api.compute.v1.ComputeConfig` has three fields, `task_queues`, `provider` and `scaler` that store the configuration information for the server-owned worker setup and how the worker control plane should treat worker lifecycle events (such as when no pollers exist for a task queue that has received a task). The `temporal.api.compute.v1.ComputeConfig.task_queues` field is a list of task queue name and task type tuples. When Temporal Server receives a task with any of these name+type combinations and finds no active pollers, it will trigger a launch of a server-owned Worker using the configuration information in the `provider` field. The `temporal.api.compute.v1.ComputeConfig.provider` field is of type `temporal.api.compute.v1.ComputeProvider`. This message is a simple wrapper around a blob of bytes that contains configuration settings for a worker control plane controller. The configuration settings for the worker control plane controller are specific to different compute providers. The first compute provider we are modeling is AWS Lambda, and the `ProviderDetailAWSLambda` message houses the ARN of the AWS Lambda Function to be invoked and an optional ARN of the IAM Role that should be assumed by a worker control plane controller when invoking the function. The `temporal.api.compute.v1.ComputeConfig.scaler` field is of type `temporal.api.compute.v1.ComputeScaler`. This message contains instructions for when the worker lifecycle controller should scale up or down the number of workers in a WorkerDeployment or WorkerDeploymentVersion. Adds a new field `compute_config` to `WorkerDeploymentInfo` and `WorkerDeploymentVersionInfo` that contains a `temporal.api.compute.v1.ComputeConfig` message. Both WorkerDeployment and WorkerDeploymentVersion have this field in order to handle versioned workers properly. For example, if the user wants to use PINNED temporal versioning, they will be creating a WorkerDeploymentVersion that is specific to, say, a qualified Lambda Function ARN. Therefore we need to place compute provider configuration on a WorkerDeploymentVersion in addition to WorkerDeployment. Adds three new gRPC API methods to WorkflowService: * `CreateWorkerDeployment` creates a new WorkerDeployment containing the supplied compute configuration. * `UpdateWorkerDeploymentComputeConfig` updates an existing WorkerDeployment's compute configuration. * `UpdateWorkerDeploymentComputeConfig` updates an existing WorkerDeploymentVersion's compute configuration. Signed-off-by: Jay Pipes Signed-off-by: Jay Pipes --- .gitignore | 4 +- Makefile | 2 +- openapi/openapiv2.json | 202 +++++++++++++++ openapi/openapiv3.yaml | 241 ++++++++++++++++++ temporal/api/common/v1/message.proto | 9 + temporal/api/compute/v1/config.proto | 31 +++ temporal/api/compute/v1/provider.proto | 40 +++ temporal/api/compute/v1/scaler.proto | 22 ++ temporal/api/deployment/v1/message.proto | 11 +- .../workflowservice/v1/request_response.proto | 32 +++ temporal/api/workflowservice/v1/service.proto | 15 ++ 11 files changed, 606 insertions(+), 3 deletions(-) create mode 100644 temporal/api/compute/v1/config.proto create mode 100644 temporal/api/compute/v1/provider.proto create mode 100644 temporal/api/compute/v1/scaler.proto diff --git a/.gitignore b/.gitignore index 8655883e5..efbf7b661 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ /.gen /.vscode /.stamp -*~ \ No newline at end of file +*~ +*.swp +*.swo diff --git a/Makefile b/Makefile index b4b33bdb5..965fa9b78 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ STAMPDIR := .stamp COLOR := "\e[1;36m%s\e[0m\n" PROTO_ROOT := . -PROTO_FILES = $(shell find temporal -name "*.proto") +PROTO_FILES = $(shell find temporal -name "*.proto" -not -name "*.swp") PROTO_DIRS = $(sort $(dir $(PROTO_FILES))) PROTO_OUT := .gen PROTO_IMPORTS = \ diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index f0104f74e..c6c6bb2aa 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -2488,6 +2488,51 @@ "tags": [ "WorkflowService" ] + }, + "post": { + "summary": "Creates a new Worker Deployment.", + "description": "Experimental. This API might significantly change or be removed in a\nfuture release.", + "operationId": "CreateWorkerDeployment2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CreateWorkerDeploymentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentName", + "description": "The name of the Worker Deployment to create. If a Worker Deployment with\nthis name already exists, an error will be returned.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceCreateWorkerDeploymentBody" + } + } + ], + "tags": [ + "WorkflowService" + ] } }, "/api/v1/namespaces/{namespace}/worker-deployments/{deploymentName}/set-current-version": { @@ -6988,6 +7033,51 @@ "tags": [ "WorkflowService" ] + }, + "post": { + "summary": "Creates a new Worker Deployment.", + "description": "Experimental. This API might significantly change or be removed in a\nfuture release.", + "operationId": "CreateWorkerDeployment", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CreateWorkerDeploymentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentName", + "description": "The name of the Worker Deployment to create. If a Worker Deployment with\nthis name already exists, an error will be returned.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceCreateWorkerDeploymentBody" + } + } + ], + "tags": [ + "WorkflowService" + ] } }, "/namespaces/{namespace}/worker-deployments/{deploymentName}/set-current-version": { @@ -9159,6 +9249,28 @@ } } }, + "WorkflowServiceCreateWorkerDeploymentBody": { + "type": "object", + "properties": { + "workerVersioningMode": { + "$ref": "#/definitions/v1WorkerVersioningMode", + "description": "Optional. Indicates the Worker Deployment should use a particular\nversioning strategy.\n\nIf empty, defaults to UNVERSIONED." + }, + "computeConfig": { + "$ref": "#/definitions/v1ComputeConfig", + "description": "Optional. Contains the new worker compute configuration for the Worker\nDeployment. Used as the default compute configuration for new Worker\nDeployment Versions created for this Worker Deployment." + }, + "identity": { + "type": "string", + "description": "Optional. The identity of the client who initiated this request." + }, + "requestId": { + "type": "string", + "description": "A unique identifier for this create request for idempotence. Typically UUIDv4." + } + }, + "description": "Creates a new WorkerDeployment." + }, "WorkflowServiceCreateWorkflowRuleBody": { "type": "object", "properties": { @@ -11931,6 +12043,66 @@ }, "description": "Used by the worker versioning APIs, represents an unordered set of one or more versions which are\nconsidered to be compatible with each other. Currently the versions are always worker build IDs." }, + "v1ComputeConfig": { + "type": "object", + "properties": { + "taskQueues": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1TaskQueueNameType" + }, + "description": "When a task matching any of these task queue name + type tuples is\nreceived by the Temporal Server and there are no active pollers to send\nthe task to, workers will be launched using the configuration\ninformation in the provider field." + }, + "provider": { + "$ref": "#/definitions/v1ComputeProvider", + "description": "Stores instructions for a worker control plane controller how to respond\nto worker lifeycle events." + }, + "scaler": { + "$ref": "#/definitions/v1ComputeScaler", + "description": "Informs a worker lifecycle controller *when* and *how often* to perform\ncertain worker lifecycle actions like starting a serverless worker." + } + }, + "description": "ComputeConfig stores configuration that helps a worker control plane\ncontroller understand *when* and *how* to respond to worker lifecycle\nevents." + }, + "v1ComputeProvider": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of the compute provider. This string is implementation-specific and\ncan be used by implementations to understand how to interpret the\ncontents of the provider_details field." + }, + "detailJson": { + "type": "string", + "title": "will be an unencrypted, JSON-encoded object of provider-specific\ninformation" + }, + "detailPayload": { + "$ref": "#/definitions/v1Payload", + "description": "will be an encrypted, encoded bytestring containing\nprovider-specific information. The implementation must understand\nhow to decrypt the payload." + }, + "nexusEndpoint": { + "type": "string", + "description": "Optional. If the compute provider is a Nexus service, this should point\nthere." + } + }, + "description": "ComputeProvider stores information used by a worker control plane controller\nto respond to worker lifecycle events. For example, when a Task is received\non a TaskQueue that has no active pollers, a serverless worker lifecycle\ncontroller might need to invoke an AWS Lambda Function that itself ends up\ncalling the SDK's worker.New() function." + }, + "v1ComputeScaler": { + "type": "object", + "properties": { + "minInstances": { + "type": "integer", + "format": "int32", + "description": "The lower limit for the number of Workers (in the WorkerDeployment) to\nwhich the ComputeScaler can scale down." + }, + "maxInstances": { + "type": "integer", + "format": "int32", + "description": "The upper limit for the number of Workers (in the WorkerDeployment) to\nwhich the ComputeScaler can scale up. Must be greater than or equal to\nmin_instances." + } + }, + "description": "ComputeScaler instructs the Temporal Service when to scale up or down the number of\nWorkers that comprise a WorkerDeployment." + }, "v1ConfigMetadata": { "type": "object", "properties": { @@ -12098,6 +12270,16 @@ } } }, + "v1CreateWorkerDeploymentResponse": { + "type": "object", + "properties": { + "conflictToken": { + "type": "string", + "format": "byte", + "description": "This value is returned so that it can be optionally passed to APIs that\nwrite to the WorkerDeployment state to ensure that the state did not\nchange between this API call and a future write." + } + } + }, "v1CreateWorkflowRuleResponse": { "type": "object", "properties": { @@ -16137,6 +16319,18 @@ "default": "TASK_QUEUE_KIND_UNSPECIFIED", "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." }, + "v1TaskQueueNameType": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/v1TaskQueueType" + } + }, + "description": "Uniquely identifies a combination of task queue name and type." + }, "v1TaskQueueReachability": { "type": "object", "properties": { @@ -16807,6 +17001,10 @@ "routingConfigUpdateState": { "$ref": "#/definitions/v1RoutingConfigUpdateState", "description": "Indicates whether the routing_config has been fully propagated to all\nrelevant task queues and their partitions." + }, + "computeConfig": { + "$ref": "#/definitions/v1ComputeConfig", + "description": "Contains information used by worker control plane controllers to handle\nscale events." } }, "description": "A Worker Deployment (Deployment, for short) represents all workers serving \na shared set of Task Queues. Typically, a Deployment represents one service or \napplication.\nA Deployment contains multiple Deployment Versions, each representing a different \nversion of workers. (see documentation of WorkerDeploymentVersionInfo)\nDeployment records are created in Temporal server automatically when their\nfirst poller arrives to the server.\nExperimental. Worker Deployments are experimental and might significantly change in the future." @@ -16915,6 +17113,10 @@ "metadata": { "$ref": "#/definitions/v1VersionMetadata", "description": "Arbitrary user-provided metadata attached to this version." + }, + "computeConfig": { + "$ref": "#/definitions/v1ComputeConfig", + "description": "Contains information used by worker control plane controllers to handle\nscale events." } }, "description": "A Worker Deployment Version (Version, for short) represents all workers of the same \ncode and config within a Deployment. Workers of the same Version are expected to \nbehave exactly the same so when executions move between them there are no \nnon-determinism issues.\nWorker Deployment Versions are created in Temporal server automatically when \ntheir first poller arrives to the server.\nExperimental. Worker Deployments are experimental and might significantly change in the future." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index d28d301a9..28deb5157 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -2203,6 +2203,48 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + post: + tags: + - WorkflowService + description: |- + Creates a new Worker Deployment. + + Experimental. This API might significantly change or be removed in a + future release. + operationId: CreateWorkerDeployment + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deploymentName + in: path + description: |- + The name of the Worker Deployment to create. If a Worker Deployment with + this name already exists, an error will be returned. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWorkerDeploymentRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWorkerDeploymentResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' delete: tags: - WorkflowService @@ -6236,6 +6278,48 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + post: + tags: + - WorkflowService + description: |- + Creates a new Worker Deployment. + + Experimental. This API might significantly change or be removed in a + future release. + operationId: CreateWorkerDeployment + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deploymentName + in: path + description: |- + The name of the Worker Deployment to create. If a Worker Deployment with + this name already exists, an error will be returned. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWorkerDeploymentRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWorkerDeploymentResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' delete: tags: - WorkflowService @@ -9031,6 +9115,88 @@ components: description: |- Used by the worker versioning APIs, represents an unordered set of one or more versions which are considered to be compatible with each other. Currently the versions are always worker build IDs. + ComputeConfig: + type: object + properties: + taskQueues: + type: array + items: + $ref: '#/components/schemas/TaskQueueNameType' + description: |- + When a task matching any of these task queue name + type tuples is + received by the Temporal Server and there are no active pollers to send + the task to, workers will be launched using the configuration + information in the provider field. + provider: + allOf: + - $ref: '#/components/schemas/ComputeProvider' + description: |- + Stores instructions for a worker control plane controller how to respond + to worker lifeycle events. + scaler: + allOf: + - $ref: '#/components/schemas/ComputeScaler' + description: |- + Informs a worker lifecycle controller *when* and *how often* to perform + certain worker lifecycle actions like starting a serverless worker. + description: |- + ComputeConfig stores configuration that helps a worker control plane + controller understand *when* and *how* to respond to worker lifecycle + events. + ComputeProvider: + type: object + properties: + type: + type: string + description: |- + Type of the compute provider. This string is implementation-specific and + can be used by implementations to understand how to interpret the + contents of the provider_details field. + detailJson: + type: string + description: |- + will be an unencrypted, JSON-encoded object of provider-specific + information + (-- api-linter: core::0146::any=disabled + aip.dev/not-precedent: This needs to be extensible to + externally-written compute providers --) + detailPayload: + allOf: + - $ref: '#/components/schemas/Payload' + description: |- + will be an encrypted, encoded bytestring containing + provider-specific information. The implementation must understand + how to decrypt the payload. + nexusEndpoint: + type: string + description: |- + Optional. If the compute provider is a Nexus service, this should point + there. + description: |- + ComputeProvider stores information used by a worker control plane controller + to respond to worker lifecycle events. For example, when a Task is received + on a TaskQueue that has no active pollers, a serverless worker lifecycle + controller might need to invoke an AWS Lambda Function that itself ends up + calling the SDK's worker.New() function. + ComputeScaler: + type: object + properties: + minInstances: + type: integer + description: |- + The lower limit for the number of Workers (in the WorkerDeployment) to + which the ComputeScaler can scale down. + format: int32 + maxInstances: + type: integer + description: |- + The upper limit for the number of Workers (in the WorkerDeployment) to + which the ComputeScaler can scale up. Must be greater than or equal to + min_instances. + format: int32 + description: |- + ComputeScaler instructs the Temporal Service when to scale up or down the number of + Workers that comprise a WorkerDeployment. ConfigMetadata: type: object properties: @@ -9179,6 +9345,52 @@ components: conflictToken: type: string format: bytes + CreateWorkerDeploymentRequest: + type: object + properties: + namespace: + type: string + deploymentName: + type: string + description: |- + The name of the Worker Deployment to create. If a Worker Deployment with + this name already exists, an error will be returned. + workerVersioningMode: + enum: + - WORKER_VERSIONING_MODE_UNSPECIFIED + - WORKER_VERSIONING_MODE_UNVERSIONED + - WORKER_VERSIONING_MODE_VERSIONED + type: string + description: |- + Optional. Indicates the Worker Deployment should use a particular + versioning strategy. + + If empty, defaults to UNVERSIONED. + format: enum + computeConfig: + allOf: + - $ref: '#/components/schemas/ComputeConfig' + description: |- + Optional. Contains the new worker compute configuration for the Worker + Deployment. Used as the default compute configuration for new Worker + Deployment Versions created for this Worker Deployment. + identity: + type: string + description: Optional. The identity of the client who initiated this request. + requestId: + type: string + description: A unique identifier for this create request for idempotence. Typically UUIDv4. + description: Creates a new WorkerDeployment. + CreateWorkerDeploymentResponse: + type: object + properties: + conflictToken: + type: string + description: |- + This value is returned so that it can be optionally passed to APIs that + write to the WorkerDeployment state to ensure that the state did not + change between this API call and a future write. + format: bytes CreateWorkflowRuleRequest: type: object properties: @@ -14234,6 +14446,23 @@ components: type: number format: float description: If set, overrides the fairness weights for the corresponding fairness keys. + TaskQueueNameType: + type: object + properties: + name: + type: string + type: + enum: + - TASK_QUEUE_TYPE_UNSPECIFIED + - TASK_QUEUE_TYPE_WORKFLOW + - TASK_QUEUE_TYPE_ACTIVITY + - TASK_QUEUE_TYPE_NEXUS + type: string + format: enum + description: |- + Uniquely identifies a combination of task queue name and type. + (-- api-linter: core::0123::resource-annotation=disabled + aip.dev/not-precedent: this isn't a resource --) TaskQueueReachability: type: object properties: @@ -15311,6 +15540,12 @@ components: Indicates whether the routing_config has been fully propagated to all relevant task queues and their partitions. format: enum + computeConfig: + allOf: + - $ref: '#/components/schemas/ComputeConfig' + description: |- + Contains information used by worker control plane controllers to handle + scale events. description: "A Worker Deployment (Deployment, for short) represents all workers serving \n a shared set of Task Queues. Typically, a Deployment represents one service or \n application.\n A Deployment contains multiple Deployment Versions, each representing a different \n version of workers. (see documentation of WorkerDeploymentVersionInfo)\n Deployment records are created in Temporal server automatically when their\n first poller arrives to the server.\n Experimental. Worker Deployments are experimental and might significantly change in the future." WorkerDeploymentInfo_WorkerDeploymentVersionSummary: type: object @@ -15522,6 +15757,12 @@ components: allOf: - $ref: '#/components/schemas/VersionMetadata' description: Arbitrary user-provided metadata attached to this version. + computeConfig: + allOf: + - $ref: '#/components/schemas/ComputeConfig' + description: |- + Contains information used by worker control plane controllers to handle + scale events. description: "A Worker Deployment Version (Version, for short) represents all workers of the same \n code and config within a Deployment. Workers of the same Version are expected to \n behave exactly the same so when executions move between them there are no \n non-determinism issues.\n Worker Deployment Versions are created in Temporal server automatically when \n their first poller arrives to the server.\n Experimental. Worker Deployments are experimental and might significantly change in the future." WorkerDeploymentVersionInfo_VersionTaskQueueInfo: type: object diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index 419f08f68..ce8825e6a 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -15,6 +15,7 @@ import "google/protobuf/empty.proto"; import "temporal/api/enums/v1/common.proto"; import "temporal/api/enums/v1/event_type.proto"; import "temporal/api/enums/v1/reset.proto"; +import "temporal/api/enums/v1/task_queue.proto"; message DataBlob { temporal.api.enums.v1.EncodingType encoding_type = 1; @@ -79,6 +80,14 @@ message ActivityType { string name = 1; } +// Uniquely identifies a combination of task queue name and type. +// (-- api-linter: core::0123::resource-annotation=disabled +// aip.dev/not-precedent: this isn't a resource --) +message TaskQueueNameType { + string name = 1; + temporal.api.enums.v1.TaskQueueType type = 2; +} + // How retries ought to be handled, usable by both workflows and activities message RetryPolicy { // Interval of the first retry. If retryBackoffCoefficient is 1.0 then it is used for all retries. diff --git a/temporal/api/compute/v1/config.proto b/temporal/api/compute/v1/config.proto new file mode 100644 index 000000000..0055defd0 --- /dev/null +++ b/temporal/api/compute/v1/config.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package temporal.api.compute.v1; + +option go_package = "go.temporal.io/api/compute/v1;compute"; +option java_package = "io.temporal.api.compute.v1"; +option java_multiple_files = true; +option java_outer_classname = "ConfigProto"; +option ruby_package = "Temporalio::Api::Compute::V1"; +option csharp_namespace = "Temporalio.Api.Compute.V1"; + +import "temporal/api/compute/v1/provider.proto"; +import "temporal/api/compute/v1/scaler.proto"; +import "temporal/api/common/v1/message.proto"; + +// ComputeConfig stores configuration that helps a worker control plane +// controller understand *when* and *how* to respond to worker lifecycle +// events. +message ComputeConfig { + // When a task matching any of these task queue name + type tuples is + // received by the Temporal Server and there are no active pollers to send + // the task to, workers will be launched using the configuration + // information in the provider field. + repeated temporal.api.common.v1.TaskQueueNameType task_queues = 1; + // Stores instructions for a worker control plane controller how to respond + // to worker lifeycle events. + temporal.api.compute.v1.ComputeProvider provider = 2; + // Informs a worker lifecycle controller *when* and *how often* to perform + // certain worker lifecycle actions like starting a serverless worker. + temporal.api.compute.v1.ComputeScaler scaler = 3; +} diff --git a/temporal/api/compute/v1/provider.proto b/temporal/api/compute/v1/provider.proto new file mode 100644 index 000000000..0ce446f6a --- /dev/null +++ b/temporal/api/compute/v1/provider.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; + +package temporal.api.compute.v1; + +option go_package = "go.temporal.io/api/compute/v1;compute"; +option java_package = "io.temporal.api.compute.v1"; +option java_multiple_files = true; +option java_outer_classname = "ProviderProto"; +option ruby_package = "Temporalio::Api::Compute::V1"; +option csharp_namespace = "Temporalio.Api.Compute.V1"; + +import "temporal/api/common/v1/message.proto"; + +// ComputeProvider stores information used by a worker control plane controller +// to respond to worker lifecycle events. For example, when a Task is received +// on a TaskQueue that has no active pollers, a serverless worker lifecycle +// controller might need to invoke an AWS Lambda Function that itself ends up +// calling the SDK's worker.New() function. +message ComputeProvider { + // Type of the compute provider. This string is implementation-specific and + // can be used by implementations to understand how to interpret the + // contents of the provider_details field. + string type = 1; + // Contains provider-specific instructions and configuration. + oneof detail { + // will be an unencrypted, JSON-encoded object of provider-specific + // information + // (-- api-linter: core::0146::any=disabled + // aip.dev/not-precedent: This needs to be extensible to + // externally-written compute providers --) + string detail_json = 2; + // will be an encrypted, encoded bytestring containing + // provider-specific information. The implementation must understand + // how to decrypt the payload. + temporal.api.common.v1.Payload detail_payload = 3; + } + // Optional. If the compute provider is a Nexus service, this should point + // there. + string nexus_endpoint = 10; +} diff --git a/temporal/api/compute/v1/scaler.proto b/temporal/api/compute/v1/scaler.proto new file mode 100644 index 000000000..7fbb7da74 --- /dev/null +++ b/temporal/api/compute/v1/scaler.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +package temporal.api.compute.v1; + +option go_package = "go.temporal.io/api/compute/v1;compute"; +option java_package = "io.temporal.api.compute.v1"; +option java_multiple_files = true; +option java_outer_classname = "ScalerProto"; +option ruby_package = "Temporalio::Api::Compute::V1"; +option csharp_namespace = "Temporalio.Api.Compute.V1"; + +// ComputeScaler instructs the Temporal Service when to scale up or down the number of +// Workers that comprise a WorkerDeployment. +message ComputeScaler { + // The lower limit for the number of Workers (in the WorkerDeployment) to + // which the ComputeScaler can scale down. + int32 min_instances = 1; + // The upper limit for the number of Workers (in the WorkerDeployment) to + // which the ComputeScaler can scale up. Must be greater than or equal to + // min_instances. + int32 max_instances = 2; +} diff --git a/temporal/api/deployment/v1/message.proto b/temporal/api/deployment/v1/message.proto index b4b7883dd..a42a1a50f 100644 --- a/temporal/api/deployment/v1/message.proto +++ b/temporal/api/deployment/v1/message.proto @@ -14,6 +14,7 @@ import "google/protobuf/timestamp.proto"; import "temporal/api/enums/v1/deployment.proto"; import "temporal/api/enums/v1/task_queue.proto"; import "temporal/api/common/v1/message.proto"; +import "temporal/api/compute/v1/config.proto"; // Worker Deployment options set in SDK that need to be sent to server in every poll. // Experimental. Worker Deployments are experimental and might significantly change in the future. @@ -158,6 +159,10 @@ message WorkerDeploymentVersionInfo { // Arbitrary user-provided metadata attached to this version. VersionMetadata metadata = 10; + + // Contains information used by worker control plane controllers to handle + // scale events. + temporal.api.compute.v1.ComputeConfig compute_config = 20; } // Information about workflow drainage to help the user determine when it is safe @@ -211,6 +216,10 @@ message WorkerDeploymentInfo { // relevant task queues and their partitions. temporal.api.enums.v1.RoutingConfigUpdateState routing_config_update_state = 7; + // Contains information used by worker control plane controllers to handle + // scale events. + temporal.api.compute.v1.ComputeConfig compute_config = 20; + message WorkerDeploymentVersionSummary { // Deprecated. Use `deployment_version`. string version = 1 [deprecated = true]; @@ -311,4 +320,4 @@ message InheritedAutoUpgradeInfo { temporal.api.deployment.v1.WorkerDeploymentVersion source_deployment_version = 1; // The revision number of the source deployment version of the parent/previous workflow. int64 source_deployment_revision_number = 2; -} \ No newline at end of file +} diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 7f79c4e3a..be81f10f8 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -25,6 +25,7 @@ import "temporal/api/common/v1/message.proto"; import "temporal/api/history/v1/message.proto"; import "temporal/api/workflow/v1/message.proto"; import "temporal/api/command/v1/message.proto"; +import "temporal/api/compute/v1/config.proto"; import "temporal/api/deployment/v1/message.proto"; import "temporal/api/failure/v1/message.proto"; import "temporal/api/filter/v1/message.proto"; @@ -2344,6 +2345,37 @@ message SetWorkerDeploymentRampingVersionResponse { float previous_percentage = 3 [deprecated = true]; } +// Creates a new WorkerDeployment. +message CreateWorkerDeploymentRequest { + string namespace = 1; + // The name of the Worker Deployment to create. If a Worker Deployment with + // this name already exists, an error will be returned. + string deployment_name = 2; + + // Optional. Indicates the Worker Deployment should use a particular + // versioning strategy. + // + // If empty, defaults to UNVERSIONED. + temporal.api.enums.v1.WorkerVersioningMode worker_versioning_mode = 3; + + // Optional. Contains the new worker compute configuration for the Worker + // Deployment. Used as the default compute configuration for new Worker + // Deployment Versions created for this Worker Deployment. + temporal.api.compute.v1.ComputeConfig compute_config = 6; + + // Optional. The identity of the client who initiated this request. + string identity = 15; + // A unique identifier for this create request for idempotence. Typically UUIDv4. + string request_id = 16; +} + +message CreateWorkerDeploymentResponse { + // This value is returned so that it can be optionally passed to APIs that + // write to the WorkerDeployment state to ensure that the state did not + // change between this API call and a future write. + bytes conflict_token = 1; +} + message ListWorkerDeploymentsRequest { string namespace = 1; int32 page_size = 2; diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 18e579c2c..5ddbb7b52 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1116,6 +1116,21 @@ service WorkflowService { }; } + // Creates a new Worker Deployment. + // + // Experimental. This API might significantly change or be removed in a + // future release. + rpc CreateWorkerDeployment (CreateWorkerDeploymentRequest) returns (CreateWorkerDeploymentResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/worker-deployments/{deployment_name}" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/worker-deployments/{deployment_name}" + body: "*" + } + }; + } + // Updates the user-given metadata attached to a Worker Deployment Version. // Experimental. This API might significantly change or be removed in a future release. rpc UpdateWorkerDeploymentVersionMetadata (UpdateWorkerDeploymentVersionMetadataRequest) returns (UpdateWorkerDeploymentVersionMetadataResponse) { From c8fe93048722a24478fddbc5e3d11f3a00a189cd Mon Sep 17 00:00:00 2001 From: ShahabT Date: Fri, 20 Feb 2026 12:15:02 -0800 Subject: [PATCH 27/40] Cleanup WD compute config initial protos --- temporal/api/compute/v1/config.proto | 9 ++------- temporal/api/deployment/v1/message.proto | 14 +++++--------- .../api/workflowservice/v1/request_response.proto | 12 +++--------- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/temporal/api/compute/v1/config.proto b/temporal/api/compute/v1/config.proto index 0055defd0..712c617bc 100644 --- a/temporal/api/compute/v1/config.proto +++ b/temporal/api/compute/v1/config.proto @@ -17,15 +17,10 @@ import "temporal/api/common/v1/message.proto"; // controller understand *when* and *how* to respond to worker lifecycle // events. message ComputeConfig { - // When a task matching any of these task queue name + type tuples is - // received by the Temporal Server and there are no active pollers to send - // the task to, workers will be launched using the configuration - // information in the provider field. - repeated temporal.api.common.v1.TaskQueueNameType task_queues = 1; // Stores instructions for a worker control plane controller how to respond // to worker lifeycle events. - temporal.api.compute.v1.ComputeProvider provider = 2; + temporal.api.compute.v1.ComputeProvider provider = 1; // Informs a worker lifecycle controller *when* and *how often* to perform // certain worker lifecycle actions like starting a serverless worker. - temporal.api.compute.v1.ComputeScaler scaler = 3; + temporal.api.compute.v1.ComputeScaler scaler = 2; } diff --git a/temporal/api/deployment/v1/message.proto b/temporal/api/deployment/v1/message.proto index a42a1a50f..11a2ccfa2 100644 --- a/temporal/api/deployment/v1/message.proto +++ b/temporal/api/deployment/v1/message.proto @@ -159,10 +159,6 @@ message WorkerDeploymentVersionInfo { // Arbitrary user-provided metadata attached to this version. VersionMetadata metadata = 10; - - // Contains information used by worker control plane controllers to handle - // scale events. - temporal.api.compute.v1.ComputeConfig compute_config = 20; } // Information about workflow drainage to help the user determine when it is safe @@ -193,8 +189,8 @@ message WorkerDeploymentInfo { // Deployment Versions that are currently tracked in this Deployment. A DeploymentVersion will be // cleaned up automatically if all the following conditions meet: // - It does not receive new executions (is not current or ramping) - // - It has no active pollers (see WorkerDeploymentVersionInfo.pollers_status) - // - It is drained (see WorkerDeploymentVersionInfo.drainage_status) + // - It has no active pollers (see WorkerDeploymentVersionInfo.pollers_status) + // - It is drained (see WorkerDeploymentVersionInfo.drainage_status) repeated WorkerDeploymentVersionSummary version_summaries = 2; google.protobuf.Timestamp create_time = 3; @@ -218,7 +214,7 @@ message WorkerDeploymentInfo { // Contains information used by worker control plane controllers to handle // scale events. - temporal.api.compute.v1.ComputeConfig compute_config = 20; + temporal.api.compute.v1.ComputeConfig compute_config = 20; message WorkerDeploymentVersionSummary { // Deprecated. Use `deployment_version`. @@ -280,7 +276,7 @@ message VersionMetadata { message RoutingConfig { // Specifies which Deployment Version should receive new workflow executions and tasks of // existing unversioned or AutoUpgrade workflows. - // Nil value means no Version in this Deployment (except Ramping Version, if present) receives traffic other than tasks of previously Pinned workflows. In absence of a Current Version, remaining traffic after any ramp (if set) goes to unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.). + // Nil value means no Version in this Deployment (except Ramping Version, if present) receives traffic other than tasks of previously Pinned workflows. In absence of a Current Version, remaining traffic after any ramp (if set) goes to unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.). // Note: Current Version is overridden by the Ramping Version for a portion of traffic when ramp percentage // is non-zero (see `ramping_deployment_version` and `ramping_version_percentage`). temporal.api.deployment.v1.WorkerDeploymentVersion current_deployment_version = 7; @@ -308,7 +304,7 @@ message RoutingConfig { // Last time ramping version percentage was changed. // If ramping version is changed, this is also updated, even if the percentage stays the same. google.protobuf.Timestamp ramping_version_percentage_changed_time = 6; - // Monotonically increasing value which is incremented on every mutation + // Monotonically increasing value which is incremented on every mutation // to any field of this message to achieve eventual consistency between task queues and their partitions. int64 revision_number = 10; } diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index be81f10f8..780ccec7f 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2352,21 +2352,15 @@ message CreateWorkerDeploymentRequest { // this name already exists, an error will be returned. string deployment_name = 2; - // Optional. Indicates the Worker Deployment should use a particular - // versioning strategy. - // - // If empty, defaults to UNVERSIONED. - temporal.api.enums.v1.WorkerVersioningMode worker_versioning_mode = 3; - // Optional. Contains the new worker compute configuration for the Worker // Deployment. Used as the default compute configuration for new Worker // Deployment Versions created for this Worker Deployment. - temporal.api.compute.v1.ComputeConfig compute_config = 6; + temporal.api.compute.v1.ComputeConfig compute_config = 3; // Optional. The identity of the client who initiated this request. - string identity = 15; + string identity = 4; // A unique identifier for this create request for idempotence. Typically UUIDv4. - string request_id = 16; + string request_id = 5; } message CreateWorkerDeploymentResponse { From 358fbfbe10086781d5f67ece17c4b644a14f9127 Mon Sep 17 00:00:00 2001 From: ShahabT Date: Fri, 20 Feb 2026 12:24:30 -0800 Subject: [PATCH 28/40] Auto-update api-go based on serverless branch --- .github/workflows/trigger-api-go-update.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/trigger-api-go-update.yml b/.github/workflows/trigger-api-go-update.yml index e5424cd54..ed31a9c78 100644 --- a/.github/workflows/trigger-api-go-update.yml +++ b/.github/workflows/trigger-api-go-update.yml @@ -4,6 +4,7 @@ on: push: branches: - master + - serverless workflow_dispatch: inputs: branch: From 4d931393fe78ac77c15e79961af599b768ce13ea Mon Sep 17 00:00:00 2001 From: ShahabT Date: Fri, 20 Feb 2026 12:24:30 -0800 Subject: [PATCH 29/40] Fix compile --- openapi/openapiv2.json | 34 ++------------- openapi/openapiv3.yaml | 62 +++++++--------------------- temporal/api/compute/v1/config.proto | 1 - 3 files changed, 18 insertions(+), 79 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index c6c6bb2aa..c4c7b73fe 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -9252,10 +9252,6 @@ "WorkflowServiceCreateWorkerDeploymentBody": { "type": "object", "properties": { - "workerVersioningMode": { - "$ref": "#/definitions/v1WorkerVersioningMode", - "description": "Optional. Indicates the Worker Deployment should use a particular\nversioning strategy.\n\nIf empty, defaults to UNVERSIONED." - }, "computeConfig": { "$ref": "#/definitions/v1ComputeConfig", "description": "Optional. Contains the new worker compute configuration for the Worker\nDeployment. Used as the default compute configuration for new Worker\nDeployment Versions created for this Worker Deployment." @@ -12046,14 +12042,6 @@ "v1ComputeConfig": { "type": "object", "properties": { - "taskQueues": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/v1TaskQueueNameType" - }, - "description": "When a task matching any of these task queue name + type tuples is\nreceived by the Temporal Server and there are no active pollers to send\nthe task to, workers will be launched using the configuration\ninformation in the provider field." - }, "provider": { "$ref": "#/definitions/v1ComputeProvider", "description": "Stores instructions for a worker control plane controller how to respond\nto worker lifeycle events." @@ -15437,7 +15425,7 @@ "properties": { "currentDeploymentVersion": { "$ref": "#/definitions/v1WorkerDeploymentVersion", - "description": "Specifies which Deployment Version should receive new workflow executions and tasks of\nexisting unversioned or AutoUpgrade workflows.\nNil value means no Version in this Deployment (except Ramping Version, if present) receives traffic other than tasks of previously Pinned workflows. In absence of a Current Version, remaining traffic after any ramp (if set) goes to unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.). \nNote: Current Version is overridden by the Ramping Version for a portion of traffic when ramp percentage\nis non-zero (see `ramping_deployment_version` and `ramping_version_percentage`)." + "description": "Specifies which Deployment Version should receive new workflow executions and tasks of\nexisting unversioned or AutoUpgrade workflows.\nNil value means no Version in this Deployment (except Ramping Version, if present) receives traffic other than tasks of previously Pinned workflows. In absence of a Current Version, remaining traffic after any ramp (if set) goes to unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.).\nNote: Current Version is overridden by the Ramping Version for a portion of traffic when ramp percentage\nis non-zero (see `ramping_deployment_version` and `ramping_version_percentage`)." }, "currentVersion": { "type": "string", @@ -15474,7 +15462,7 @@ "revisionNumber": { "type": "string", "format": "int64", - "description": "Monotonically increasing value which is incremented on every mutation \nto any field of this message to achieve eventual consistency between task queues and their partitions." + "description": "Monotonically increasing value which is incremented on every mutation\nto any field of this message to achieve eventual consistency between task queues and their partitions." } } }, @@ -16319,18 +16307,6 @@ "default": "TASK_QUEUE_KIND_UNSPECIFIED", "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." }, - "v1TaskQueueNameType": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/v1TaskQueueType" - } - }, - "description": "Uniquely identifies a combination of task queue name and type." - }, "v1TaskQueueReachability": { "type": "object", "properties": { @@ -16981,7 +16957,7 @@ "type": "object", "$ref": "#/definitions/WorkerDeploymentInfoWorkerDeploymentVersionSummary" }, - "title": "Deployment Versions that are currently tracked in this Deployment. A DeploymentVersion will be\ncleaned up automatically if all the following conditions meet:\n- It does not receive new executions (is not current or ramping)\n- It has no active pollers (see WorkerDeploymentVersionInfo.pollers_status) \n- It is drained (see WorkerDeploymentVersionInfo.drainage_status)" + "title": "Deployment Versions that are currently tracked in this Deployment. A DeploymentVersion will be\ncleaned up automatically if all the following conditions meet:\n- It does not receive new executions (is not current or ramping)\n- It has no active pollers (see WorkerDeploymentVersionInfo.pollers_status)\n- It is drained (see WorkerDeploymentVersionInfo.drainage_status)" }, "createTime": { "type": "string", @@ -17113,10 +17089,6 @@ "metadata": { "$ref": "#/definitions/v1VersionMetadata", "description": "Arbitrary user-provided metadata attached to this version." - }, - "computeConfig": { - "$ref": "#/definitions/v1ComputeConfig", - "description": "Contains information used by worker control plane controllers to handle\nscale events." } }, "description": "A Worker Deployment Version (Version, for short) represents all workers of the same \ncode and config within a Deployment. Workers of the same Version are expected to \nbehave exactly the same so when executions move between them there are no \nnon-determinism issues.\nWorker Deployment Versions are created in Temporal server automatically when \ntheir first poller arrives to the server.\nExperimental. Worker Deployments are experimental and might significantly change in the future." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 28deb5157..f15c2f641 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -9118,15 +9118,6 @@ components: ComputeConfig: type: object properties: - taskQueues: - type: array - items: - $ref: '#/components/schemas/TaskQueueNameType' - description: |- - When a task matching any of these task queue name + type tuples is - received by the Temporal Server and there are no active pollers to send - the task to, workers will be launched using the configuration - information in the provider field. provider: allOf: - $ref: '#/components/schemas/ComputeProvider' @@ -9355,18 +9346,6 @@ components: description: |- The name of the Worker Deployment to create. If a Worker Deployment with this name already exists, an error will be returned. - workerVersioningMode: - enum: - - WORKER_VERSIONING_MODE_UNSPECIFIED - - WORKER_VERSIONING_MODE_UNVERSIONED - - WORKER_VERSIONING_MODE_VERSIONED - type: string - description: |- - Optional. Indicates the Worker Deployment should use a particular - versioning strategy. - - If empty, defaults to UNVERSIONED. - format: enum computeConfig: allOf: - $ref: '#/components/schemas/ComputeConfig' @@ -12975,7 +12954,12 @@ components: currentDeploymentVersion: allOf: - $ref: '#/components/schemas/WorkerDeploymentVersion' - description: "Specifies which Deployment Version should receive new workflow executions and tasks of\n existing unversioned or AutoUpgrade workflows.\n Nil value means no Version in this Deployment (except Ramping Version, if present) receives traffic other than tasks of previously Pinned workflows. In absence of a Current Version, remaining traffic after any ramp (if set) goes to unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.). \n Note: Current Version is overridden by the Ramping Version for a portion of traffic when ramp percentage\n is non-zero (see `ramping_deployment_version` and `ramping_version_percentage`)." + description: |- + Specifies which Deployment Version should receive new workflow executions and tasks of + existing unversioned or AutoUpgrade workflows. + Nil value means no Version in this Deployment (except Ramping Version, if present) receives traffic other than tasks of previously Pinned workflows. In absence of a Current Version, remaining traffic after any ramp (if set) goes to unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.). + Note: Current Version is overridden by the Ramping Version for a portion of traffic when ramp percentage + is non-zero (see `ramping_deployment_version` and `ramping_version_percentage`). currentVersion: type: string description: Deprecated. Use `current_deployment_version`. @@ -13015,7 +12999,9 @@ components: format: date-time revisionNumber: type: string - description: "Monotonically increasing value which is incremented on every mutation \n to any field of this message to achieve eventual consistency between task queues and their partitions." + description: |- + Monotonically increasing value which is incremented on every mutation + to any field of this message to achieve eventual consistency between task queues and their partitions. Schedule: type: object properties: @@ -14446,23 +14432,6 @@ components: type: number format: float description: If set, overrides the fairness weights for the corresponding fairness keys. - TaskQueueNameType: - type: object - properties: - name: - type: string - type: - enum: - - TASK_QUEUE_TYPE_UNSPECIFIED - - TASK_QUEUE_TYPE_WORKFLOW - - TASK_QUEUE_TYPE_ACTIVITY - - TASK_QUEUE_TYPE_NEXUS - type: string - format: enum - description: |- - Uniquely identifies a combination of task queue name and type. - (-- api-linter: core::0123::resource-annotation=disabled - aip.dev/not-precedent: this isn't a resource --) TaskQueueReachability: type: object properties: @@ -15511,7 +15480,12 @@ components: type: array items: $ref: '#/components/schemas/WorkerDeploymentInfo_WorkerDeploymentVersionSummary' - description: "Deployment Versions that are currently tracked in this Deployment. A DeploymentVersion will be\n cleaned up automatically if all the following conditions meet:\n - It does not receive new executions (is not current or ramping)\n - It has no active pollers (see WorkerDeploymentVersionInfo.pollers_status) \n - It is drained (see WorkerDeploymentVersionInfo.drainage_status)" + description: |- + Deployment Versions that are currently tracked in this Deployment. A DeploymentVersion will be + cleaned up automatically if all the following conditions meet: + - It does not receive new executions (is not current or ramping) + - It has no active pollers (see WorkerDeploymentVersionInfo.pollers_status) + - It is drained (see WorkerDeploymentVersionInfo.drainage_status) createTime: type: string format: date-time @@ -15757,12 +15731,6 @@ components: allOf: - $ref: '#/components/schemas/VersionMetadata' description: Arbitrary user-provided metadata attached to this version. - computeConfig: - allOf: - - $ref: '#/components/schemas/ComputeConfig' - description: |- - Contains information used by worker control plane controllers to handle - scale events. description: "A Worker Deployment Version (Version, for short) represents all workers of the same \n code and config within a Deployment. Workers of the same Version are expected to \n behave exactly the same so when executions move between them there are no \n non-determinism issues.\n Worker Deployment Versions are created in Temporal server automatically when \n their first poller arrives to the server.\n Experimental. Worker Deployments are experimental and might significantly change in the future." WorkerDeploymentVersionInfo_VersionTaskQueueInfo: type: object diff --git a/temporal/api/compute/v1/config.proto b/temporal/api/compute/v1/config.proto index 712c617bc..9423ce5ed 100644 --- a/temporal/api/compute/v1/config.proto +++ b/temporal/api/compute/v1/config.proto @@ -11,7 +11,6 @@ option csharp_namespace = "Temporalio.Api.Compute.V1"; import "temporal/api/compute/v1/provider.proto"; import "temporal/api/compute/v1/scaler.proto"; -import "temporal/api/common/v1/message.proto"; // ComputeConfig stores configuration that helps a worker control plane // controller understand *when* and *how* to respond to worker lifecycle From 57ef48870153f70cc8c0f2eb798c810affcc03a4 Mon Sep 17 00:00:00 2001 From: ShahabT Date: Fri, 20 Feb 2026 12:55:18 -0800 Subject: [PATCH 30/40] Fix trigger-api-go-update.yml to work on non-master branches --- .github/workflows/trigger-api-go-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trigger-api-go-update.yml b/.github/workflows/trigger-api-go-update.yml index ed31a9c78..97008ca18 100644 --- a/.github/workflows/trigger-api-go-update.yml +++ b/.github/workflows/trigger-api-go-update.yml @@ -57,7 +57,7 @@ jobs: esac gh workflow run update-proto.yml -R https://github.com/temporalio/api-go \ - -r master \ + -r "${BRANCH}" \ -f branch="${BRANCH}" \ -f commit_author="${COMMIT_AUTHOR}" \ -f commit_author_email="${COMMIT_AUTHOR_EMAIL}" \ From 86f731ac848510682d02159d196ddb65a3b433e9 Mon Sep 17 00:00:00 2001 From: ShahabT Date: Fri, 20 Feb 2026 13:06:52 -0800 Subject: [PATCH 31/40] comment change --- temporal/api/workflowservice/v1/request_response.proto | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 780ccec7f..ae68127e5 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2353,8 +2353,7 @@ message CreateWorkerDeploymentRequest { string deployment_name = 2; // Optional. Contains the new worker compute configuration for the Worker - // Deployment. Used as the default compute configuration for new Worker - // Deployment Versions created for this Worker Deployment. + // Deployment. Used for worker scale management. temporal.api.compute.v1.ComputeConfig compute_config = 3; // Optional. The identity of the client who initiated this request. From 13ba8b84e03c27daddff2820ee7e0fe6e9700f17 Mon Sep 17 00:00:00 2001 From: ShahabT Date: Wed, 18 Mar 2026 13:53:42 -0700 Subject: [PATCH 32/40] Add serverless_deployments capability flag --- openapi/openapiv2.json | 6 +++++- openapi/openapiv3.yaml | 9 +++++++-- temporal/api/workflowservice/v1/request_response.proto | 5 +++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index c4c7b73fe..6ae6db13b 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -9254,7 +9254,7 @@ "properties": { "computeConfig": { "$ref": "#/definitions/v1ComputeConfig", - "description": "Optional. Contains the new worker compute configuration for the Worker\nDeployment. Used as the default compute configuration for new Worker\nDeployment Versions created for this Worker Deployment." + "description": "Optional. Contains the new worker compute configuration for the Worker\nDeployment. Used for worker scale management." }, "identity": { "type": "string", @@ -13094,6 +13094,10 @@ "nexus": { "type": "boolean", "description": "True if the server supports Nexus operations.\nThis flag is dependent both on server version and for Nexus to be enabled via server configuration." + }, + "serverlessDeployments": { + "type": "boolean", + "description": "True if the server supports serverless deployments.\nThis flag is dependent both on server version and for serverless deployments\nto be enabled via server configuration." } }, "description": "System capability details." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index f15c2f641..cac169a56 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -9351,8 +9351,7 @@ components: - $ref: '#/components/schemas/ComputeConfig' description: |- Optional. Contains the new worker compute configuration for the Worker - Deployment. Used as the default compute configuration for new Worker - Deployment Versions created for this Worker Deployment. + Deployment. Used for worker scale management. identity: type: string description: Optional. The identity of the client who initiated this request. @@ -10171,6 +10170,12 @@ components: description: |- True if the server supports Nexus operations. This flag is dependent both on server version and for Nexus to be enabled via server configuration. + serverlessDeployments: + type: boolean + description: |- + True if the server supports serverless deployments. + This flag is dependent both on server version and for serverless deployments + to be enabled via server configuration. description: System capability details. GetWorkerBuildIdCompatibilityResponse: type: object diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index ae68127e5..05c784881 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1268,6 +1268,11 @@ message GetSystemInfoResponse { // This flag is dependent both on server version and for Nexus to be enabled via server configuration. bool nexus = 11; + // True if the server supports serverless deployments. + // This flag is dependent both on server version and for serverless deployments + // to be enabled via server configuration. + bool serverless_deployments = 12; + } } From d956f6e8fe09a132b515a824ba98cc17d2502cfa Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Mon, 23 Mar 2026 13:01:29 -0700 Subject: [PATCH 33/40] Add Create and Update for Worker Deployment Version, update scaler config and enable per-task-type compute providers (#731) **What changed?** * Enables validating, creating and updating compute providers at the worker deployment version level, as that is where it at the most basic belongs * Making the scaler config more flexible to allow for pluggable scalers * Allowing for different compute providers depending on task types and regions --- openapi/openapiv2.json | 484 +++++++++++++++++- openapi/openapiv3.yaml | 451 ++++++++++++++-- temporal/api/compute/v1/config.proto | 32 +- temporal/api/compute/v1/provider.proto | 19 +- temporal/api/compute/v1/scaler.proto | 20 +- temporal/api/deployment/v1/message.proto | 8 +- .../workflowservice/v1/request_response.proto | 95 +++- temporal/api/workflowservice/v1/service.proto | 41 ++ 8 files changed, 1051 insertions(+), 99 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 6ae6db13b..35b6224df 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -2190,6 +2190,53 @@ ] } }, + "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}": { + "post": { + "summary": "Creates a new Worker Deployment Version.", + "description": "Experimental. This API might significantly change or be removed in a\nfuture release.", + "operationId": "CreateWorkerDeploymentVersion2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CreateWorkerDeploymentVersionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentVersion.deploymentName", + "description": "Identifies the Worker Deployment this Version is part of.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceCreateWorkerDeploymentVersionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}/{deploymentVersion.buildId}": { "get": { "summary": "Describes a worker deployment version.\nExperimental. This API might significantly change or be removed in a future release.", @@ -2313,6 +2360,59 @@ ] } }, + "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}/{deploymentVersion.buildId}/update-compute-config": { + "post": { + "summary": "Updates the compute config attached to a Worker Deployment Version.\nExperimental. This API might significantly change or be removed in a future release.", + "operationId": "UpdateWorkerDeploymentVersionComputeConfig2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateWorkerDeploymentVersionComputeConfigResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentVersion.deploymentName", + "description": "Identifies the Worker Deployment this Version is part of.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentVersion.buildId", + "description": "A unique identifier for this Version within the Deployment it is a part of.\nNot necessarily unique within the namespace.\nThe combination of `deployment_name` and `build_id` uniquely identifies this\nVersion within the namespace, because Deployment names are unique within a namespace.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateWorkerDeploymentVersionComputeConfigBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}/{deploymentVersion.buildId}/update-metadata": { "post": { "summary": "Updates the user-given metadata attached to a Worker Deployment Version.\nExperimental. This API might significantly change or be removed in a future release.", @@ -2366,6 +2466,59 @@ ] } }, + "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}/{deploymentVersion.buildId}/validate-compute-config": { + "post": { + "summary": "Validates the compute config without attaching it to a Worker Deployment Version.\nExperimental. This API might significantly change or be removed in a future release.", + "operationId": "ValidateWorkerDeploymentVersionComputeConfig2", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ValidateWorkerDeploymentVersionComputeConfigResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentVersion.deploymentName", + "description": "Identifies the Worker Deployment this Version is part of.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentVersion.buildId", + "description": "A unique identifier for this Version within the Deployment it is a part of.\nNot necessarily unique within the namespace.\nThe combination of `deployment_name` and `build_id` uniquely identifies this\nVersion within the namespace, because Deployment names are unique within a namespace.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceValidateWorkerDeploymentVersionComputeConfigBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/api/v1/namespaces/{namespace}/worker-deployments": { "get": { "summary": "Lists all Worker Deployments that are tracked in the Namespace.\nExperimental. This API might significantly change or be removed in a future release.", @@ -6735,6 +6888,53 @@ ] } }, + "/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}": { + "post": { + "summary": "Creates a new Worker Deployment Version.", + "description": "Experimental. This API might significantly change or be removed in a\nfuture release.", + "operationId": "CreateWorkerDeploymentVersion", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1CreateWorkerDeploymentVersionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentVersion.deploymentName", + "description": "Identifies the Worker Deployment this Version is part of.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceCreateWorkerDeploymentVersionBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}/{deploymentVersion.buildId}": { "get": { "summary": "Describes a worker deployment version.\nExperimental. This API might significantly change or be removed in a future release.", @@ -6858,6 +7058,59 @@ ] } }, + "/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}/{deploymentVersion.buildId}/update-compute-config": { + "post": { + "summary": "Updates the compute config attached to a Worker Deployment Version.\nExperimental. This API might significantly change or be removed in a future release.", + "operationId": "UpdateWorkerDeploymentVersionComputeConfig", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1UpdateWorkerDeploymentVersionComputeConfigResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentVersion.deploymentName", + "description": "Identifies the Worker Deployment this Version is part of.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentVersion.buildId", + "description": "A unique identifier for this Version within the Deployment it is a part of.\nNot necessarily unique within the namespace.\nThe combination of `deployment_name` and `build_id` uniquely identifies this\nVersion within the namespace, because Deployment names are unique within a namespace.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceUpdateWorkerDeploymentVersionComputeConfigBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}/{deploymentVersion.buildId}/update-metadata": { "post": { "summary": "Updates the user-given metadata attached to a Worker Deployment Version.\nExperimental. This API might significantly change or be removed in a future release.", @@ -6911,6 +7164,59 @@ ] } }, + "/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}/{deploymentVersion.buildId}/validate-compute-config": { + "post": { + "summary": "Validates the compute config without attaching it to a Worker Deployment Version.\nExperimental. This API might significantly change or be removed in a future release.", + "operationId": "ValidateWorkerDeploymentVersionComputeConfig", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ValidateWorkerDeploymentVersionComputeConfigResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentVersion.deploymentName", + "description": "Identifies the Worker Deployment this Version is part of.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "deploymentVersion.buildId", + "description": "A unique identifier for this Version within the Deployment it is a part of.\nNot necessarily unique within the namespace.\nThe combination of `deployment_name` and `build_id` uniquely identifies this\nVersion within the namespace, because Deployment names are unique within a namespace.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WorkflowServiceValidateWorkerDeploymentVersionComputeConfigBody" + } + } + ], + "tags": [ + "WorkflowService" + ] + } + }, "/namespaces/{namespace}/worker-deployments": { "get": { "summary": "Lists all Worker Deployments that are tracked in the Namespace.\nExperimental. This API might significantly change or be removed in a future release.", @@ -9062,6 +9368,18 @@ } } }, + "UpdateWorkerDeploymentVersionComputeConfigRequestScalingGroupUpdate": { + "type": "object", + "properties": { + "scalingGroup": { + "$ref": "#/definitions/v1ComputeConfigScalingGroup" + }, + "updateMask": { + "type": "string", + "title": "Controls which fields from `scaling_group` will be applied" + } + } + }, "VersioningOverridePinnedOverride": { "type": "object", "properties": { @@ -9252,6 +9570,31 @@ "WorkflowServiceCreateWorkerDeploymentBody": { "type": "object", "properties": { + "identity": { + "type": "string", + "description": "Optional. The identity of the client who initiated this request." + }, + "requestId": { + "type": "string", + "description": "A unique identifier for this create request for idempotence. Typically UUIDv4." + } + }, + "description": "Creates a new WorkerDeployment." + }, + "WorkflowServiceCreateWorkerDeploymentVersionBody": { + "type": "object", + "properties": { + "deploymentVersion": { + "type": "object", + "properties": { + "buildId": { + "type": "string", + "description": "A unique identifier for this Version within the Deployment it is a part of.\nNot necessarily unique within the namespace.\nThe combination of `deployment_name` and `build_id` uniquely identifies this\nVersion within the namespace, because Deployment names are unique within a namespace." + } + }, + "description": "Required.", + "title": "Required." + }, "computeConfig": { "$ref": "#/definitions/v1ComputeConfig", "description": "Optional. Contains the new worker compute configuration for the Worker\nDeployment. Used for worker scale management." @@ -9262,10 +9605,10 @@ }, "requestId": { "type": "string", - "description": "A unique identifier for this create request for idempotence. Typically UUIDv4." + "description": "A unique identifier for this create request for idempotence. Typically UUIDv4.\nIf a second request with the same ID is recieved, it is considered a successful no-op.\nRetrying with a different request ID for the same deployment name + build ID is an error." } }, - "description": "Creates a new WorkerDeployment." + "description": "Creates a new WorkerDeploymentVersion." }, "WorkflowServiceCreateWorkflowRuleBody": { "type": "object", @@ -10610,6 +10953,44 @@ } } }, + "WorkflowServiceUpdateWorkerDeploymentVersionComputeConfigBody": { + "type": "object", + "properties": { + "deploymentVersion": { + "type": "object", + "description": "Required.", + "title": "Required." + }, + "computeConfigScalingGroups": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/UpdateWorkerDeploymentVersionComputeConfigRequestScalingGroupUpdate" + }, + "description": "Optional. Contains the compute config scaling groups to add or updated for the Worker\nDeployment." + }, + "removeComputeConfigScalingGroups": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Optional. Contains the compute config scaling groups to remove from the Worker Deployment." + }, + "identity": { + "type": "string", + "description": "Optional. The identity of the client who initiated this request." + }, + "requestId": { + "type": "string", + "description": "A unique identifier for this create request for idempotence. Typically UUIDv4.\nIf a second request with the same ID is recieved, it is considered a successful no-op.\nRetrying with a different request ID for the same deployment name + build ID is an error." + }, + "conflictToken": { + "type": "string", + "format": "byte", + "description": "Optional. This value is returned so that it can be optionally passed to APIs\nthat write to the Worker Deployment state to ensure that the state\ndid not change between this API call and a future write." + } + }, + "description": "Used to update the compute config of a Worker Deployment Version." + }, "WorkflowServiceUpdateWorkerDeploymentVersionMetadataBody": { "type": "object", "properties": { @@ -10715,6 +11096,25 @@ }, "description": "Keep the parameters in sync with:\n - temporal.api.batch.v1.BatchOperationUpdateWorkflowExecutionOptions.\n - temporal.api.workflow.v1.PostResetOperation.UpdateWorkflowOptions." }, + "WorkflowServiceValidateWorkerDeploymentVersionComputeConfigBody": { + "type": "object", + "properties": { + "deploymentVersion": { + "type": "object", + "description": "Required.", + "title": "Required." + }, + "computeConfig": { + "$ref": "#/definitions/v1ComputeConfig", + "description": "Required. Contains the new worker compute configuration for the Worker Deployment." + }, + "identity": { + "type": "string", + "description": "Optional. The identity of the client who initiated this request." + } + }, + "description": "Used to validate the compute config without attaching it to a Worker Deployment Version." + }, "protobufAny": { "type": "object", "properties": { @@ -12042,6 +12442,26 @@ "v1ComputeConfig": { "type": "object", "properties": { + "scalingGroups": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v1ComputeConfigScalingGroup" + }, + "description": "Each scaling group describes a compute config for a specific subset of the worker \ndeployment version: covering a specific set of task types and/or regions.\nHaving different configurations for different task types, allows independent\ntuning of activity and workflow task processing (for example).\n\nThe key of the map is the ID of the scaling group used to reference it in subsequent\nupdate calls." + } + }, + "description": "ComputeConfig stores configuration that helps a worker control plane\ncontroller understand *when* and *how* to respond to worker lifecycle\nevents." + }, + "v1ComputeConfigScalingGroup": { + "type": "object", + "properties": { + "taskQueueTypes": { + "type": "array", + "items": { + "$ref": "#/definitions/v1TaskQueueType" + }, + "description": "Optional. The set of task queue types this scaling group serves. \nIf not provided, this scaling group serves all not otherwise defined\ntask types." + }, "provider": { "$ref": "#/definitions/v1ComputeProvider", "description": "Stores instructions for a worker control plane controller how to respond\nto worker lifeycle events." @@ -12050,8 +12470,7 @@ "$ref": "#/definitions/v1ComputeScaler", "description": "Informs a worker lifecycle controller *when* and *how often* to perform\ncertain worker lifecycle actions like starting a serverless worker." } - }, - "description": "ComputeConfig stores configuration that helps a worker control plane\ncontroller understand *when* and *how* to respond to worker lifecycle\nevents." + } }, "v1ComputeProvider": { "type": "object", @@ -12060,13 +12479,9 @@ "type": "string", "description": "Type of the compute provider. This string is implementation-specific and\ncan be used by implementations to understand how to interpret the\ncontents of the provider_details field." }, - "detailJson": { - "type": "string", - "title": "will be an unencrypted, JSON-encoded object of provider-specific\ninformation" - }, - "detailPayload": { + "details": { "$ref": "#/definitions/v1Payload", - "description": "will be an encrypted, encoded bytestring containing\nprovider-specific information. The implementation must understand\nhow to decrypt the payload." + "description": "Contains provider-specific instructions and configuration.\nFor server-implemented providers, use the SDK's default content\nconverter to ensure the server can understand it.\nFor remote-implemented providers, you might use your own content\nconverters according to what the remote endpoints understand." }, "nexusEndpoint": { "type": "string", @@ -12078,15 +12493,13 @@ "v1ComputeScaler": { "type": "object", "properties": { - "minInstances": { - "type": "integer", - "format": "int32", - "description": "The lower limit for the number of Workers (in the WorkerDeployment) to\nwhich the ComputeScaler can scale down." + "type": { + "type": "string", + "description": "Type of the compute scaler. this string is implementation-specific and\ncan be used by implementations to understand how to interpret the\ncontents of the scaler_details field." }, - "maxInstances": { - "type": "integer", - "format": "int32", - "description": "The upper limit for the number of Workers (in the WorkerDeployment) to\nwhich the ComputeScaler can scale up. Must be greater than or equal to\nmin_instances." + "details": { + "$ref": "#/definitions/v1Payload", + "description": "Contains scaler-specific instructions and configuration.\nFor server-implemented scalers, use the SDK's default content\nconverter to ensure the server can understand it.\nFor remote-implemented scalers, you might use your own content\nconverters according to what the remote endpoints understand." } }, "description": "ComputeScaler instructs the Temporal Service when to scale up or down the number of\nWorkers that comprise a WorkerDeployment." @@ -12268,6 +12681,16 @@ } } }, + "v1CreateWorkerDeploymentVersionResponse": { + "type": "object", + "properties": { + "conflictToken": { + "type": "string", + "format": "byte", + "description": "This value is returned so that it can be optionally passed to APIs that\nwrite to the WorkerDeployment state to ensure that the state did not\nchange between this API call and a future write." + } + } + }, "v1CreateWorkflowRuleResponse": { "type": "object", "properties": { @@ -13095,9 +13518,9 @@ "type": "boolean", "description": "True if the server supports Nexus operations.\nThis flag is dependent both on server version and for Nexus to be enabled via server configuration." }, - "serverlessDeployments": { + "serverScaledDeployments": { "type": "boolean", - "description": "True if the server supports serverless deployments.\nThis flag is dependent both on server version and for serverless deployments\nto be enabled via server configuration." + "description": "True if the server supports server-scaled deployments.\nThis flag is dependent both on server version and for server-scaled deployments\nto be enabled via server configuration." } }, "description": "System capability details." @@ -16746,6 +17169,16 @@ } } }, + "v1UpdateWorkerDeploymentVersionComputeConfigResponse": { + "type": "object", + "properties": { + "conflictToken": { + "type": "string", + "format": "byte", + "description": "This value is returned so that it can be optionally passed to APIs that\nwrite to the WorkerDeployment state to ensure that the state did not\nchange between this API call and a future write." + } + } + }, "v1UpdateWorkerDeploymentVersionMetadataResponse": { "type": "object", "properties": { @@ -16819,6 +17252,9 @@ }, "description": "Information a user can set, often for use by user interfaces." }, + "v1ValidateWorkerDeploymentVersionComputeConfigResponse": { + "type": "object" + }, "v1VersionDrainageInfo": { "type": "object", "properties": { @@ -16981,10 +17417,6 @@ "routingConfigUpdateState": { "$ref": "#/definitions/v1RoutingConfigUpdateState", "description": "Indicates whether the routing_config has been fully propagated to all\nrelevant task queues and their partitions." - }, - "computeConfig": { - "$ref": "#/definitions/v1ComputeConfig", - "description": "Contains information used by worker control plane controllers to handle\nscale events." } }, "description": "A Worker Deployment (Deployment, for short) represents all workers serving \na shared set of Task Queues. Typically, a Deployment represents one service or \napplication.\nA Deployment contains multiple Deployment Versions, each representing a different \nversion of workers. (see documentation of WorkerDeploymentVersionInfo)\nDeployment records are created in Temporal server automatically when their\nfirst poller arrives to the server.\nExperimental. Worker Deployments are experimental and might significantly change in the future." @@ -17093,6 +17525,10 @@ "metadata": { "$ref": "#/definitions/v1VersionMetadata", "description": "Arbitrary user-provided metadata attached to this version." + }, + "computeConfig": { + "$ref": "#/definitions/v1ComputeConfig", + "description": "Optional. Contains the new worker compute configuration for the Worker\nDeployment. Used for worker scale management." } }, "description": "A Worker Deployment Version (Version, for short) represents all workers of the same \ncode and config within a Deployment. Workers of the same Version are expected to \nbehave exactly the same so when executions move between them there are no \nnon-determinism issues.\nWorker Deployment Versions are created in Temporal server automatically when \ntheir first poller arrives to the server.\nExperimental. Worker Deployments are experimental and might significantly change in the future." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index cac169a56..c14963a7b 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -1958,6 +1958,46 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}: + post: + tags: + - WorkflowService + description: |- + Creates a new Worker Deployment Version. + + Experimental. This API might significantly change or be removed in a + future release. + operationId: CreateWorkerDeploymentVersion + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deployment_version.deployment_name + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWorkerDeploymentVersionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWorkerDeploymentVersionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}: get: tags: @@ -2091,6 +2131,49 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + ? /api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/update-compute-config + : post: + tags: + - WorkflowService + description: |- + Updates the compute config attached to a Worker Deployment Version. + Experimental. This API might significantly change or be removed in a future release. + operationId: UpdateWorkerDeploymentVersionComputeConfig + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deployment_version.deployment_name + in: path + required: true + schema: + type: string + - name: deployment_version.build_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateWorkerDeploymentVersionComputeConfigRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateWorkerDeploymentVersionComputeConfigResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' ? /api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/update-metadata : post: tags: @@ -2134,6 +2217,49 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + ? /api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/validate-compute-config + : post: + tags: + - WorkflowService + description: |- + Validates the compute config without attaching it to a Worker Deployment Version. + Experimental. This API might significantly change or be removed in a future release. + operationId: ValidateWorkerDeploymentVersionComputeConfig + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deployment_version.deployment_name + in: path + required: true + schema: + type: string + - name: deployment_version.build_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateWorkerDeploymentVersionComputeConfigRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateWorkerDeploymentVersionComputeConfigResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /api/v1/namespaces/{namespace}/worker-deployments: get: tags: @@ -6033,6 +6159,46 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + /namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}: + post: + tags: + - WorkflowService + description: |- + Creates a new Worker Deployment Version. + + Experimental. This API might significantly change or be removed in a + future release. + operationId: CreateWorkerDeploymentVersion + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deployment_version.deployment_name + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWorkerDeploymentVersionRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWorkerDeploymentVersionResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}: get: tags: @@ -6166,6 +6332,49 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + ? /namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/update-compute-config + : post: + tags: + - WorkflowService + description: |- + Updates the compute config attached to a Worker Deployment Version. + Experimental. This API might significantly change or be removed in a future release. + operationId: UpdateWorkerDeploymentVersionComputeConfig + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deployment_version.deployment_name + in: path + required: true + schema: + type: string + - name: deployment_version.build_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateWorkerDeploymentVersionComputeConfigRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateWorkerDeploymentVersionComputeConfigResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' ? /namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/update-metadata : post: tags: @@ -6209,6 +6418,49 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' + ? /namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/validate-compute-config + : post: + tags: + - WorkflowService + description: |- + Validates the compute config without attaching it to a Worker Deployment Version. + Experimental. This API might significantly change or be removed in a future release. + operationId: ValidateWorkerDeploymentVersionComputeConfig + parameters: + - name: namespace + in: path + required: true + schema: + type: string + - name: deployment_version.deployment_name + in: path + required: true + schema: + type: string + - name: deployment_version.build_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateWorkerDeploymentVersionComputeConfigRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ValidateWorkerDeploymentVersionComputeConfigResponse' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' /namespaces/{namespace}/worker-deployments: get: tags: @@ -9118,6 +9370,29 @@ components: ComputeConfig: type: object properties: + scalingGroups: + type: object + additionalProperties: + $ref: '#/components/schemas/ComputeConfigScalingGroup' + description: "Each scaling group describes a compute config for a specific subset of the worker \n deployment version: covering a specific set of task types and/or regions.\n Having different configurations for different task types, allows independent\n tuning of activity and workflow task processing (for example).\n\n The key of the map is the ID of the scaling group used to reference it in subsequent\n update calls." + description: |- + ComputeConfig stores configuration that helps a worker control plane + controller understand *when* and *how* to respond to worker lifecycle + events. + ComputeConfigScalingGroup: + type: object + properties: + taskQueueTypes: + type: array + items: + enum: + - TASK_QUEUE_TYPE_UNSPECIFIED + - TASK_QUEUE_TYPE_WORKFLOW + - TASK_QUEUE_TYPE_ACTIVITY + - TASK_QUEUE_TYPE_NEXUS + type: string + format: enum + description: "Optional. The set of task queue types this scaling group serves. \n If not provided, this scaling group serves all not otherwise defined\n task types." provider: allOf: - $ref: '#/components/schemas/ComputeProvider' @@ -9130,10 +9405,6 @@ components: description: |- Informs a worker lifecycle controller *when* and *how often* to perform certain worker lifecycle actions like starting a serverless worker. - description: |- - ComputeConfig stores configuration that helps a worker control plane - controller understand *when* and *how* to respond to worker lifecycle - events. ComputeProvider: type: object properties: @@ -9143,21 +9414,15 @@ components: Type of the compute provider. This string is implementation-specific and can be used by implementations to understand how to interpret the contents of the provider_details field. - detailJson: - type: string - description: |- - will be an unencrypted, JSON-encoded object of provider-specific - information - (-- api-linter: core::0146::any=disabled - aip.dev/not-precedent: This needs to be extensible to - externally-written compute providers --) - detailPayload: + details: allOf: - $ref: '#/components/schemas/Payload' description: |- - will be an encrypted, encoded bytestring containing - provider-specific information. The implementation must understand - how to decrypt the payload. + Contains provider-specific instructions and configuration. + For server-implemented providers, use the SDK's default content + converter to ensure the server can understand it. + For remote-implemented providers, you might use your own content + converters according to what the remote endpoints understand. nexusEndpoint: type: string description: |- @@ -9172,19 +9437,21 @@ components: ComputeScaler: type: object properties: - minInstances: - type: integer + type: + type: string description: |- - The lower limit for the number of Workers (in the WorkerDeployment) to - which the ComputeScaler can scale down. - format: int32 - maxInstances: - type: integer + Type of the compute scaler. this string is implementation-specific and + can be used by implementations to understand how to interpret the + contents of the scaler_details field. + details: + allOf: + - $ref: '#/components/schemas/Payload' description: |- - The upper limit for the number of Workers (in the WorkerDeployment) to - which the ComputeScaler can scale up. Must be greater than or equal to - min_instances. - format: int32 + Contains scaler-specific instructions and configuration. + For server-implemented scalers, use the SDK's default content + converter to ensure the server can understand it. + For remote-implemented scalers, you might use your own content + converters according to what the remote endpoints understand. description: |- ComputeScaler instructs the Temporal Service when to scale up or down the number of Workers that comprise a WorkerDeployment. @@ -9346,6 +9613,32 @@ components: description: |- The name of the Worker Deployment to create. If a Worker Deployment with this name already exists, an error will be returned. + identity: + type: string + description: Optional. The identity of the client who initiated this request. + requestId: + type: string + description: A unique identifier for this create request for idempotence. Typically UUIDv4. + description: Creates a new WorkerDeployment. + CreateWorkerDeploymentResponse: + type: object + properties: + conflictToken: + type: string + description: |- + This value is returned so that it can be optionally passed to APIs that + write to the WorkerDeployment state to ensure that the state did not + change between this API call and a future write. + format: bytes + CreateWorkerDeploymentVersionRequest: + type: object + properties: + namespace: + type: string + deploymentVersion: + allOf: + - $ref: '#/components/schemas/WorkerDeploymentVersion' + description: Required. computeConfig: allOf: - $ref: '#/components/schemas/ComputeConfig' @@ -9357,9 +9650,12 @@ components: description: Optional. The identity of the client who initiated this request. requestId: type: string - description: A unique identifier for this create request for idempotence. Typically UUIDv4. - description: Creates a new WorkerDeployment. - CreateWorkerDeploymentResponse: + description: |- + A unique identifier for this create request for idempotence. Typically UUIDv4. + If a second request with the same ID is recieved, it is considered a successful no-op. + Retrying with a different request ID for the same deployment name + build ID is an error. + description: Creates a new WorkerDeploymentVersion. + CreateWorkerDeploymentVersionResponse: type: object properties: conflictToken: @@ -10170,11 +10466,11 @@ components: description: |- True if the server supports Nexus operations. This flag is dependent both on server version and for Nexus to be enabled via server configuration. - serverlessDeployments: + serverScaledDeployments: type: boolean description: |- - True if the server supports serverless deployments. - This flag is dependent both on server version and for serverless deployments + True if the server supports server-scaled deployments. + This flag is dependent both on server version and for server-scaled deployments to be enabled via server configuration. description: System capability details. GetWorkerBuildIdCompatibilityResponse: @@ -15138,6 +15434,63 @@ components: allOf: - $ref: '#/components/schemas/WorkerConfig' description: The worker configuration. Will be returned if the command was sent to a single worker. + UpdateWorkerDeploymentVersionComputeConfigRequest: + type: object + properties: + namespace: + type: string + deploymentVersion: + allOf: + - $ref: '#/components/schemas/WorkerDeploymentVersion' + description: Required. + computeConfigScalingGroups: + type: object + additionalProperties: + $ref: '#/components/schemas/UpdateWorkerDeploymentVersionComputeConfigRequest_ScalingGroupUpdate' + description: |- + Optional. Contains the compute config scaling groups to add or updated for the Worker + Deployment. + removeComputeConfigScalingGroups: + type: array + items: + type: string + description: Optional. Contains the compute config scaling groups to remove from the Worker Deployment. + identity: + type: string + description: Optional. The identity of the client who initiated this request. + requestId: + type: string + description: |- + A unique identifier for this create request for idempotence. Typically UUIDv4. + If a second request with the same ID is recieved, it is considered a successful no-op. + Retrying with a different request ID for the same deployment name + build ID is an error. + conflictToken: + type: string + description: |- + Optional. This value is returned so that it can be optionally passed to APIs + that write to the Worker Deployment state to ensure that the state + did not change between this API call and a future write. + format: bytes + description: Used to update the compute config of a Worker Deployment Version. + UpdateWorkerDeploymentVersionComputeConfigRequest_ScalingGroupUpdate: + type: object + properties: + scalingGroup: + $ref: '#/components/schemas/ComputeConfigScalingGroup' + updateMask: + type: string + description: Controls which fields from `scaling_group` will be applied + format: field-mask + UpdateWorkerDeploymentVersionComputeConfigResponse: + type: object + properties: + conflictToken: + type: string + description: |- + This value is returned so that it can be optionally passed to APIs that + write to the WorkerDeployment state to ensure that the state did not + change between this API call and a future write. + format: bytes UpdateWorkerDeploymentVersionMetadataRequest: type: object properties: @@ -15304,6 +15657,26 @@ components: that is a single JSON string for use in user interfaces. User interface formatting may apply to this text in common use. The payload data section is limited to 20000 bytes by default. description: Information a user can set, often for use by user interfaces. + ValidateWorkerDeploymentVersionComputeConfigRequest: + type: object + properties: + namespace: + type: string + deploymentVersion: + allOf: + - $ref: '#/components/schemas/WorkerDeploymentVersion' + description: Required. + computeConfig: + allOf: + - $ref: '#/components/schemas/ComputeConfig' + description: Required. Contains the new worker compute configuration for the Worker Deployment. + identity: + type: string + description: Optional. The identity of the client who initiated this request. + description: Used to validate the compute config without attaching it to a Worker Deployment Version. + ValidateWorkerDeploymentVersionComputeConfigResponse: + type: object + properties: {} VersionDrainageInfo: type: object properties: @@ -15519,12 +15892,6 @@ components: Indicates whether the routing_config has been fully propagated to all relevant task queues and their partitions. format: enum - computeConfig: - allOf: - - $ref: '#/components/schemas/ComputeConfig' - description: |- - Contains information used by worker control plane controllers to handle - scale events. description: "A Worker Deployment (Deployment, for short) represents all workers serving \n a shared set of Task Queues. Typically, a Deployment represents one service or \n application.\n A Deployment contains multiple Deployment Versions, each representing a different \n version of workers. (see documentation of WorkerDeploymentVersionInfo)\n Deployment records are created in Temporal server automatically when their\n first poller arrives to the server.\n Experimental. Worker Deployments are experimental and might significantly change in the future." WorkerDeploymentInfo_WorkerDeploymentVersionSummary: type: object @@ -15736,6 +16103,12 @@ components: allOf: - $ref: '#/components/schemas/VersionMetadata' description: Arbitrary user-provided metadata attached to this version. + computeConfig: + allOf: + - $ref: '#/components/schemas/ComputeConfig' + description: |- + Optional. Contains the new worker compute configuration for the Worker + Deployment. Used for worker scale management. description: "A Worker Deployment Version (Version, for short) represents all workers of the same \n code and config within a Deployment. Workers of the same Version are expected to \n behave exactly the same so when executions move between them there are no \n non-determinism issues.\n Worker Deployment Versions are created in Temporal server automatically when \n their first poller arrives to the server.\n Experimental. Worker Deployments are experimental and might significantly change in the future." WorkerDeploymentVersionInfo_VersionTaskQueueInfo: type: object diff --git a/temporal/api/compute/v1/config.proto b/temporal/api/compute/v1/config.proto index 9423ce5ed..04909a854 100644 --- a/temporal/api/compute/v1/config.proto +++ b/temporal/api/compute/v1/config.proto @@ -11,15 +11,35 @@ option csharp_namespace = "Temporalio.Api.Compute.V1"; import "temporal/api/compute/v1/provider.proto"; import "temporal/api/compute/v1/scaler.proto"; +import "temporal/api/enums/v1/task_queue.proto"; + +message ComputeConfigScalingGroup { + // Optional. The set of task queue types this scaling group serves. + // If not provided, this scaling group serves all not otherwise defined + // task types. + repeated temporal.api.enums.v1.TaskQueueType task_queue_types = 1; -// ComputeConfig stores configuration that helps a worker control plane -// controller understand *when* and *how* to respond to worker lifecycle -// events. -message ComputeConfig { // Stores instructions for a worker control plane controller how to respond // to worker lifeycle events. - temporal.api.compute.v1.ComputeProvider provider = 1; + temporal.api.compute.v1.ComputeProvider provider = 3; + // Informs a worker lifecycle controller *when* and *how often* to perform // certain worker lifecycle actions like starting a serverless worker. - temporal.api.compute.v1.ComputeScaler scaler = 2; + temporal.api.compute.v1.ComputeScaler scaler = 4; +} + +// ComputeConfig stores configuration that helps a worker control plane +// controller understand *when* and *how* to respond to worker lifecycle +// events. +message ComputeConfig { + + // Each scaling group describes a compute config for a specific subset of the worker + // deployment version: covering a specific set of task types and/or regions. + // Having different configurations for different task types, allows independent + // tuning of activity and workflow task processing (for example). + // + // The key of the map is the ID of the scaling group used to reference it in subsequent + // update calls. + map scaling_groups = 1; } + diff --git a/temporal/api/compute/v1/provider.proto b/temporal/api/compute/v1/provider.proto index 0ce446f6a..ed0baf9d5 100644 --- a/temporal/api/compute/v1/provider.proto +++ b/temporal/api/compute/v1/provider.proto @@ -21,19 +21,14 @@ message ComputeProvider { // can be used by implementations to understand how to interpret the // contents of the provider_details field. string type = 1; + // Contains provider-specific instructions and configuration. - oneof detail { - // will be an unencrypted, JSON-encoded object of provider-specific - // information - // (-- api-linter: core::0146::any=disabled - // aip.dev/not-precedent: This needs to be extensible to - // externally-written compute providers --) - string detail_json = 2; - // will be an encrypted, encoded bytestring containing - // provider-specific information. The implementation must understand - // how to decrypt the payload. - temporal.api.common.v1.Payload detail_payload = 3; - } + // For server-implemented providers, use the SDK's default content + // converter to ensure the server can understand it. + // For remote-implemented providers, you might use your own content + // converters according to what the remote endpoints understand. + temporal.api.common.v1.Payload details = 2; + // Optional. If the compute provider is a Nexus service, this should point // there. string nexus_endpoint = 10; diff --git a/temporal/api/compute/v1/scaler.proto b/temporal/api/compute/v1/scaler.proto index 7fbb7da74..95c751800 100644 --- a/temporal/api/compute/v1/scaler.proto +++ b/temporal/api/compute/v1/scaler.proto @@ -9,14 +9,20 @@ option java_outer_classname = "ScalerProto"; option ruby_package = "Temporalio::Api::Compute::V1"; option csharp_namespace = "Temporalio.Api.Compute.V1"; +import "temporal/api/common/v1/message.proto"; + // ComputeScaler instructs the Temporal Service when to scale up or down the number of // Workers that comprise a WorkerDeployment. message ComputeScaler { - // The lower limit for the number of Workers (in the WorkerDeployment) to - // which the ComputeScaler can scale down. - int32 min_instances = 1; - // The upper limit for the number of Workers (in the WorkerDeployment) to - // which the ComputeScaler can scale up. Must be greater than or equal to - // min_instances. - int32 max_instances = 2; + // Type of the compute scaler. this string is implementation-specific and + // can be used by implementations to understand how to interpret the + // contents of the scaler_details field. + string type = 1; + + // Contains scaler-specific instructions and configuration. + // For server-implemented scalers, use the SDK's default content + // converter to ensure the server can understand it. + // For remote-implemented scalers, you might use your own content + // converters according to what the remote endpoints understand. + temporal.api.common.v1.Payload details = 2; } diff --git a/temporal/api/deployment/v1/message.proto b/temporal/api/deployment/v1/message.proto index 11a2ccfa2..4480e6d93 100644 --- a/temporal/api/deployment/v1/message.proto +++ b/temporal/api/deployment/v1/message.proto @@ -159,6 +159,10 @@ message WorkerDeploymentVersionInfo { // Arbitrary user-provided metadata attached to this version. VersionMetadata metadata = 10; + + // Optional. Contains the new worker compute configuration for the Worker + // Deployment. Used for worker scale management. + temporal.api.compute.v1.ComputeConfig compute_config = 16; } // Information about workflow drainage to help the user determine when it is safe @@ -212,10 +216,6 @@ message WorkerDeploymentInfo { // relevant task queues and their partitions. temporal.api.enums.v1.RoutingConfigUpdateState routing_config_update_state = 7; - // Contains information used by worker control plane controllers to handle - // scale events. - temporal.api.compute.v1.ComputeConfig compute_config = 20; - message WorkerDeploymentVersionSummary { // Deprecated. Use `deployment_version`. string version = 1 [deprecated = true]; diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 05c784881..a43830bca 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1268,10 +1268,10 @@ message GetSystemInfoResponse { // This flag is dependent both on server version and for Nexus to be enabled via server configuration. bool nexus = 11; - // True if the server supports serverless deployments. - // This flag is dependent both on server version and for serverless deployments + // True if the server supports server-scaled deployments. + // This flag is dependent both on server version and for server-scaled deployments // to be enabled via server configuration. - bool serverless_deployments = 12; + bool server_scaled_deployments = 12; } } @@ -2357,10 +2357,6 @@ message CreateWorkerDeploymentRequest { // this name already exists, an error will be returned. string deployment_name = 2; - // Optional. Contains the new worker compute configuration for the Worker - // Deployment. Used for worker scale management. - temporal.api.compute.v1.ComputeConfig compute_config = 3; - // Optional. The identity of the client who initiated this request. string identity = 4; // A unique identifier for this create request for idempotence. Typically UUIDv4. @@ -2400,6 +2396,32 @@ message ListWorkerDeploymentsResponse { } } +// Creates a new WorkerDeploymentVersion. +message CreateWorkerDeploymentVersionRequest { + string namespace = 1; + // Required. + temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 2; + + // Optional. Contains the new worker compute configuration for the Worker + // Deployment. Used for worker scale management. + temporal.api.compute.v1.ComputeConfig compute_config = 4; + + // Optional. The identity of the client who initiated this request. + string identity = 3; + + // A unique identifier for this create request for idempotence. Typically UUIDv4. + // If a second request with the same ID is recieved, it is considered a successful no-op. + // Retrying with a different request ID for the same deployment name + build ID is an error. + string request_id = 5; +} + +message CreateWorkerDeploymentVersionResponse { + // This value is returned so that it can be optionally passed to APIs that + // write to the WorkerDeployment state to ensure that the state did not + // change between this API call and a future write. + bytes conflict_token = 1; +} + // Used for manual deletion of Versions. User can delete a Version only when all the // following conditions are met: // - It is not the Current or Ramping Version of its Deployment. @@ -2434,6 +2456,65 @@ message DeleteWorkerDeploymentRequest { message DeleteWorkerDeploymentResponse { } +// Used to update the compute config of a Worker Deployment Version. +message UpdateWorkerDeploymentVersionComputeConfigRequest { + string namespace = 1; + + // Required. + temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 2; + + message ScalingGroupUpdate { + temporal.api.compute.v1.ComputeConfigScalingGroup scaling_group = 1; + + // Controls which fields from `scaling_group` will be applied + google.protobuf.FieldMask update_mask = 2; + } + + // Optional. Contains the compute config scaling groups to add or updated for the Worker + // Deployment. + map compute_config_scaling_groups = 6; + + // Optional. Contains the compute config scaling groups to remove from the Worker Deployment. + repeated string remove_compute_config_scaling_groups = 7; + + // Optional. The identity of the client who initiated this request. + string identity = 3; + + // A unique identifier for this create request for idempotence. Typically UUIDv4. + // If a second request with the same ID is recieved, it is considered a successful no-op. + // Retrying with a different request ID for the same deployment name + build ID is an error. + string request_id = 4; + + // Optional. This value is returned so that it can be optionally passed to APIs + // that write to the Worker Deployment state to ensure that the state + // did not change between this API call and a future write. + bytes conflict_token = 5; +} + +message UpdateWorkerDeploymentVersionComputeConfigResponse { + // This value is returned so that it can be optionally passed to APIs that + // write to the WorkerDeployment state to ensure that the state did not + // change between this API call and a future write. + bytes conflict_token = 1; +} + +// Used to validate the compute config without attaching it to a Worker Deployment Version. +message ValidateWorkerDeploymentVersionComputeConfigRequest { + string namespace = 1; + + // Required. + temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 2; + + // Required. Contains the new worker compute configuration for the Worker Deployment. + temporal.api.compute.v1.ComputeConfig compute_config = 4; + + // Optional. The identity of the client who initiated this request. + string identity = 3; +} + +message ValidateWorkerDeploymentVersionComputeConfigResponse { +} + // Used to update the user-defined metadata of a Worker Deployment Version. message UpdateWorkerDeploymentVersionMetadataRequest { string namespace = 1; diff --git a/temporal/api/workflowservice/v1/service.proto b/temporal/api/workflowservice/v1/service.proto index 5ddbb7b52..914bbaf83 100644 --- a/temporal/api/workflowservice/v1/service.proto +++ b/temporal/api/workflowservice/v1/service.proto @@ -1131,6 +1131,47 @@ service WorkflowService { }; } + // Creates a new Worker Deployment Version. + // + // Experimental. This API might significantly change or be removed in a + // future release. + rpc CreateWorkerDeploymentVersion (CreateWorkerDeploymentVersionRequest) returns (CreateWorkerDeploymentVersionResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}" + body: "*" + } + }; + } + + // Updates the compute config attached to a Worker Deployment Version. + // Experimental. This API might significantly change or be removed in a future release. + rpc UpdateWorkerDeploymentVersionComputeConfig (UpdateWorkerDeploymentVersionComputeConfigRequest) returns (UpdateWorkerDeploymentVersionComputeConfigResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/update-compute-config" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/update-compute-config" + body: "*" + } + }; + } + + // Validates the compute config without attaching it to a Worker Deployment Version. + // Experimental. This API might significantly change or be removed in a future release. + rpc ValidateWorkerDeploymentVersionComputeConfig (ValidateWorkerDeploymentVersionComputeConfigRequest) returns (ValidateWorkerDeploymentVersionComputeConfigResponse) { + option (google.api.http) = { + post: "/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/validate-compute-config" + body: "*" + additional_bindings { + post: "/api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}/validate-compute-config" + body: "*" + } + }; + } + // Updates the user-given metadata attached to a Worker Deployment Version. // Experimental. This API might significantly change or be removed in a future release. rpc UpdateWorkerDeploymentVersionMetadata (UpdateWorkerDeploymentVersionMetadataRequest) returns (UpdateWorkerDeploymentVersionMetadataResponse) { From 9fb55c7bf0fcec1fbde8bdab7227ed0704fcbc0c Mon Sep 17 00:00:00 2001 From: ShahabT Date: Mon, 23 Mar 2026 18:02:38 -0700 Subject: [PATCH 34/40] Remove conflict token from CreateWorkerDeploymentVersion --- openapi/openapiv2.json | 23 ++--------------- openapi/openapiv3.yaml | 25 ++----------------- .../workflowservice/v1/request_response.proto | 13 ---------- 3 files changed, 4 insertions(+), 57 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 35b6224df..c64d35c52 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -10982,11 +10982,6 @@ "requestId": { "type": "string", "description": "A unique identifier for this create request for idempotence. Typically UUIDv4.\nIf a second request with the same ID is recieved, it is considered a successful no-op.\nRetrying with a different request ID for the same deployment name + build ID is an error." - }, - "conflictToken": { - "type": "string", - "format": "byte", - "description": "Optional. This value is returned so that it can be optionally passed to APIs\nthat write to the Worker Deployment state to ensure that the state\ndid not change between this API call and a future write." } }, "description": "Used to update the compute config of a Worker Deployment Version." @@ -12682,14 +12677,7 @@ } }, "v1CreateWorkerDeploymentVersionResponse": { - "type": "object", - "properties": { - "conflictToken": { - "type": "string", - "format": "byte", - "description": "This value is returned so that it can be optionally passed to APIs that\nwrite to the WorkerDeployment state to ensure that the state did not\nchange between this API call and a future write." - } - } + "type": "object" }, "v1CreateWorkflowRuleResponse": { "type": "object", @@ -17170,14 +17158,7 @@ } }, "v1UpdateWorkerDeploymentVersionComputeConfigResponse": { - "type": "object", - "properties": { - "conflictToken": { - "type": "string", - "format": "byte", - "description": "This value is returned so that it can be optionally passed to APIs that\nwrite to the WorkerDeployment state to ensure that the state did not\nchange between this API call and a future write." - } - } + "type": "object" }, "v1UpdateWorkerDeploymentVersionMetadataResponse": { "type": "object", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index c14963a7b..001193c90 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -9657,14 +9657,7 @@ components: description: Creates a new WorkerDeploymentVersion. CreateWorkerDeploymentVersionResponse: type: object - properties: - conflictToken: - type: string - description: |- - This value is returned so that it can be optionally passed to APIs that - write to the WorkerDeployment state to ensure that the state did not - change between this API call and a future write. - format: bytes + properties: {} CreateWorkflowRuleRequest: type: object properties: @@ -15464,13 +15457,6 @@ components: A unique identifier for this create request for idempotence. Typically UUIDv4. If a second request with the same ID is recieved, it is considered a successful no-op. Retrying with a different request ID for the same deployment name + build ID is an error. - conflictToken: - type: string - description: |- - Optional. This value is returned so that it can be optionally passed to APIs - that write to the Worker Deployment state to ensure that the state - did not change between this API call and a future write. - format: bytes description: Used to update the compute config of a Worker Deployment Version. UpdateWorkerDeploymentVersionComputeConfigRequest_ScalingGroupUpdate: type: object @@ -15483,14 +15469,7 @@ components: format: field-mask UpdateWorkerDeploymentVersionComputeConfigResponse: type: object - properties: - conflictToken: - type: string - description: |- - This value is returned so that it can be optionally passed to APIs that - write to the WorkerDeployment state to ensure that the state did not - change between this API call and a future write. - format: bytes + properties: {} UpdateWorkerDeploymentVersionMetadataRequest: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index a43830bca..4d0bc5a63 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2416,10 +2416,6 @@ message CreateWorkerDeploymentVersionRequest { } message CreateWorkerDeploymentVersionResponse { - // This value is returned so that it can be optionally passed to APIs that - // write to the WorkerDeployment state to ensure that the state did not - // change between this API call and a future write. - bytes conflict_token = 1; } // Used for manual deletion of Versions. User can delete a Version only when all the @@ -2484,18 +2480,9 @@ message UpdateWorkerDeploymentVersionComputeConfigRequest { // If a second request with the same ID is recieved, it is considered a successful no-op. // Retrying with a different request ID for the same deployment name + build ID is an error. string request_id = 4; - - // Optional. This value is returned so that it can be optionally passed to APIs - // that write to the Worker Deployment state to ensure that the state - // did not change between this API call and a future write. - bytes conflict_token = 5; } message UpdateWorkerDeploymentVersionComputeConfigResponse { - // This value is returned so that it can be optionally passed to APIs that - // write to the WorkerDeployment state to ensure that the state did not - // change between this API call and a future write. - bytes conflict_token = 1; } // Used to validate the compute config without attaching it to a Worker Deployment Version. From 09971272ae24b26eca7a46ba9f694fb9d3e394ff Mon Sep 17 00:00:00 2001 From: ShahabT Date: Tue, 24 Mar 2026 13:04:43 -0700 Subject: [PATCH 35/40] add a missing deprecation mark for version_info.deployment_name --- openapi/openapiv2.json | 3 ++- openapi/openapiv3.yaml | 1 + temporal/api/deployment/v1/message.proto | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index c64d35c52..f63a6146e 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -17450,7 +17450,8 @@ "description": "Required." }, "deploymentName": { - "type": "string" + "type": "string", + "description": "Deprecated. User deployment_version.deployment_name." }, "createTime": { "type": "string", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 001193c90..0d44dde95 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -16011,6 +16011,7 @@ components: description: Required. deploymentName: type: string + description: Deprecated. User deployment_version.deployment_name. createTime: type: string format: date-time diff --git a/temporal/api/deployment/v1/message.proto b/temporal/api/deployment/v1/message.proto index 4480e6d93..d047ab98b 100644 --- a/temporal/api/deployment/v1/message.proto +++ b/temporal/api/deployment/v1/message.proto @@ -103,6 +103,7 @@ message WorkerDeploymentVersionInfo { // Required. WorkerDeploymentVersion deployment_version = 11; + // Deprecated. User deployment_version.deployment_name. string deployment_name = 2; google.protobuf.Timestamp create_time = 3; From bd50f1818a356278c3ba9611ce39bb9f61b4266a Mon Sep 17 00:00:00 2001 From: ShahabT Date: Tue, 24 Mar 2026 14:50:44 -0700 Subject: [PATCH 36/40] add WORKER_DEPLOYMENT_VERSION_STATUS_CREATED --- openapi/openapiv2.json | 5 +++-- openapi/openapiv3.yaml | 2 ++ temporal/api/enums/v1/deployment.proto | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index f63a6146e..5e8bf4f09 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -17523,10 +17523,11 @@ "WORKER_DEPLOYMENT_VERSION_STATUS_CURRENT", "WORKER_DEPLOYMENT_VERSION_STATUS_RAMPING", "WORKER_DEPLOYMENT_VERSION_STATUS_DRAINING", - "WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED" + "WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED", + "WORKER_DEPLOYMENT_VERSION_STATUS_CREATED" ], "default": "WORKER_DEPLOYMENT_VERSION_STATUS_UNSPECIFIED", - "description": "Specify the status of a Worker Deployment Version.\nExperimental. Worker Deployments are experimental and might significantly change in the future.\n\n - WORKER_DEPLOYMENT_VERSION_STATUS_INACTIVE: The Worker Deployment Version has been created inside the Worker Deployment but is not used by any\nworkflow executions. These Versions can still have workflows if they have an explicit Versioning Override targeting\nthis Version. Such Versioning Override could be set at workflow start time, or at a later time via `UpdateWorkflowExecutionOptions`.\n - WORKER_DEPLOYMENT_VERSION_STATUS_CURRENT: The Worker Deployment Version is the current version of the Worker Deployment. All new workflow executions \nand tasks of existing unversioned or AutoUpgrade workflows are routed to this version.\n - WORKER_DEPLOYMENT_VERSION_STATUS_RAMPING: The Worker Deployment Version is the ramping version of the Worker Deployment. A subset of new Pinned workflow executions are \nrouted to this version. Moreover, a portion of existing unversioned or AutoUpgrade workflow executions are also routed to this version.\n - WORKER_DEPLOYMENT_VERSION_STATUS_DRAINING: The Worker Deployment Version is not used by new workflows but is still used by\nopen pinned workflows. The version cannot be decommissioned safely.\n - WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED: The Worker Deployment Version is not used by new or open workflows, but might be still needed by\nQueries sent to closed workflows. The version can be decommissioned safely if user does\nnot query closed workflows. If the user does query closed workflows for some time x after\nworkflows are closed, they should decommission the version after it has been drained for that duration." + "description": "Specify the status of a Worker Deployment Version.\nExperimental. Worker Deployments are experimental and might significantly change in the future.\n\n - WORKER_DEPLOYMENT_VERSION_STATUS_INACTIVE: The Worker Deployment Version has been created inside the Worker Deployment but is not used by any\nworkflow executions. These Versions can still have workflows if they have an explicit Versioning Override targeting\nthis Version. Such Versioning Override could be set at workflow start time, or at a later time via `UpdateWorkflowExecutionOptions`.\n - WORKER_DEPLOYMENT_VERSION_STATUS_CURRENT: The Worker Deployment Version is the current version of the Worker Deployment. All new workflow executions \nand tasks of existing unversioned or AutoUpgrade workflows are routed to this version.\n - WORKER_DEPLOYMENT_VERSION_STATUS_RAMPING: The Worker Deployment Version is the ramping version of the Worker Deployment. A subset of new Pinned workflow executions are \nrouted to this version. Moreover, a portion of existing unversioned or AutoUpgrade workflow executions are also routed to this version.\n - WORKER_DEPLOYMENT_VERSION_STATUS_DRAINING: The Worker Deployment Version is not used by new workflows but is still used by\nopen pinned workflows. The version cannot be decommissioned safely.\n - WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED: The Worker Deployment Version is not used by new or open workflows, but might be still needed by\nQueries sent to closed workflows. The version can be decommissioned safely if user does\nnot query closed workflows. If the user does query closed workflows for some time x after\nworkflows are closed, they should decommission the version after it has been drained for that duration.\n - WORKER_DEPLOYMENT_VERSION_STATUS_CREATED: The Worker Deployment Version is created by user (via `CreateWorkerDeploymentVersion` API)\nbut server has not seen any poller for it yet." }, "v1WorkerHeartbeat": { "type": "object", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 0d44dde95..42a3f3eb4 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -15886,6 +15886,7 @@ components: - WORKER_DEPLOYMENT_VERSION_STATUS_RAMPING - WORKER_DEPLOYMENT_VERSION_STATUS_DRAINING - WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED + - WORKER_DEPLOYMENT_VERSION_STATUS_CREATED type: string description: The status of the Worker Deployment Version. format: enum @@ -16002,6 +16003,7 @@ components: - WORKER_DEPLOYMENT_VERSION_STATUS_RAMPING - WORKER_DEPLOYMENT_VERSION_STATUS_DRAINING - WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED + - WORKER_DEPLOYMENT_VERSION_STATUS_CREATED type: string description: The status of the Worker Deployment Version. format: enum diff --git a/temporal/api/enums/v1/deployment.proto b/temporal/api/enums/v1/deployment.proto index 710d7c38d..e3792d9e5 100644 --- a/temporal/api/enums/v1/deployment.proto +++ b/temporal/api/enums/v1/deployment.proto @@ -97,4 +97,7 @@ enum WorkerDeploymentVersionStatus { // not query closed workflows. If the user does query closed workflows for some time x after // workflows are closed, they should decommission the version after it has been drained for that duration. WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED = 5; + // The Worker Deployment Version is created by user (via `CreateWorkerDeploymentVersion` API) + // but server has not seen any poller for it yet. + WORKER_DEPLOYMENT_VERSION_STATUS_CREATED = 6; } From ba8f74400a975fe237c1866119f6604f3a111d3d Mon Sep 17 00:00:00 2001 From: ShahabT Date: Fri, 27 Mar 2026 13:52:07 -0700 Subject: [PATCH 37/40] Add last_modifier_identity for WDV --- openapi/openapiv2.json | 4 ++++ openapi/openapiv3.yaml | 8 ++++++++ temporal/api/deployment/v1/message.proto | 7 +++++++ 3 files changed, 19 insertions(+) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 5e8bf4f09..cbcffe70d 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -17511,6 +17511,10 @@ "computeConfig": { "$ref": "#/definitions/v1ComputeConfig", "description": "Optional. Contains the new worker compute configuration for the Worker\nDeployment. Used for worker scale management." + }, + "lastModifierIdentity": { + "type": "string", + "title": "Identity of the last client who modified the configuration of this Version.\nAs of now, this field only covers changes through the following APIs:\n- `CreateWorkerDeploymentVersion`\n- `UpdateWorkerDeploymentVersionComputeConfig`\n- `UpdateWorkerDeploymentVersionMetadata`" } }, "description": "A Worker Deployment Version (Version, for short) represents all workers of the same \ncode and config within a Deployment. Workers of the same Version are expected to \nbehave exactly the same so when executions move between them there are no \nnon-determinism issues.\nWorker Deployment Versions are created in Temporal server automatically when \ntheir first poller arrives to the server.\nExperimental. Worker Deployments are experimental and might significantly change in the future." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 42a3f3eb4..055d6c103 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -16091,6 +16091,14 @@ components: description: |- Optional. Contains the new worker compute configuration for the Worker Deployment. Used for worker scale management. + lastModifierIdentity: + type: string + description: |- + Identity of the last client who modified the configuration of this Version. + As of now, this field only covers changes through the following APIs: + - `CreateWorkerDeploymentVersion` + - `UpdateWorkerDeploymentVersionComputeConfig` + - `UpdateWorkerDeploymentVersionMetadata` description: "A Worker Deployment Version (Version, for short) represents all workers of the same \n code and config within a Deployment. Workers of the same Version are expected to \n behave exactly the same so when executions move between them there are no \n non-determinism issues.\n Worker Deployment Versions are created in Temporal server automatically when \n their first poller arrives to the server.\n Experimental. Worker Deployments are experimental and might significantly change in the future." WorkerDeploymentVersionInfo_VersionTaskQueueInfo: type: object diff --git a/temporal/api/deployment/v1/message.proto b/temporal/api/deployment/v1/message.proto index d047ab98b..6fdd28814 100644 --- a/temporal/api/deployment/v1/message.proto +++ b/temporal/api/deployment/v1/message.proto @@ -164,6 +164,13 @@ message WorkerDeploymentVersionInfo { // Optional. Contains the new worker compute configuration for the Worker // Deployment. Used for worker scale management. temporal.api.compute.v1.ComputeConfig compute_config = 16; + + // Identity of the last client who modified the configuration of this Version. + // As of now, this field only covers changes through the following APIs: + // - `CreateWorkerDeploymentVersion` + // - `UpdateWorkerDeploymentVersionComputeConfig` + // - `UpdateWorkerDeploymentVersionMetadata` + string last_modifier_identity = 17; } // Information about workflow drainage to help the user determine when it is safe From e76665fc300393ef7f04727b0ecfdd0df48269ae Mon Sep 17 00:00:00 2001 From: ShahabT Date: Fri, 27 Mar 2026 16:40:08 -0700 Subject: [PATCH 38/40] Support partial update in ValidateWorkerDeploymentVersionComputeConfigRequest --- openapi/openapiv2.json | 42 +++++++++++------- openapi/openapiv3.yaml | 43 +++++++++++++------ temporal/api/compute/v1/config.proto | 13 ++++++ .../workflowservice/v1/request_response.proto | 17 +++----- 4 files changed, 75 insertions(+), 40 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index cbcffe70d..088da922a 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -9368,18 +9368,6 @@ } } }, - "UpdateWorkerDeploymentVersionComputeConfigRequestScalingGroupUpdate": { - "type": "object", - "properties": { - "scalingGroup": { - "$ref": "#/definitions/v1ComputeConfigScalingGroup" - }, - "updateMask": { - "type": "string", - "title": "Controls which fields from `scaling_group` will be applied" - } - } - }, "VersioningOverridePinnedOverride": { "type": "object", "properties": { @@ -10964,7 +10952,7 @@ "computeConfigScalingGroups": { "type": "object", "additionalProperties": { - "$ref": "#/definitions/UpdateWorkerDeploymentVersionComputeConfigRequestScalingGroupUpdate" + "$ref": "#/definitions/v1ComputeConfigScalingGroupUpdate" }, "description": "Optional. Contains the compute config scaling groups to add or updated for the Worker\nDeployment." }, @@ -11099,9 +11087,19 @@ "description": "Required.", "title": "Required." }, - "computeConfig": { - "$ref": "#/definitions/v1ComputeConfig", - "description": "Required. Contains the new worker compute configuration for the Worker Deployment." + "computeConfigScalingGroups": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v1ComputeConfigScalingGroupUpdate" + }, + "description": "Optional. Contains the compute config scaling groups to add or updated for the Worker\nDeployment." + }, + "removeComputeConfigScalingGroups": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Optional. Contains the compute config scaling groups to remove from the Worker Deployment." }, "identity": { "type": "string", @@ -12467,6 +12465,18 @@ } } }, + "v1ComputeConfigScalingGroupUpdate": { + "type": "object", + "properties": { + "scalingGroup": { + "$ref": "#/definitions/v1ComputeConfigScalingGroup" + }, + "updateMask": { + "type": "string", + "title": "Controls which fields from `scaling_group` will be applied. Semantics:\n- Mask is ignored for new scaling groups (only applicable when scaling group already exists).\n- Empty mask for an existing scaling group is no-op: no change.\n- Non-empty mask for an existing scaling group will update/unset only to the fields\n mentioned in the mask.\n- Accepted paths: \"task_queue_types\", \"provider\", \"provider.type\", \"provider.details\",\n \"provider.nexus_endpoint\", \"scaler\", \"scaler.type\", \"scaler.details\"" + } + } + }, "v1ComputeProvider": { "type": "object", "properties": { diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 055d6c103..c84d02602 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -9405,6 +9405,22 @@ components: description: |- Informs a worker lifecycle controller *when* and *how often* to perform certain worker lifecycle actions like starting a serverless worker. + ComputeConfigScalingGroupUpdate: + type: object + properties: + scalingGroup: + $ref: '#/components/schemas/ComputeConfigScalingGroup' + updateMask: + type: string + description: |- + Controls which fields from `scaling_group` will be applied. Semantics: + - Mask is ignored for new scaling groups (only applicable when scaling group already exists). + - Empty mask for an existing scaling group is no-op: no change. + - Non-empty mask for an existing scaling group will update/unset only to the fields + mentioned in the mask. + - Accepted paths: "task_queue_types", "provider", "provider.type", "provider.details", + "provider.nexus_endpoint", "scaler", "scaler.type", "scaler.details" + format: field-mask ComputeProvider: type: object properties: @@ -15439,7 +15455,7 @@ components: computeConfigScalingGroups: type: object additionalProperties: - $ref: '#/components/schemas/UpdateWorkerDeploymentVersionComputeConfigRequest_ScalingGroupUpdate' + $ref: '#/components/schemas/ComputeConfigScalingGroupUpdate' description: |- Optional. Contains the compute config scaling groups to add or updated for the Worker Deployment. @@ -15458,15 +15474,6 @@ components: If a second request with the same ID is recieved, it is considered a successful no-op. Retrying with a different request ID for the same deployment name + build ID is an error. description: Used to update the compute config of a Worker Deployment Version. - UpdateWorkerDeploymentVersionComputeConfigRequest_ScalingGroupUpdate: - type: object - properties: - scalingGroup: - $ref: '#/components/schemas/ComputeConfigScalingGroup' - updateMask: - type: string - description: Controls which fields from `scaling_group` will be applied - format: field-mask UpdateWorkerDeploymentVersionComputeConfigResponse: type: object properties: {} @@ -15645,10 +15652,18 @@ components: allOf: - $ref: '#/components/schemas/WorkerDeploymentVersion' description: Required. - computeConfig: - allOf: - - $ref: '#/components/schemas/ComputeConfig' - description: Required. Contains the new worker compute configuration for the Worker Deployment. + computeConfigScalingGroups: + type: object + additionalProperties: + $ref: '#/components/schemas/ComputeConfigScalingGroupUpdate' + description: |- + Optional. Contains the compute config scaling groups to add or updated for the Worker + Deployment. + removeComputeConfigScalingGroups: + type: array + items: + type: string + description: Optional. Contains the compute config scaling groups to remove from the Worker Deployment. identity: type: string description: Optional. The identity of the client who initiated this request. diff --git a/temporal/api/compute/v1/config.proto b/temporal/api/compute/v1/config.proto index 04909a854..73e481ea9 100644 --- a/temporal/api/compute/v1/config.proto +++ b/temporal/api/compute/v1/config.proto @@ -12,6 +12,7 @@ option csharp_namespace = "Temporalio.Api.Compute.V1"; import "temporal/api/compute/v1/provider.proto"; import "temporal/api/compute/v1/scaler.proto"; import "temporal/api/enums/v1/task_queue.proto"; +import "google/protobuf/field_mask.proto"; message ComputeConfigScalingGroup { // Optional. The set of task queue types this scaling group serves. @@ -43,3 +44,15 @@ message ComputeConfig { map scaling_groups = 1; } +message ComputeConfigScalingGroupUpdate { + ComputeConfigScalingGroup scaling_group = 1; + + // Controls which fields from `scaling_group` will be applied. Semantics: + // - Mask is ignored for new scaling groups (only applicable when scaling group already exists). + // - Empty mask for an existing scaling group is no-op: no change. + // - Non-empty mask for an existing scaling group will update/unset only to the fields + // mentioned in the mask. + // - Accepted paths: "task_queue_types", "provider", "provider.type", "provider.details", + // "provider.nexus_endpoint", "scaler", "scaler.type", "scaler.details" + google.protobuf.FieldMask update_mask = 2; +} diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 4d0bc5a63..36a8a7032 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2459,16 +2459,9 @@ message UpdateWorkerDeploymentVersionComputeConfigRequest { // Required. temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 2; - message ScalingGroupUpdate { - temporal.api.compute.v1.ComputeConfigScalingGroup scaling_group = 1; - - // Controls which fields from `scaling_group` will be applied - google.protobuf.FieldMask update_mask = 2; - } - // Optional. Contains the compute config scaling groups to add or updated for the Worker // Deployment. - map compute_config_scaling_groups = 6; + map compute_config_scaling_groups = 6; // Optional. Contains the compute config scaling groups to remove from the Worker Deployment. repeated string remove_compute_config_scaling_groups = 7; @@ -2492,8 +2485,12 @@ message ValidateWorkerDeploymentVersionComputeConfigRequest { // Required. temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 2; - // Required. Contains the new worker compute configuration for the Worker Deployment. - temporal.api.compute.v1.ComputeConfig compute_config = 4; + // Optional. Contains the compute config scaling groups to add or updated for the Worker + // Deployment. + map compute_config_scaling_groups = 6; + + // Optional. Contains the compute config scaling groups to remove from the Worker Deployment. + repeated string remove_compute_config_scaling_groups = 7; // Optional. The identity of the client who initiated this request. string identity = 3; From 2d60ae865cbe1babdbd015a5d29a02af25b0b872 Mon Sep 17 00:00:00 2001 From: ShahabT Date: Wed, 1 Apr 2026 16:10:05 -0700 Subject: [PATCH 39/40] cleanup for merging to master --- .github/workflows/trigger-api-go-update.yml | 1 - temporal/api/common/v1/message.proto | 9 --------- 2 files changed, 10 deletions(-) diff --git a/.github/workflows/trigger-api-go-update.yml b/.github/workflows/trigger-api-go-update.yml index 97008ca18..7a23b3c73 100644 --- a/.github/workflows/trigger-api-go-update.yml +++ b/.github/workflows/trigger-api-go-update.yml @@ -4,7 +4,6 @@ on: push: branches: - master - - serverless workflow_dispatch: inputs: branch: diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index ce8825e6a..419f08f68 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -15,7 +15,6 @@ import "google/protobuf/empty.proto"; import "temporal/api/enums/v1/common.proto"; import "temporal/api/enums/v1/event_type.proto"; import "temporal/api/enums/v1/reset.proto"; -import "temporal/api/enums/v1/task_queue.proto"; message DataBlob { temporal.api.enums.v1.EncodingType encoding_type = 1; @@ -80,14 +79,6 @@ message ActivityType { string name = 1; } -// Uniquely identifies a combination of task queue name and type. -// (-- api-linter: core::0123::resource-annotation=disabled -// aip.dev/not-precedent: this isn't a resource --) -message TaskQueueNameType { - string name = 1; - temporal.api.enums.v1.TaskQueueType type = 2; -} - // How retries ought to be handled, usable by both workflows and activities message RetryPolicy { // Interval of the first retry. If retryBackoffCoefficient is 1.0 then it is used for all retries. From 19dca221db59248712a9b6faad9bcf0a0e0f580a Mon Sep 17 00:00:00 2001 From: ShahabT Date: Fri, 3 Apr 2026 10:30:21 -0700 Subject: [PATCH 40/40] revert Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 965fa9b78..b4b33bdb5 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ STAMPDIR := .stamp COLOR := "\e[1;36m%s\e[0m\n" PROTO_ROOT := . -PROTO_FILES = $(shell find temporal -name "*.proto" -not -name "*.swp") +PROTO_FILES = $(shell find temporal -name "*.proto") PROTO_DIRS = $(sort $(dir $(PROTO_FILES))) PROTO_OUT := .gen PROTO_IMPORTS = \