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
29 changes: 26 additions & 3 deletions openapi/openapiv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -7515,11 +7515,19 @@
},
"type": {
"type": "string",
"description": "Pause all running activities of this type."
"description": "Pause activities of this type."
},
"pauseAll": {
"type": "boolean",
"description": "Pause all activities."
},
"reason": {
"type": "string",
"description": "Reason to pause the activity."
},
"activityState": {
"$ref": "#/definitions/v1PauseOptionActivityState",
"description": "which activities to pause - current, future or both."
}
}
},
Expand Down Expand Up @@ -8381,11 +8389,11 @@
},
"type": {
"type": "string",
"description": "Unpause all running activities with of this type."
"description": "Unpause activities of this type."
},
"unpauseAll": {
"type": "boolean",
"description": "Unpause all running activities."
"description": "Unpause all activities."
},
"resetAttempts": {
"type": "boolean",
Expand All @@ -8398,6 +8406,10 @@
"jitter": {
"type": "string",
"description": "If set, the activity will start at a random time within the specified jitter duration."
},
"activityState": {
"$ref": "#/definitions/v1PauseOptionActivityState",
"description": "which activities to unpause - current, future or both."
}
}
},
Expand Down Expand Up @@ -12105,6 +12117,17 @@
"v1PauseActivityResponse": {
"type": "object"
},
"v1PauseOptionActivityState": {
"type": "string",
"enum": [
"PAUSE_OPTION_ACTIVITY_STATE_UNSPECIFIED",
"PAUSE_OPTION_ACTIVITY_STATE_RUNNING",
"PAUSE_OPTION_ACTIVITY_STATE_FUTURE",
"PAUSE_OPTION_ACTIVITY_STATE_BOTH"
],
"default": "PAUSE_OPTION_ACTIVITY_STATE_UNSPECIFIED",
"description": "Pause option activity state is used to specify if we want to pause/unpause just the current activity, or just the future activities or both."
},
"v1Payload": {
"description": "Arbitrary payload data in an unconstrained format.\nThis may be activity input parameters, a workflow result, a memo, etc.\n"
},
Expand Down
27 changes: 24 additions & 3 deletions openapi/openapiv3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9083,10 +9083,22 @@ components:
description: Only the activity with this ID will be paused.
type:
type: string
description: Pause all running activities of this type.
description: Pause activities of this type.
pauseAll:
type: boolean
description: Pause all activities.
reason:
type: string
description: Reason to pause the activity.
activityState:
enum:
- PAUSE_OPTION_ACTIVITY_STATE_UNSPECIFIED
- PAUSE_OPTION_ACTIVITY_STATE_RUNNING
- PAUSE_OPTION_ACTIVITY_STATE_FUTURE
- PAUSE_OPTION_ACTIVITY_STATE_BOTH
type: string
description: which activities to pause - current, future or both.
format: enum
PauseActivityResponse:
type: object
properties: {}
Expand Down Expand Up @@ -11989,10 +12001,10 @@ components:
description: Only the activity with this ID will be unpaused.
type:
type: string
description: Unpause all running activities with of this type.
description: Unpause activities of this type.
unpauseAll:
type: boolean
description: Unpause all running activities.
description: Unpause all activities.
resetAttempts:
type: boolean
description: Providing this flag will also reset the number of attempts.
Expand All @@ -12003,6 +12015,15 @@ components:
pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
type: string
description: If set, the activity will start at a random time within the specified jitter duration.
activityState:
enum:
- PAUSE_OPTION_ACTIVITY_STATE_UNSPECIFIED
- PAUSE_OPTION_ACTIVITY_STATE_RUNNING
- PAUSE_OPTION_ACTIVITY_STATE_FUTURE
- PAUSE_OPTION_ACTIVITY_STATE_BOTH
type: string
description: which activities to unpause - current, future or both.
format: enum
UnpauseActivityResponse:
type: object
properties: {}
Expand Down
8 changes: 8 additions & 0 deletions temporal/api/enums/v1/workflow.proto
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,11 @@ enum VersioningBehavior {
// complete on the old Version.
VERSIONING_BEHAVIOR_AUTO_UPGRADE = 2;
}

