Skip to content

Record a workflow's session info on history events - #916

Closed
Shivs11 wants to merge 2 commits into
shivam/multi-session-optionsfrom
shivam/session-binding-history
Closed

Shivs11 wants to merge 2 commits into
shivam/multi-session-optionsfrom
shivam/session-binding-history

Conversation

@Shivs11

@Shivs11 Shivs11 commented Nov 20, 2026

Copy link
Copy Markdown
Member

What changed?
New SessionInfo / BoundWorkerInfo in session/v1, recorded on WorkflowTaskStartedEventAttributes.session_info and WorkflowExecutionStartedEventAttributes.inherited_session_info.

Why?
Bindings live only in mutable state today, so a reset (or any rebuild from history) loses them; exclusive workflows must keep their worker across resets. Server-only; SDKs ignore these fields.

Breaking changes
None. New experimental fields.

Server PR
To follow, on top of the session stack.

Adds SessionInfo (exclusive_worker, bound_worker_info) in session/v1 and
records it on WorkflowTaskStartedEventAttributes (session_info) and
WorkflowExecutionStartedEventAttributes (inherited_session_info), so the
server can rebuild a workflow's worker binding from history, for example
on reset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Shivs11
Shivs11 marked this pull request as ready for review November 20, 2026 21:32
@Shivs11
Shivs11 requested review from a team as code owners November 20, 2026 21:32
}

// EXPERIMENTAL. Subject to redesign or removal.
// Which worker a workflow (which is the session) is bound to. The server records it on history events

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 workflow always == to the session? For future users of this message? If so this should just be called WorkflowSessionInfo, otherwise strike that language

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah the workflow is the session, at-least for now. This can change in the near future though, which is why SessionInfo sounds more appropriate imo (for eg, you could have activities that want to be routed to some different session that is not the workflow it was scheduled from)

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.

K, then I'd change the docstring.

@Shivs11

Shivs11 commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Folded into #885 so the session API can be reviewed in one place.

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