diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 99945c383..8878ed651 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -11003,6 +11003,9 @@ }, "workflowExtendedInfo": { "$ref": "#/definitions/v1WorkflowExecutionExtendedInfo" + }, + "workflowPauseInfo": { + "$ref": "#/definitions/v1WorkflowPauseInfo" } } }, @@ -12717,6 +12720,29 @@ "v1PauseActivityResponse": { "type": "object" }, + "v1PausedActivities": { + "type": "object", + "properties": { + "updateTime": { + "type": "string", + "format": "date-time", + "description": "The time when the activity pause info was updated." + }, + "activityType": { + "type": "string", + "description": "The type of the activity to be paused." + }, + "identity": { + "type": "string", + "description": "The identity of the actor that paused the activity." + }, + "reason": { + "type": "string", + "description": "The reason for pausing the activity." + } + }, + "description": "PausedActivities contains information about a paused activity type.\nAny pending activity of this type should be either in PAUSE_REQUESTED or PAUSED states.\nFuture activities of this type will automatically be put into PAUSED state." + }, "v1Payload": { "description": "Arbitrary payload data in an unconstrained format.\nThis may be activity input parameters, a workflow result, a memo, etc.\n" }, @@ -16984,6 +17010,20 @@ "default": "WORKFLOW_ID_REUSE_POLICY_UNSPECIFIED", "description": "Defines whether to allow re-using a workflow id from a previously *closed* workflow.\nIf the request is denied, the server returns a `WorkflowExecutionAlreadyStartedFailure` error.\n\nSee `WorkflowIdConflictPolicy` for handling workflow id duplication with a *running* workflow.\n\n - WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE: Allow starting a workflow execution using the same workflow id.\n - WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE_FAILED_ONLY: Allow starting a workflow execution using the same workflow id, only when the last\nexecution's final state is one of [terminated, cancelled, timed out, failed].\n - WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE: Do not permit re-use of the workflow id for this workflow. Future start workflow requests\ncould potentially change the policy, allowing re-use of the workflow id.\n - WORKFLOW_ID_REUSE_POLICY_TERMINATE_IF_RUNNING: This option belongs in WorkflowIdConflictPolicy but is here for backwards compatibility.\nIf specified, it acts like ALLOW_DUPLICATE, but also the WorkflowId*Conflict*Policy on\nthe request is treated as WORKFLOW_ID_CONFLICT_POLICY_TERMINATE_EXISTING.\nIf no running workflow, then the behavior is the same as ALLOW_DUPLICATE." }, + "v1WorkflowPauseInfo": { + "type": "object", + "properties": { + "pausedActivities": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1PausedActivities" + }, + "description": "List of activity types that are paused, any future activities of this type will automatically be put into PAUSED state." + } + }, + "description": "WorkflowPauseInfo contains the details of the request to pause the workflow." + }, "v1WorkflowPropertiesModifiedEventAttributes": { "type": "object", "properties": { diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 82fa0d4db..50d08f1d1 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -8017,6 +8017,8 @@ components: $ref: '#/components/schemas/PendingNexusOperationInfo' workflowExtendedInfo: $ref: '#/components/schemas/WorkflowExecutionExtendedInfo' + workflowPauseInfo: + $ref: '#/components/schemas/WorkflowPauseInfo' DescribeWorkflowRuleResponse: type: object properties: @@ -9565,6 +9567,26 @@ components: reason: type: string description: Reason why rule was created. Populated from rule description. + PausedActivities: + type: object + properties: + updateTime: + type: string + description: The time when the activity pause info was updated. + format: date-time + activityType: + type: string + description: The type of the activity to be paused. + identity: + type: string + description: The identity of the actor that paused the activity. + reason: + type: string + description: The reason for pausing the activity. + description: |- + PausedActivities contains information about a paused activity type. + Any pending activity of this type should be either in PAUSE_REQUESTED or PAUSED states. + Future activities of this type will automatically be put into PAUSED state. Payload: description: |- Represents some binary (byte array) data (ex: activity input parameters or workflow result) with @@ -14513,6 +14535,15 @@ components: description: |- Holds all the information about worker versioning for a particular workflow execution. Experimental. Versioning info is experimental and might change in the future. + WorkflowPauseInfo: + type: object + properties: + pausedActivities: + type: array + items: + $ref: '#/components/schemas/PausedActivities' + description: List of activity types that are paused, any future activities of this type will automatically be put into PAUSED state. + description: WorkflowPauseInfo contains the details of the request to pause the workflow. WorkflowPropertiesModifiedEventAttributes: type: object properties: diff --git a/temporal/api/workflow/v1/message.proto b/temporal/api/workflow/v1/message.proto index 1d5737c79..a3da70123 100644 --- a/temporal/api/workflow/v1/message.proto +++ b/temporal/api/workflow/v1/message.proto @@ -100,6 +100,29 @@ message WorkflowExecutionInfo { temporal.api.common.v1.Priority priority = 24; } +// WorkflowPauseInfo contains the details of the request to pause the workflow. +message WorkflowPauseInfo { + // List of activity types that are paused, any future activities of this type will automatically be put into PAUSED state. + repeated PausedActivities paused_activities = 1; +} + +// PausedActivities contains information about a paused activity type. +// Any pending activity of this type should be either in PAUSE_REQUESTED or PAUSED states. +// Future activities of this type will automatically be put into PAUSED state. +message PausedActivities { + // The time when the activity pause info was updated. + google.protobuf.Timestamp update_time = 1; + + // The type of the activity to be paused. + string activity_type = 2; + + // The identity of the actor that paused the activity. + string identity = 3; + + // The reason for pausing the activity. + string reason = 4; +} + // Holds all the extra information about workflow execution that is not part of Visibility. message WorkflowExecutionExtendedInfo { // Workflow execution expiration time is defined as workflow start time plus expiration timeout. diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index d6c342d54..3498cdab7 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -1042,6 +1042,7 @@ message DescribeWorkflowExecutionResponse { repeated temporal.api.workflow.v1.CallbackInfo callbacks = 6; repeated temporal.api.workflow.v1.PendingNexusOperationInfo pending_nexus_operations = 7; temporal.api.workflow.v1.WorkflowExecutionExtendedInfo workflow_extended_info = 8; + temporal.api.workflow.v1.WorkflowPauseInfo workflow_pause_info = 9; } // (-- api-linter: core::0203::optional=disabled