// Pause option activity state is used to specify if we want to pause/unpause just the current activity, or just the future activities or both.
enum PauseOptionActivityState {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this in workflow.proto and not activity.proto?

Copy link
Member

Choose a reason for hiding this comment

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

Or maybe this could be generalized for workflows too? Would we want this for workflow pause?

Copy link
Contributor

Choose a reason for hiding this comment

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

either create acitvity.proto, or add to "common".
Or remove "activity" and change it to "ENTITY" to generalize?

Copy link
Contributor

Choose a reason for hiding this comment

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

why this comment is here...

PAUSE_OPTION_ACTIVITY_STATE_UNSPECIFIED = 0;
PAUSE_OPTION_ACTIVITY_STATE_RUNNING = 1;
PAUSE_OPTION_ACTIVITY_STATE_FUTURE = 2;
PAUSE_OPTION_ACTIVITY_STATE_BOTH = 3;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
PAUSE_OPTION_ACTIVITY_STATE_BOTH = 3;
PAUSE_OPTION_ACTIVITY_STATE_ANY = 3;

}
18 changes: 13 additions & 5 deletions temporal/api/workflowservice/v1/request_response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1905,12 +1905,17 @@ message PauseActivityRequest {
oneof activity {
// Only the activity with this ID will be paused.
string id = 4;
// Pause all running activities of this type.
// Pause activities of this type.
string type = 5;
// Pause all activities.
bool pause_all = 7;
}

// Reason to pause the activity.
string reason = 6;

// which activities to pause - current, future or both.
Copy link
Contributor

Choose a reason for hiding this comment

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

comment says "which activities to pause" - but previous oneof selector selects which activities to pause.
also what is the interaction between id and activity_state? What does it mean 'future activities by id'?

Copy link
Contributor

Choose a reason for hiding this comment

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

same for "match all". I don't think "match all" and "for all, now and in the future" should coexist...
hm. I think you separated those qualifiers into activity_state after discussion with Chad, but I don't think this is the right idea.

it should be part of "type".
(not going to block on this)

Copy link
Member

@cretz cretz Jul 15, 2025

Choose a reason for hiding this comment

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

IMO they are independent filters and if both are present, both must be satisfied. The other is "which activities", this is "also limit by current state" IMO.

temporal.api.enums.v1.PauseOptionActivityState activity_state = 8;
}

message PauseActivityResponse {
Expand All @@ -1929,9 +1934,9 @@ message UnpauseActivityRequest {
oneof activity {
// Only the activity with this ID will be unpaused.
string id = 4;
// Unpause all running activities with of this type.
// Unpause activities of this type.
string type = 5;
// Unpause all running activities.
// Unpause all activities.
bool unpause_all = 6;
}

Expand All @@ -1943,6 +1948,9 @@ message UnpauseActivityRequest {

// If set, the activity will start at a random time within the specified jitter duration.
google.protobuf.Duration jitter = 9;

// which activities to unpause - current, future or both.
Copy link
Member

Choose a reason for hiding this comment

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

Inconsistent with capitalization of comments

Copy link
Member

Choose a reason for hiding this comment

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

Safe to assume "any" is the default when unspecified? Can you clarify that in comment?

temporal.api.enums.v1.PauseOptionActivityState activity_state = 10;
}

message UnpauseActivityResponse {
Expand Down Expand Up @@ -2208,8 +2216,8 @@ message ListWorkerDeploymentsResponse {
google.protobuf.Timestamp create_time = 2;
temporal.api.deployment.v1.RoutingConfig routing_config = 3;
// Summary of the version that was added most recently in the Worker Deployment.
temporal.api.deployment.v1.WorkerDeploymentInfo.WorkerDeploymentVersionSummary latest_version_summary = 4;
// Summary of the current version of the Worker Deployment.
temporal.api.deployment.v1.WorkerDeploymentInfo.WorkerDeploymentVersionSummary latest_version_summary = 4;
// Summary of the current version of the Worker Deployment.
temporal.api.deployment.v1.WorkerDeploymentInfo.WorkerDeploymentVersionSummary current_version_summary = 5;
// Summary of the ramping version of the Worker Deployment.
temporal.api.deployment.v1.WorkerDeploymentInfo.WorkerDeploymentVersionSummary ramping_version_summary = 6;
Expand Down
Loading