Skip to content

Commit 7dfff2d

Browse files
authored
Workflow Command Pagination API (#800)
**What changed?** Added a paginated workflow task completion API: - `page_number` and `intermediate_page` fields on `RespondWorkflowTaskCompletedRequest`, letting a workflow task completion be split across multiple "page" requests sharing one task token. - `workflow_task_completion_pagination` namespace capability flag that SDKs must check before sending paginated requests. - `WorkflowTaskCompletionBufferLostFailure` signaling the server dropped buffered pages and the client should resend all pages from page 0. **Why?** Large workflow task completions can exceed request size limits. Pagination lets workers split a single completion across multiple requests. **Breaking changes** None. New fields/messages are additive; pagination is gated behind the namespace capability. **Server PR** TODO
1 parent 89a493f commit 7dfff2d

5 files changed

Lines changed: 25 additions & 0 deletions

File tree

openapi/openapiv2.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16795,6 +16795,10 @@
1679516795
"pollerAutoscalingAutoEnroll": {
1679616796
"type": "boolean",
1679716797
"description": "When true, workers should use poller autoscaling by default unless explicitly configured otherwise."
16798+
},
16799+
"workflowTaskCompletionPagination": {
16800+
"type": "boolean",
16801+
"description": "True if the namespace supports pagination of `RespondWorkflowTaskCompleted` request."
1679816802
}
1679916803
},
1680016804
"description": "Namespace capability details. Should contain what features are enabled in a namespace."

openapi/openapiv3.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13186,6 +13186,9 @@ components:
1318613186
pollerAutoscalingAutoEnroll:
1318713187
type: boolean
1318813188
description: When true, workers should use poller autoscaling by default unless explicitly configured otherwise.
13189+
workflowTaskCompletionPagination:
13190+
type: boolean
13191+
description: True if the namespace supports pagination of `RespondWorkflowTaskCompleted` request.
1318913192
description: Namespace capability details. Should contain what features are enabled in a namespace.
1319013193
NamespaceInfo_Limits:
1319113194
type: object

temporal/api/errordetails/v1/message.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,9 @@ message NexusOperationExecutionAlreadyStartedFailure {
137137
string start_request_id = 1;
138138
string run_id = 2;
139139
}
140+
141+
// An error indicating that the server lost the buffered pages of a paginated workflow task
142+
// completion. This is a transient error: the workflow task is still valid, and the client
143+
// should resend all pages from page 0 using the same task token.
144+
message WorkflowTaskCompletionBufferLostFailure {
145+
}

temporal/api/namespace/v1/message.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ message NamespaceInfo {
5858
bool workflow_update_callbacks = 12;
5959
// When true, workers should use poller autoscaling by default unless explicitly configured otherwise.
6060
bool poller_autoscaling_auto_enroll = 13;
61+
// True if the namespace supports pagination of `RespondWorkflowTaskCompleted` request.
62+
bool workflow_task_completion_pagination = 14;
6163
}
6264

6365
// Namespace configured limits

temporal/api/workflowservice/v1/request_response.proto

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,16 @@ message RespondWorkflowTaskCompletedRequest {
424424
// tasks (e.g. activity cancellation) to this specific worker instance.
425425
string worker_control_task_queue = 20;
426426

427+
// 0-indexed page number when the workflow task completion is split across multiple
428+
// requests ("pages"). 0 for single-page requests. May only be set to non-zero value
429+
// when the namespace capability workflow_task_completion_pagination is true.
430+
int32 page_number = 21;
431+
432+
// True for non-final pages of a paginated workflow task completion. The final page's
433+
// `page_number` tells the server how many intermediate pages (0..page_number-1) preceded it.
434+
// May only be used when the namespace capability workflow_task_completion_pagination is true.
435+
bool intermediate_page = 22;
436+
427437
// SDK capability details.
428438
message Capabilities {
429439
// True if the SDK can handle speculative workflow task with command events. If true, the

0 commit comments

Comments
 (0)