Skip to content
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

Add Links to HistoryEvent #448

Merged
merged 6 commits into from
Aug 23, 2024
Merged

Add Links to HistoryEvent #448

merged 6 commits into from
Aug 23, 2024

Conversation

rodrigozhou
Copy link
Contributor

What changed?
Created Link struct, and added to HistoryEvent and Nexus StartOperation request/response

Why?
Support bi-directional links for Nexus calls.

Breaking changes

Server PR

temporal/api/history/v1/message.proto Outdated Show resolved Hide resolved
temporal/api/common/v1/message.proto Outdated Show resolved Hide resolved
temporal/api/common/v1/message.proto Outdated Show resolved Hide resolved
temporal/api/common/v1/message.proto Outdated Show resolved Hide resolved
temporal/api/nexus/v1/message.proto Outdated Show resolved Hide resolved
temporal/api/common/v1/message.proto Outdated Show resolved Hide resolved
@@ -197,6 +197,8 @@ message StartWorkflowExecutionRequest {
// for use by user interfaces to display the fixed as-of-start summary and details of the
// workflow.
temporal.api.sdk.v1.UserMetadata user_metadata = 23;
// Links to be associated with the workflow.
repeated temporal.api.common.v1.Link links = 24;
Copy link
Member

Choose a reason for hiding this comment

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

Can you confirm this will end up on the started event? What about schedule workflow? What about child workflow? What about signal with start? We should try to make all ways of workflow starting have the same options.

We spent plenty of effort making sure user metadata was propagated in these same kinds of situations. Is everyone sure they don't want to use the user metadata propagation that already exists and just put this inside user metadata?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's added here in the server PR: https://github.com/temporalio/temporal/pull/6420/files#diff-c0867c0ff803c196fa7bc72a15d01812b84ae90eb8b40e71de4ee11d807cfad3R165-R167

At this moment, we're only considering the case of starting new workflow.

Hm, do we want the links to propagate to child workflow, scheduled workflows, etc? I don't think it really make sense.

Copy link
Member

@cretz cretz Aug 21, 2024

Choose a reason for hiding this comment

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

IMO we should be consistent in the options like these for all ways of starting a workflow. There are 4 main ones:

  • Start workflow
  • Signal with start workflow
  • Schedule workflow
  • Start child workflow

It is important IMO, unless there's a good reason not to in certain cases, for these to all accept the same options.

I don't think it really make sense.

This is a general purpose link option, we shouldn't assume how it'll be used. Same type of thing with user metadata. In fact, arguably this is user metadata and should just be on that message, but that was rejected.

Copy link
Member

Choose a reason for hiding this comment

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

I agree we should have the option to link in all of these methods. Not blocking this PR but I'd at least want an issue to add it later.

@rodrigozhou rodrigozhou force-pushed the rodrigozhou/nexus-links branch 3 times, most recently from 7abe07e to de0aa27 Compare August 21, 2024 21:35
Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

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

I think the term event is a bit overloaded. It's a bit confusing that you can have workflow events that are not even history events, but meh. Not a big deal.

@@ -52,6 +52,12 @@ message UnsuccessfulOperationError {
Failure failure = 2;
}

message Link {
// See https://github.com/nexus-rpc/api/blob/main/SPEC.md#links.
Copy link
Member

Choose a reason for hiding this comment

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

This URL does not work. Where can I read about this arbitrary byte array and string type?

Copy link
Member

Choose a reason for hiding this comment

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

It was discussed in an internal document, the public doc should be updated too.

@rodrigozhou rodrigozhou merged commit 2ed0a18 into master Aug 23, 2024
3 checks passed
@rodrigozhou rodrigozhou deleted the rodrigozhou/nexus-links branch August 23, 2024 03:10
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.

3 participants