Skip to content

Add high level workflow describe #1924

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 7 commits into from
Apr 30, 2025

Conversation

Quinn-With-Two-Ns
Copy link
Contributor

Add high level workflow describe

close #1667

@Quinn-With-Two-Ns Quinn-With-Two-Ns requested a review from a team as a code owner April 21, 2025 20:36
client/client.go Outdated
// - serviceerror.Internal
// - serviceerror.Unavailable
// - serviceerror.NotFound
DescribeWorkflow(ctx context.Context, workflowID, runID string) (*DescribeWorkflowExecution, error)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Returned a pointer here for consistency with some other APIs

@@ -901,6 +917,27 @@ type QueryWorkflowWithOptionsResponse struct {
QueryRejected *querypb.QueryRejected
}

type WorkflowExecutionMetadata struct {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Works for me, though not the biggest fan of the term "metadata", but I know it's what Java uses, so up to you. I figure one day we'll deprecate all the bad forms of "list" and have a new "list" call that returns iter.Seq[WorkflowExecutionMetadata], but not sure if that affects your name choice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you have a different name I am open to suggestions, when we add list I was going to add another type that would also embedded WorkflowExecutionMetadata

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, since WorkflowExecution is already in use elsewhere, this is fine. Not sure at list time we need another type since list contents should be a subset of describe, but can discuss at that time.

client/client.go Outdated
// - serviceerror.Internal
// - serviceerror.Unavailable
// - serviceerror.NotFound
DescribeWorkflow(ctx context.Context, workflowID, runID string) (*DescribeWorkflowExecution, error)
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to accept DescribeWorkflowOptions for future proofing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking we would add DescribeWorkflowWithOptions if we ever add more options here

@@ -901,6 +917,27 @@ type QueryWorkflowWithOptionsResponse struct {
QueryRejected *querypb.QueryRejected
}

type WorkflowExecutionMetadata struct {
Copy link
Member

Choose a reason for hiding this comment

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

Works for me, though not the biggest fan of the term "metadata", but I know it's what Java uses, so up to you. I figure one day we'll deprecate all the bad forms of "list" and have a new "list" call that returns iter.Seq[WorkflowExecutionMetadata], but not sure if that affects your name choice.

// GetStaticSummary returns the summary set on workflow start.
//
// NOTE: Experimental
func (w *WorkflowExecutionDescription) GetStaticSummary() (string, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Arguably could be worth memoizing e.g. behind a sync.Once, but no strong opinion

@Quinn-With-Two-Ns Quinn-With-Two-Ns force-pushed the issue-1667 branch 2 times, most recently from 9021a9b to aa30f1b Compare April 28, 2025 22:39
@Quinn-With-Two-Ns Quinn-With-Two-Ns merged commit e2dfd9d into temporalio:master Apr 30, 2025
14 checks passed
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.

Add high-level workflow describe
3 participants