Skip to content

Propagate Nexus serialization context to workflow updates - #2045

Open
JoshuaFrenchwood wants to merge 1 commit into
nexus-serialization-context-workflows-activitiesfrom
nexus-serialization-context-workflow-update
Open

JoshuaFrenchwood wants to merge 1 commit into
nexus-serialization-context-workflows-activitiesfrom
nexus-serialization-context-workflow-update

Conversation

@JoshuaFrenchwood

Copy link
Copy Markdown
Contributor

What was changed

Nexus operation handlers now propagate their NexusSerializationContext to the workflow updates they send.

  • Handler: update requests sent inside a Nexus operation handler, including update-with-start, carry the context.
  • Worker: the update's result, failure and validator rejection are encoded with the context from DoUpdate, at both the converter and codec layers. Updates have no sequence number, so the codec looks up the context by protocol instance ID. The context is kept until the activation that finished the update has been encoded. Replay gets the same context, since Core builds DoUpdate from history.
  • Update arguments keep the workflow context.
  • Clients: WorkflowUpdateHandle.result() decodes with the context returned on the update and poll responses, so a handle obtained with get_update_handle decodes correctly.

Why?

A Nexus handler returns the result and failure of the update it sends to the Nexus caller. The caller decodes them with the operation's NexusSerializationContext, so a codec keyed on the context couldn't decode them when they were encoded with the workflow context.

Checklist

  1. Closes

  2. How was this tested:

  • test_nexus_sent_update_uses_nexus_context[result|failure|rejection] runs on the dev server with the strict Nexus marker codec. It checks:
    • The Nexus caller gets the result or failure.
    • An update handle obtained by ID decodes the result or failure with the server's context.
    • In history, the accepted request carries the context, the update input is unmarked, and the completed outcome is marked.
    • Rejections aren't stored in history, so a client interceptor checks that the rejection the handler receives is marked.
    • Replaying the history with Replayer succeeds.
  1. Any docs updates needed?

@JoshuaFrenchwood
JoshuaFrenchwood requested a review from a team as a code owner October 29, 2026 18:25
@JoshuaFrenchwood JoshuaFrenchwood mentioned this pull request Oct 29, 2026
@JoshuaFrenchwood
JoshuaFrenchwood force-pushed the nexus-serialization-context-workflow-update branch 3 times, most recently from c870677 to f10c76b Compare October 29, 2026 20:25
@tconley1428
tconley1428 force-pushed the nexus-serialization-context-workflow-update branch from f10c76b to 6eccfc8 Compare October 29, 2026 20:28

This branch has not been deployed

No deployments
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.

1 participant