Skip to content

Add Callbacks and Links to Workflow Update#742

Draft
Quinn-With-Two-Ns wants to merge 10 commits intotemporalio:masterfrom
Quinn-With-Two-Ns:update-callback
Draft

Add Callbacks and Links to Workflow Update#742
Quinn-With-Two-Ns wants to merge 10 commits intotemporalio:masterfrom
Quinn-With-Two-Ns:update-callback

Conversation

@Quinn-With-Two-Ns
Copy link
Copy Markdown
Contributor

READ BEFORE MERGING: All PRs require approval by both Server AND SDK teams before merging! This is why the number of required approvals is "2" and not "1"--two reviewers from the same team is NOT sufficient. If your PR is not approved by someone in BOTH teams, it may be summarily reverted.

What changed?
Add Callbacks and Links to Workflow Update.

Why?
Will allow starting async updates from a Nexus Operation Handler

Breaking changes

Server PR

temporalio/temporal#9614

// Ignored if nil.
temporal.api.common.v1.Priority priority = 6;

map<string, WorkflowUpdateOptionsUpdate> workflow_update_options = 7;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is the key here the update ID? I slightly prefer putting the update ID in the WorkflowUpdateOptionsUpdate event so it's clear what the field just by the name. That would turn this field's type to repeated WorkflowUpdateOptionsUpdate.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah I thought we would need to index into this but we never ended up needing to

// update.
temporal.api.update.v1.Request accepted_request = 4;
// Completion callbacks attached when this update was started.
// TODO(quinn) maybe not needed
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like it's needed? My only concern is that the event time here is for when the update was accepted but there's no indication of when the callback was received for attachment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We currently don't keep any time for when the update was received, so if we don't care about when the update was received I don't think a callback changes that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We already attach the callback to the request so we can remove the callback here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agree knowing the request time could be useful and is a separate concern.

string namespace = 1;
string workflow_id = 2;
string run_id = 3;
temporal.api.enums.v1.LinkReason reason = 4;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I kinda prefer a string here, it's a bit more overhead but doesn't require translating enums to strings and can flow newer values through older SDK and server versions that don't have up-to-date protos.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't have a strong opinion here. I thought enums were just easier to keep consistent across the SDK, Server and UI.

Copy link
Copy Markdown
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.

Nothing blocking AFAIC

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.

2 participants