Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions openapi/openapiv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -11003,6 +11003,9 @@
},
"workflowExtendedInfo": {
"$ref": "#/definitions/v1WorkflowExecutionExtendedInfo"
},
"workflowPauseInfo": {
"$ref": "#/definitions/v1WorkflowPauseInfo"
}
}
},
Expand Down Expand Up @@ -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"
},
Expand Down Expand Up @@ -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": {
Expand Down
31 changes: 31 additions & 0 deletions openapi/openapiv3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8017,6 +8017,8 @@ components:
$ref: '#/components/schemas/PendingNexusOperationInfo'
workflowExtendedInfo:
$ref: '#/components/schemas/WorkflowExecutionExtendedInfo'
workflowPauseInfo:
$ref: '#/components/schemas/WorkflowPauseInfo'
DescribeWorkflowRuleResponse:
type: object
properties:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
23 changes: 23 additions & 0 deletions temporal/api/workflow/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When trying to see how I would set this as a user, I can't find the workflow pause API, is this yet to be developed or is it as part of another API? To clarify, I am trying to figure out how to remove a "pause policy" I have previously set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/temporalio/temporal/pull/8161/files I think you are looking for this PR. @gow should be able to provide more clarity here

Copy link
Member

@cretz cretz Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean from a user/API POV how do I issue a current-and-future pause for activities and how to I remove that current-and-future pause? The reason I ask is because how undo occurs can help drive what this API looks like (e.g. if you need a unique identifier for this "setting"/"policy"). I think this API PR should go hand-in-hand with the API PR that is used to mutate this value.

Copy link
Member

@cretz cretz Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I think I missed that this is implemented via PauseActivity? I still think the pause/unpause is a bit confusing on whether it applies to the future, but that's a separate topic. I think we're good on this thread specifically.

}

// 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.
Expand Down
1 change: 1 addition & 0 deletions temporal/api/workflowservice/v1/request_response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do I know if workflow tasks are paused (what I would consider a traditional concept of "workflow pause")? Does the simple presence/absence of this determine that? Or should we add a field? Does it get represented as a status in another enum somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This work is only concerned with pausing activities, pausing workflow is a separate stream of work.

Copy link
Contributor Author

@spkane31 spkane31 Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do I know if workflow tasks are paused

The workflow_pause_info is a list of all activity types that are paused.

Does the simple presence/absence of this determine that? Or should we add a field? Does it get represented as a status in another enum somewhere?

I don't quite understand these questions, this is a new field that gives the paused activities. There is no other enum

Copy link
Member

@cretz cretz Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pausing workflow is a separate stream of work

But this is called "workflow pause info" so I assume it will reuse this message for other pause things? I think we should consider "workflow pause" (and therefore "workflow pause info") the same stream of work if we want a cohesive view of pausing workflows and things in it.

I don't quite understand these questions, this is a new field that gives the paused activities. There is no other enum

The question is about the rest of workflow pause and to make sure we aren't myopically designing for only one form. If we expect task pause to just be a bool in pause info, that makes sense to me. I am a bit surprised we're doing in-workflow activity pausing before workflow task pausing. I just want to confirm what we're thinking task pause may look like within this new general-purpose structure that is not specific to activity pause (even if its only field is).

}

// (-- api-linter: core::0203::optional=disabled
Expand Down
Loading