From 046202a4ed152b9be81e829b505de651c595a318 Mon Sep 17 00:00:00 2001 From: Sean Kane Date: Mon, 1 Jun 2026 15:13:17 -0600 Subject: [PATCH 1/3] feat: add PausePolicy to StartActivityExecutionRequest --- openapi/openapiv2.json | 13 +++++++++++++ openapi/openapiv3.yaml | 10 ++++++++++ temporal/api/common/v1/message.proto | 4 ++++ .../api/workflowservice/v1/request_response.proto | 2 ++ 4 files changed, 29 insertions(+) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 2e047a214..99ce3c9db 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -12173,6 +12173,10 @@ "startDelay": { "type": "string", "description": "Time to wait before dispatching the first activity task. This delay is not applied to retry attempts." + }, + "pausePolicy": { + "$ref": "#/definitions/v1PausePolicy", + "description": "Policy for pausing the activity execution under specific conditions." } } }, @@ -17277,6 +17281,15 @@ "type": "object", "description": "Deprecated. Use `PauseActivityExecutionResponse`." }, + "v1PausePolicy": { + "type": "object", + "properties": { + "maxAttempts": { + "type": "integer", + "format": "int32" + } + } + }, "v1PauseWorkflowExecutionResponse": { "type": "object", "description": "Response to a successful PauseWorkflowExecution request." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index bc79eb4fc..19822224e 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -13709,6 +13709,12 @@ components: reason: type: string description: Reason why rule was created. Populated from rule description. + PausePolicy: + type: object + properties: + maxAttempts: + type: integer + format: int32 PauseWorkflowExecutionRequest: type: object properties: @@ -16383,6 +16389,10 @@ 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 task. This delay is not applied to retry attempts. + pausePolicy: + allOf: + - $ref: '#/components/schemas/PausePolicy' + description: Policy for pausing the activity execution under specific conditions. StartActivityExecutionResponse: type: object properties: diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index 98908cf89..20818e441 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -98,6 +98,10 @@ message RetryPolicy { repeated string non_retryable_error_types = 5; } +message PausePolicy { + int32 max_attempts = 1; +} + // Metadata relevant for metering purposes message MeteringMetadata { // Count of local activities which have begun an execution attempt during this workflow task, diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index a4098d9b1..35cef750c 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -3169,6 +3169,8 @@ message StartActivityExecutionRequest { temporal.api.common.v1.OnConflictOptions on_conflict_options = 21; // Time to wait before dispatching the first activity task. This delay is not applied to retry attempts. google.protobuf.Duration start_delay = 22; + // Policy for pausing the activity execution under specific conditions. + temporal.api.common.v1.PausePolicy pause_policy = 23; } message StartActivityExecutionResponse { From 85d70458e45306d6a1832bf71838f10bcb730287 Mon Sep 17 00:00:00 2001 From: Sean Kane Date: Mon, 1 Jun 2026 15:35:57 -0600 Subject: [PATCH 2/3] add to command --- temporal/api/command/v1/message.proto | 1 + 1 file changed, 1 insertion(+) diff --git a/temporal/api/command/v1/message.proto b/temporal/api/command/v1/message.proto index 597f9c94d..cca833bca 100644 --- a/temporal/api/command/v1/message.proto +++ b/temporal/api/command/v1/message.proto @@ -66,6 +66,7 @@ message ScheduleActivityTaskCommandAttributes { // Priority metadata. If this message is not present, or any fields are not // present, they inherit the values from the workflow. temporal.api.common.v1.Priority priority = 14; + temporal.api.common.v1.PausePolicy pause_policy = 15; } message RequestCancelActivityTaskCommandAttributes { From 0cc1cc502e254f3d1628b5ff8ac8bf009be3afd2 Mon Sep 17 00:00:00 2001 From: Sean Kane Date: Mon, 1 Jun 2026 15:47:24 -0600 Subject: [PATCH 3/3] more locations --- openapi/openapiv2.json | 35 ++++++++++++++++++-------- openapi/openapiv3.yaml | 10 ++++++++ temporal/api/history/v1/message.proto | 1 + temporal/api/workflow/v1/message.proto | 6 +++++ 4 files changed, 42 insertions(+), 10 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 99ce3c9db..60881a37a 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -10904,6 +10904,18 @@ "rule": { "$ref": "#/definitions/PauseInfoRule", "title": "activity was paused by the rule" + }, + "pausePolicy": { + "$ref": "#/definitions/PendingActivityInfoPauseInfoPausePolicy" + } + } + }, + "PendingActivityInfoPauseInfoPausePolicy": { + "type": "object", + "properties": { + "maxPauseDurationAttempts": { + "type": "integer", + "format": "int32" } } }, @@ -12175,7 +12187,7 @@ "description": "Time to wait before dispatching the first activity task. This delay is not applied to retry attempts." }, "pausePolicy": { - "$ref": "#/definitions/v1PausePolicy", + "$ref": "#/definitions/commonV1PausePolicy", "description": "Policy for pausing the activity execution under specific conditions." } } @@ -13148,6 +13160,15 @@ }, "description": "When StartWorkflowExecution uses the conflict policy WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING and\nthere is already an existing running workflow, OnConflictOptions defines actions to be taken on\nthe existing running workflow. In this case, it will create a WorkflowExecutionOptionsUpdatedEvent\nhistory event in the running workflow with the changes requested in this object." }, + "commonV1PausePolicy": { + "type": "object", + "properties": { + "maxAttempts": { + "type": "integer", + "format": "int32" + } + } + }, "protobufAny": { "type": "object", "properties": { @@ -13667,6 +13688,9 @@ "priority": { "$ref": "#/definitions/v1Priority", "description": "Priority metadata. If this message is not present, or any fields are not\npresent, they inherit the values from the workflow." + }, + "pausePolicy": { + "$ref": "#/definitions/commonV1PausePolicy" } } }, @@ -17281,15 +17305,6 @@ "type": "object", "description": "Deprecated. Use `PauseActivityExecutionResponse`." }, - "v1PausePolicy": { - "type": "object", - "properties": { - "maxAttempts": { - "type": "integer", - "format": "int32" - } - } - }, "v1PauseWorkflowExecutionResponse": { "type": "object", "description": "Response to a successful PauseWorkflowExecution request." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 19822224e..9d69fe1d2 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -10065,6 +10065,8 @@ components: description: |- Priority metadata. If this message is not present, or any fields are not present, they inherit the values from the workflow. + pausePolicy: + $ref: '#/components/schemas/PausePolicy' ActivityTaskStartedEventAttributes: type: object properties: @@ -13697,6 +13699,12 @@ components: reason: type: string description: Reason for pausing the activity. + PauseInfo_PausePolicy: + type: object + properties: + maxPauseDurationAttempts: + type: integer + format: int32 PauseInfo_Rule: type: object properties: @@ -13881,6 +13889,8 @@ components: allOf: - $ref: '#/components/schemas/PauseInfo_Rule' description: activity was paused by the rule + pausePolicy: + $ref: '#/components/schemas/PauseInfo_PausePolicy' PendingChildExecutionInfo: type: object properties: diff --git a/temporal/api/history/v1/message.proto b/temporal/api/history/v1/message.proto index 96a06ab85..0bc7752a6 100644 --- a/temporal/api/history/v1/message.proto +++ b/temporal/api/history/v1/message.proto @@ -456,6 +456,7 @@ message ActivityTaskScheduledEventAttributes { // Priority metadata. If this message is not present, or any fields are not // present, they inherit the values from the workflow. temporal.api.common.v1.Priority priority = 14; + temporal.api.common.v1.PausePolicy pause_policy = 15; } message ActivityTaskStartedEventAttributes { diff --git a/temporal/api/workflow/v1/message.proto b/temporal/api/workflow/v1/message.proto index fdca1df4d..d98cbf6cb 100644 --- a/temporal/api/workflow/v1/message.proto +++ b/temporal/api/workflow/v1/message.proto @@ -358,6 +358,10 @@ message PendingActivityInfo { string reason = 3; } + message PausePolicy { + int32 max_pause_duration_attempts = 1; + } + oneof paused_by { // activity was paused by the manual intervention Manual manual = 2; @@ -365,6 +369,8 @@ message PendingActivityInfo { // activity was paused by the rule Rule rule = 4; + + PausePolicy pause_policy = 5; } }