Skip to content

feat: let Workflow code read a Stream - #2188

Draft
moetemp wants to merge 2 commits into
moe/streams-workflow-appendsfrom
moe/streams-workflow-reads
Draft

moetemp wants to merge 2 commits into
moe/streams-workflow-appendsfrom
moe/streams-workflow-reads

Conversation

@moetemp

@moetemp moetemp commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

What was changed

Workflow code reads a Stream, and a StreamRef[T] decodes in a dataclass, a list and an optional. The Core pin moves to the head of Core #1819, with the read protos regenerated.

Why?

A replay reads the Records again from the Store, so History stays small. This is the only Python PR that waits for Core #1819.

Reviewer's guide

Review after #2187. Read the 2 commits in order.

  1. Let Workflow code read a Stream. The Core pin, the read protos, then the read path and stream_read_time.
  2. Decode a StreamRef[T] in a dataclass, a list and an optional.

Checklist

  • The code is unchanged from the former #2129; only the Core pin moved into the read commit.

Core runs each read and records the offset, the count and the digest of
its page, so a replay reads the Records from the Store again and checks
them. `stream_read_time` bounds how long reads keep a Workflow Task
open, and `StreamReplayError` lets a Workflow fail when Records changed.
A ref in Workflow or Activity input must keep its body type, since a
read converts each body to it. Only `StreamRef` takes the two new
decoding paths, since a change for any other type would alter the
replay of existing Workflow Histories.
@moetemp
moetemp force-pushed the moe/streams-workflow-reads branch from b5dd883 to 7d0638b Compare December 2, 2026 23:24

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