Skip to content

feat: let Workflow code create, describe and append to Streams - #2187

Draft
moetemp wants to merge 2 commits into
moe/streams-apifrom
moe/streams-workflow-appends
Draft

moetemp wants to merge 2 commits into
moe/streams-apifrom
moe/streams-workflow-appends

Conversation

@moetemp

@moetemp moetemp commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

What was changed

Workflow code creates, describes and appends to Streams. Core runs the appends; a create and a describe run in a Local Activity. New Workflows turn Workflow Task chunking off.

Why?

Workflow code can't call a Store itself, because a replay must get the same results, so Core runs the appends and records them in History. This needs Core only up to Core #1883.

Reviewer's guide

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

  1. Let Workflow code create, describe and append to Streams. temporalio/worker/_workflow_streams.py, and the bridge code that lets Core call a Python Store.
  2. Turn Workflow Task chunking off for new Workflows.

Checklist

  • The commits are unchanged from the former #2129.

Workflow code can't call a Store itself, since a replay must get the
same answers. Core runs each append on the Python Store through the
bridge and records its result in History, and a create or a describe
runs in a Local Activity of the SDK. In this commit a Workflow read
reaches that Local Activity, which refuses it, so the Workflow Task
fails.
A Stream create or describe runs as a Local Activity, and a Workflow
Task that waits for one can complete with no command. Chunking merges
such tasks in a replay, so Workflow code can get a result in another
activation than in the first run. Core records the choice in the first
completed Workflow Task, so a Workflow that started earlier keeps it.
@moetemp
moetemp force-pushed the moe/streams-workflow-appends branch from b184ddb to e95bb88 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