Skip to content

Add reset info to the activity heartbeat response #578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 2, 2025
Merged
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
8 changes: 8 additions & 0 deletions openapi/openapiv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -12203,6 +12203,10 @@
"activityPaused": {
"type": "boolean",
"description": "Will be set to true if the activity is paused."
},
"activityReset": {
"type": "boolean",
"description": "Will be set to true if the activity was reset.\nApplies only to the current run."
}
}
},
Expand All @@ -12216,6 +12220,10 @@
"activityPaused": {
"type": "boolean",
"description": "Will be set to true if the activity is paused."
},
"activityReset": {
"type": "boolean",
"description": "Will be set to true if the activity was reset.\nApplies only to the current run."
}
}
},
Expand Down
10 changes: 10 additions & 0 deletions openapi/openapiv3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9254,6 +9254,11 @@ components:
activityPaused:
type: boolean
description: Will be set to true if the activity is paused.
activityReset:
type: boolean
description: |-
Will be set to true if the activity was reset.
Applies only to the current run.
RecordActivityTaskHeartbeatRequest:
type: object
properties:
Expand Down Expand Up @@ -9281,6 +9286,11 @@ components:
activityPaused:
type: boolean
description: Will be set to true if the activity is paused.
activityReset:
type: boolean
description: |-
Will be set to true if the activity was reset.
Applies only to the current run.
RegisterNamespaceRequest:
type: object
properties:
Expand Down
22 changes: 15 additions & 7 deletions temporal/api/workflowservice/v1/request_response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,10 @@ message RecordActivityTaskHeartbeatResponse {

// Will be set to true if the activity is paused.
bool activity_paused = 2;

// Will be set to true if the activity was reset.
// Applies only to the current run.
bool activity_reset = 3;
Copy link
Member

Choose a reason for hiding this comment

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

Can I get confirmation that we want SDKs to interrupt running activities when this is true, same as we do for paused or cancel requested?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My goal is to provide all the information.
I think we need to decide it separately.

Copy link
Member

@cretz cretz Apr 28, 2025

Choose a reason for hiding this comment

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

Would rather decide how we want SDK to react before merging this API (we obviously don't provide all information on heartbeat, we only provide what callers need, there is a ton of stuff about an activity we leave off).

In this case I suspect we will want to interrupt the activity.

Choose a reason for hiding this comment

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

@cretz that's right.

}

message RecordActivityTaskHeartbeatByIdRequest {
Expand All @@ -553,6 +557,10 @@ message RecordActivityTaskHeartbeatByIdResponse {

// Will be set to true if the activity is paused.
bool activity_paused = 2;

// Will be set to true if the activity was reset.
// Applies only to the current run.
bool activity_reset = 3;
}

message RespondActivityTaskCompletedRequest {
Expand Down Expand Up @@ -1840,13 +1848,13 @@ message UpdateActivityOptionsRequest {
// Controls which fields from `activity_options` will be applied
google.protobuf.FieldMask update_mask = 5;

// either activity id or activity type must be provided
oneof activity {
// Only activity with this ID will be updated.
string id = 6;
// Update all running activities of this type.
string type = 7;
}
// either activity id or activity type must be provided
oneof activity {
// Only activity with this ID will be updated.
string id = 6;
// Update all running activities of this type.
string type = 7;
}
}

message UpdateActivityOptionsResponse {
Expand Down
Loading