Skip to content

Add Stream Stores and Workflow Stream calls - #2129

Draft
moetemp wants to merge 55 commits into
moe/streams-generated-codefrom
moe/streams-api
Draft

moetemp wants to merge 55 commits into
moe/streams-generated-codefrom
moe/streams-api

Conversation

@moetemp

@moetemp moetemp commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

What was changed

This PR adds Streams for Python clients, Activities and Workflows. StreamConfig registers Stores and append limits. Workflow appends and reads use Core. Create and describe use Local Activities.

Workflow reads remain a release stretch goal until notifications are available.

Why?

Records stay in the Store. History retains operation results and read digests for replay. Retention must cover the Workflow's life, later replays and queries. Store outages fail the Workflow Task.

Client interceptor retries retain their Store request ID to prevent duplicate writes. BufferedAppender preserves write order under eager task execution and cancellation. Memory Store reads stop at expiry.

Reviewer's guide

Review after the generated API. Merge both layers together.

  1. Read StreamConfig and StreamStore in temporalio/client/_stream_store.py. Check Store selection, encoded limits and retry identities. Python replay requires the recorded Store choices.
  2. Follow temporalio/worker/_workflow_streams.py into the bridge. Outages must fail the task. Retained Records must reproduce each recorded read.
  3. Check _WorkflowLogicFlag.USE_LAST_STREAM_RECORD_OFFSET and REPORT_EXISTING_STREAM_AS_FALSE. Unflagged replay must retain historical cursor and create results, including interceptor responses.
  4. Check the converter's opt-in path for StreamRef. Existing generic and union types must retain their decoded values.
  5. Use tests/worker/test_workflow_streams.py for activation order and cancellation. tests/nexus/test_streams_with_worker.py covers a Worker, codecs and replay.

The bridge disables Workflow Task chunking for all new runs, including runs without Streams. Concurrent create and describe Local Activities still need this setting to preserve their result groups. Existing histories retain their recorded mode.

Checklist

  • Stream, converter, Workflow flag and Activity suites passed.
  • poe format and poe lint passed.
  • Native bridge build and poe bridge-lint passed with the reviewed Core pin.
  • Coroutine cleanup regressions passed with warnings treated as errors.

@moetemp
moetemp added this pull request to stack #2130 November 14, 2026 01:00
@moetemp
moetemp removed this pull request from stack #2130 November 15, 2026 08:27
@moetemp moetemp changed the title feat: add the Streams API, with Stream Stores on Redis and in memory feat: add the Streams API for Activity and client code, with Stores on Redis and in memory Nov 17, 2026
@moetemp
moetemp added this pull request to stack #2139 November 18, 2026 01:19
@moetemp moetemp changed the title feat: add the Streams API for Activity and client code, with Stores on Redis and in memory feat: add the Streams API for Activity and client code Nov 18, 2026
@moetemp moetemp changed the title feat: add the Streams API for Activity and client code feat: add the Streams API for client, Activity and Workflow code Nov 22, 2026
@moetemp
moetemp force-pushed the moe/streams-api branch 2 times, most recently from 4f48bab to 066b280 Compare November 22, 2026 03:31

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