Repository navigation
Conversation
An Activity writes to its Workflow's stream as itself, so readers see its retry, and a lower attempt after a higher one is reported as stale.
# Conflicts: # temporalio/contrib/streams/__init__.py
Activity ids repeat across the runs of a chain while the stream and its dedupe state span the chain, so run 2's first append was refused as stale or silently matched run 1's position.
Such records reached the consumer as ordinary DATA and only the Worker log said otherwise. The package docs now also say an Activity's read ends with its scheduling run.
# Conflicts: # temporalio/contrib/streams/_policy.py
Handles and producers call Core's in-process service, which checks owners, mints cursors and reports supersession. Lang converts values, takes the digest and content hashes before the codec, and runs the codec both ways. An Activity sends its typed identity so Core derives its producer id.
Core checks the cursor and resolves END when the generator first runs, so a reader that must catch the next record positions itself with latest() first.
# Conflicts: # tests/contrib/streams/test_workflow_writer.py
The Workflow encodes its records with its own serialization context, so readers and producers without it couldn't decode them with a context-aware codec. An Activity's second producer object could also dedupe a record away, and a Local Activity's attempt isn't durable, so it gets no producer.
moetemp
marked this pull request as draft
October 12, 2026 06:58
This layer is where a Workflow publishes and outside code reads end to end, so the release note lands here.
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
This PR adds the stream handles an Activity and a client use to read and write a Workflow's stream through Core.
get_stream_handle()andactivity_handle()return aStreamHandlewithread,latestandproducer.append. It moves its sequence only when an append succeeds.ActivityProducerand Core derives<activity id>@<scheduling run id>, so every SDK writes the same producer id (DD-44).state. Both sides use the Workflow'sWorkflowSerializationContext, so a context-aware codec decodes the records.StreamUnsupportedError. Its attempt isn't durable, so its first append after a crash would be refused as stale.Why?
Core owns owner checks, cursors, dedupe and supersession. So a handle is a thin loop over the stub with the codec on both sides (DD-88).
How did you test it?
Link to a test plan if any -
tests/contrib/streams/test_outside_handles.pyruns on the dev server.