diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index ea37162a0..2f2ff73f7 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -16743,6 +16743,10 @@ "pollerAutoscalingAutoEnroll": { "type": "boolean", "description": "When true, workers should use poller autoscaling by default unless explicitly configured otherwise." + }, + "workflowTaskCompletionPagination": { + "type": "boolean", + "description": "True if the namespace supports paginated workflow task completion, i.e.\n`RespondWorkflowTaskCompleted` requests split across multiple pages. SDKs must check this\ncapability before sending a request with `intermediate_page` set to true." } }, "description": "Namespace capability details. Should contain what features are enabled in a namespace." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index a2ec27cdd..d0cdbf076 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -13144,6 +13144,12 @@ components: pollerAutoscalingAutoEnroll: type: boolean description: When true, workers should use poller autoscaling by default unless explicitly configured otherwise. + workflowTaskCompletionPagination: + type: boolean + description: |- + True if the namespace supports paginated workflow task completion, i.e. + `RespondWorkflowTaskCompleted` requests split across multiple pages. SDKs must check this + capability before sending a request with `intermediate_page` set to true. description: Namespace capability details. Should contain what features are enabled in a namespace. NamespaceInfo_Limits: type: object diff --git a/temporal/api/errordetails/v1/message.proto b/temporal/api/errordetails/v1/message.proto index 2abb60db6..d2ae7c32d 100644 --- a/temporal/api/errordetails/v1/message.proto +++ b/temporal/api/errordetails/v1/message.proto @@ -137,3 +137,9 @@ message NexusOperationExecutionAlreadyStartedFailure { string start_request_id = 1; string run_id = 2; } + +// An error indicating that the server lost the buffered pages of a paginated workflow task +// completion. This is a transient error: the workflow task is still valid, and the client +// should resend all pages from page 0 using the same task token. +message WorkflowTaskCompletionBufferLostFailure { +} diff --git a/temporal/api/namespace/v1/message.proto b/temporal/api/namespace/v1/message.proto index a8b49dc8c..1c12dbaea 100644 --- a/temporal/api/namespace/v1/message.proto +++ b/temporal/api/namespace/v1/message.proto @@ -58,6 +58,10 @@ message NamespaceInfo { bool workflow_update_callbacks = 12; // When true, workers should use poller autoscaling by default unless explicitly configured otherwise. bool poller_autoscaling_auto_enroll = 13; + // True if the namespace supports paginated workflow task completion, i.e. + // `RespondWorkflowTaskCompleted` requests split across multiple pages. SDKs must check this + // capability before sending a request with `intermediate_page` set to true. + bool workflow_task_completion_pagination = 14; } // Namespace configured limits diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 263c3c8a0..92472bd18 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -424,6 +424,16 @@ message RespondWorkflowTaskCompletedRequest { // tasks (e.g. activity cancellation) to this specific worker instance. string worker_control_task_queue = 20; + // 0-indexed page number when the workflow task completion is split across multiple + // requests ("pages"). 0 for single-page requests. May only be set to non-zero value + // when the namespace capability workflow_task_completion_pagination is true. + int32 page_number = 21; + + // True for non-final pages of a paginated workflow task completion. The final page's + // `page_number` tells the server how many intermediate pages (0..page_number-1) preceded it. + // May only be used when the namespace capability workflow_task_completion_pagination is true. + bool intermediate_page = 22; + // SDK capability details. message Capabilities { // True if the SDK can handle speculative workflow task with command events. If true, the