Skip to content

Add Nexus Callback Token to StartOperationOptions#61

Draft
chaptersix wants to merge 9 commits intonexus-rpc:mainfrom
chaptersix:alex/token
Draft

Add Nexus Callback Token to StartOperationOptions#61
chaptersix wants to merge 9 commits intonexus-rpc:mainfrom
chaptersix:alex/token

Conversation

@chaptersix
Copy link

@chaptersix chaptersix commented Oct 10, 2025

In support of this feature this PR added the CallbackToken to the StartOperationOptions.

@bergundy
Copy link
Contributor

@chaptersix please add a test and also make sure to rehydrate the option from the header. You will want to delete that header key so it doesn't show up in CallbackHeader.

@chaptersix
Copy link
Author

In the Nexus SPEC.md, call out that the Nexus-Callback-Token is a standard header and that it is required as part of the StartOperation request.

@bergundy should the sdk require the user pass in the callbacktoken?

@chaptersix chaptersix marked this pull request as ready for review October 13, 2025 15:45
@chaptersix chaptersix changed the title Add Nexus Callback Token to StartOperation Options Add Nexus Callback Token to Operation Options Oct 14, 2025
@chaptersix
Copy link
Author

In the Nexus SPEC.md, call out that the Nexus-Callback-Token is a standard header and that it is required as part of the StartOperation request.

@bergundy should the sdk require the user pass in the callbacktoken?

I don't think this is relevant now.
Could use some help with a better description.

@chaptersix chaptersix requested a review from bergundy October 14, 2025 19:14
@bergundy
Copy link
Contributor

In the Nexus SPEC.md, call out that the Nexus-Callback-Token is a standard header and that it is required as part of the StartOperation request.

@bergundy should the sdk require the user pass in the callbacktoken?

I don't think this is relevant now. Could use some help with a better description.

It's still relevant even though we inlined the implementation in the Temporal codebase.

@chaptersix chaptersix changed the title Add Nexus Callback Token to Operation Options Add Nexus Callback Token to StartOperationOptions Oct 16, 2025
Co-authored-by: Roey Berman <roey.berman@gmail.com>
// CallbackToken is a caller-generated token that is used to recreate context when processing the callback.
// CallbackToken must be provided if CallbackURL is not empty.
// Handlers must Include the CallbackToken when they invoke the callback.
CallbackToken []byte
Copy link

Choose a reason for hiding this comment

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

Token is just a header and this is already present in the header, along with all my other callback headers right? Or is this one header named "Token" special?

Copy link
Contributor

Choose a reason for hiding this comment

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

We are giving this one special treatment because we want to abstract headers away from users.
On the caller side, they will provide an object that will be embedded into a token and let the framework handle serialization.
Now that I'm thinking about it, we should add this already here.

Copy link

@cretz cretz Oct 20, 2025

Choose a reason for hiding this comment

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

I don't think we should abstract/hide headers from general Nexus users. Users should be allowed to set whatever headers, or 0 headers. If they happen to want some kind of "key" or "token" or "id" or whatever header they can, but we shouldn't require it or have it be a special header or whatever. From a Nexus POV, I should be able to have any headers I want in the callback (within reason), and ask the server to send those.

If Temporal happens to have a concept of "callback token", that doesn't mean others must too.

@chaptersix chaptersix marked this pull request as draft November 17, 2025 18:06
@bergundy bergundy removed their request for review December 10, 2025 00:36
@bergundy
Copy link
Contributor

Removed myself as a reviewer. Let get back to this when it becomes higher priority.

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