diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 2e047a214..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" } } }, @@ -12173,6 +12185,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/commonV1PausePolicy", + "description": "Policy for pausing the activity execution under specific conditions." } } }, @@ -13144,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": { @@ -13663,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" } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index bc79eb4fc..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: @@ -13709,6 +13717,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: @@ -13875,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: @@ -16383,6 +16399,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/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 { 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/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; } } 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 {