Skip to content

Conversation

@dandavison
Copy link
Contributor

This is a proposal to address the design discussion at https://github.com/temporalio/api/pull/640/files#r2414002340. It introduces a unified method for polling / long-polling an activity execution for status and/or outcome.

@dandavison dandavison requested review from a team as code owners October 22, 2025 16:57
@dandavison dandavison force-pushed the standalone-activity-unify-describe-and-get-result branch from 33418ae to 9a0db0c Compare October 22, 2025 17:04
// This replaces both DescribeActivityExecution and GetActivityExecutionResult with a single
// flexible endpoint that can handle both synchronous queries and long polling for both
// info updates and completion.
rpc GetActivityExecutionStatus (GetActivityExecutionStatusRequest) returns (GetActivityExecutionStatusResponse) {
Copy link
Member

@cretz cretz Oct 22, 2025

Choose a reason for hiding this comment

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

No comment on the rest of the PR, but doesn't this method provide more than just the status? Status is but one part of the info returned here (and it seems by default we don't even return the info/status)

Copy link
Contributor Author

@dandavison dandavison Oct 22, 2025

Choose a reason for hiding this comment

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

Agreed. Discussed with @bergundy, @fretz12, @maciejdudko. Changed it to DescribeActivityExecution

Copy link
Member

@cretz cretz Oct 22, 2025

Choose a reason for hiding this comment

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

It is a bit strange that describe by default (e.g. GET https://my-cluster/namespaces/my-namespace/activities/my-activity) doesn't actually return anything but run_id by default unlike our other forms of describe (though of course the SDK will hopefully maintain consistency/expectations even if our API doesn't).

Copy link
Member

Choose a reason for hiding this comment

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

Valid concern. I propose we change the flag to exclude_info to make it opt-out.

Copy link
Contributor Author

@dandavison dandavison Oct 22, 2025

Choose a reason for hiding this comment

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

Agreed. It is now:

    // Exclude the info field from the response.
    bool exclude_info = 4;
    // Include the input field in the response.
    bool include_input = 5;
    // Include the outcome field in the response.
    bool include_outcome = 6;

@dandavison dandavison force-pushed the standalone-activity-unify-describe-and-get-result branch 2 times, most recently from 906dd19 to 9f0f131 Compare October 22, 2025 17:25
@dandavison dandavison force-pushed the standalone-activity-unify-describe-and-get-result branch 2 times, most recently from 19b9a57 to b27dd73 Compare October 22, 2025 18:26
@dandavison dandavison force-pushed the standalone-activity-unify-describe-and-get-result branch from b27dd73 to 14d98bf Compare October 22, 2025 18:39
Copy link
Member

@bergundy bergundy left a comment

Choose a reason for hiding this comment

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

Approved with comments.

message DescribeActivityExecutionRequest {
string namespace = 1;
string activity_id = 2;
// Activity run ID, targets the latest run if run_id is empty.
Copy link
Member

Choose a reason for hiding this comment

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

Why did you remove this comment?

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 was unintentional. Reinstated.

Comment on lines 2680 to 2682
bool include_info = 4;
bool include_input = 5;
bool include_outcome = 6;
Copy link
Member

Choose a reason for hiding this comment

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

Document these fields please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

bytes long_poll_token = 5;
message NoWaitOptions {}
message StateChangeWaitOptions {
bytes long_poll_token = 1;
Copy link
Member

Choose a reason for hiding this comment

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

We should require the run ID to be specified if the long poll token is present.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

// - Get activity outcome synchronously if completed (when include_outcome is true)
// - Long poll for activity completion (when wait_outcome is true)
//
// This replaces both DescribeActivityExecution and GetActivityExecutionResult with a single
Copy link
Member

Choose a reason for hiding this comment

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

This comment isn't relevant since we removed GetActivityExecutionResult.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, that text was unintentionally included. Removed.

@dandavison dandavison merged commit 6d400f0 into standalone-activity Oct 22, 2025
2 of 3 checks passed
@dandavison dandavison deleted the standalone-activity-unify-describe-and-get-result branch October 22, 2025 19:20
dandavison added a commit to bergundy/temporal-api that referenced this pull request Oct 24, 2025
…io#651)

Introduce a unified method for polling / long-polling an activity
execution for status and/or outcome.
dandavison added a commit that referenced this pull request Oct 30, 2025
Introduce a unified method for polling / long-polling an activity
execution for status and/or outcome.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants