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

Set Nexus operation ID on callback headers #1710

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pdoerner
Copy link
Contributor

What was changed

Setting Nexus-Operation-Id header on callback headers.
Depends on nexus-rpc/sdk-go#26

Why?

This information is necessary for fabricating a NexusOperationStarted event if the completion is received before the response to a StartOperation request. This ID is set to the workflow ID unless the user provides a value for this header; user-provided values for this header are not overwritten.

Checklist

  1. Closes

  2. How was this tested:

Existing tests

  1. Any docs updates needed?

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.

LGTM.

Another non-blocking request is to always have the server generate the links (SDK can generate as a fallback when used with an old server).
That way operation ID is always coming from the SDK and the link from the server.

We should also document the implications of changing the operation ID returned from WorkflowRunOperation.Start. Let's tell them to never do that because the ID is used for cancelation and is reporting completion from the server.

@@ -324,12 +325,21 @@ func ExecuteUntypedWorkflow[R any](
if startWorkflowOptions.TaskQueue == "" {
startWorkflowOptions.TaskQueue = nctx.TaskQueue
}
if startWorkflowOptions.ID == "" {
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if we want to require setting workflow ID for Nexus operations. We require it in all Core based SDKs, maybe we can at least protect Nexus users. Not blocking this PR though. @cretz, @Quinn-With-Two-Ns to weigh in on this.

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought the Go SDK did require setting a workflow ID for Nexus operations? I think it makes sense to require it or at least default it to something deterministic so starting a workflow is idempotent

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