Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
33a2f15
Add temporalio.contrib.pubsub — reusable pub/sub for workflows
jssmith Apr 6, 2026
e2712e2
Fix PubSubState CAN serialization and simplify subscribe error handling
jssmith Apr 6, 2026
17952ae
Polish pub/sub contrib: README, flush safety, init guard, factory method
jssmith Apr 6, 2026
d1dfce7
Add init guards to poll/query handlers and fix README CAN example
jssmith Apr 6, 2026
f20ba36
Guard validator against missing init_pubsub, fix PubSubState docstring
jssmith Apr 6, 2026
70bf747
Guard get_pubsub_state/drain_pubsub, add replay and max_batch_size tests
jssmith Apr 6, 2026
70898d0
Add review comments and design addenda for pubsub redesign
jssmith Apr 7, 2026
5ff7e27
Implement pubsub redesign: dedup, base_offset, flush safety, API cleanup
jssmith Apr 7, 2026
6fbb168
TLA+-verified dedup rewrite, TTL pruning, truncation, API improvements
jssmith Apr 7, 2026
42b0df1
Remove TLA+ proof references from implementation code
jssmith Apr 7, 2026
c87a65a
Update uv.lock
jssmith Apr 7, 2026
d5a23c3
Add signal vs update dedup analysis; clarify ordering guarantees
jssmith Apr 7, 2026
3089b12
Add end-to-end dedup analysis: proper layering for three duplicate types
jssmith Apr 7, 2026
f06a53e
Expand DESIGN-v2 with offset model rationale and BFF/SSE reconnection…
jssmith Apr 7, 2026
990a6a7
pubsub: use base64 wire format with native bytes API
jssmith Apr 7, 2026
f2c6e55
pubsub: remove poll timeout and update design doc
jssmith Apr 8, 2026
a9abc20
Add token-level streaming to OpenAI and ADK Temporal plugins
jssmith Apr 8, 2026
20dafc0
pubsub: replace PubSubState Pydantic model with plain dataclass
jssmith Apr 9, 2026
5a8716c
pubsub: add per-item offsets to PubSubItem and _WireItem
jssmith Apr 10, 2026
eda55d5
pubsub: add design addendum for per-item offsets
jssmith Apr 10, 2026
7bc830a
pubsub: fix truncated offset crash and add recovery
jssmith Apr 10, 2026
475df95
Add cross-workflow and cross-namespace pub/sub tests
jssmith Apr 19, 2026
90d753e
pubsub: cap poll response at ~1MB and skip cooldown when more data ready
jssmith Apr 19, 2026
c76a774
Add compatibility contract to pub/sub design doc
jssmith Apr 19, 2026
97be29c
Fix sequence reuse after retry timeout (TLA+-verified)
jssmith Apr 19, 2026
6f0f345
Merge remote-tracking branch 'origin/main' into contrib/pubsub
jssmith Apr 19, 2026
9d0a259
Remove backward-compat code and historical design docs from pubsub
jssmith Apr 20, 2026
c4ec6e7
Update pubsub README: rename for_workflow → create, streamline docs
jssmith Apr 20, 2026
4945cbc
Fix continue-as-new example to show application state carried alongsi…
jssmith Apr 20, 2026
6d9ea42
Add motivation and architectural context to pubsub README intro
jssmith Apr 20, 2026
7d42b29
Move bytes/base64 payload detail to Cross-Language Protocol section
jssmith Apr 20, 2026
436430c
Move analysis docs and TLA+ verification out of pubsub module
jssmith Apr 20, 2026
c09ad49
Remove TLA+ references, document opaque-bytes and JSON converter rati…
jssmith Apr 20, 2026
e683c5c
Merge branch 'main' into contrib/pubsub
jssmith Apr 21, 2026
3a71028
Clean up pubsub tests: remove redundant cases, de-flake barriers
jssmith Apr 22, 2026
4ab7ce4
Replace remaining brittle sleeps in pubsub tests and type handle helpers
jssmith Apr 23, 2026
2fbe0d4
Clarify that pubsub truncation is workflow-side only
jssmith Apr 23, 2026
fdbb339
Switch test truncate from signal to update for explicit completion
jssmith Apr 23, 2026
5a0796f
Delete test_mixin_coexistence
jssmith Apr 23, 2026
3541790
Force interleaving in test_concurrent_subscribers
jssmith Apr 23, 2026
68ad53d
Strengthen CAN test, widen TTL margins, document Any-field pitfall
jssmith Apr 23, 2026
682c420
Hoist inline imports to module level in pubsub tests
jssmith Apr 23, 2026
368d023
Fix __aexit__ drain race and strengthen pubsub tests
jssmith Apr 23, 2026
beacec9
Style + docstring cleanups in pubsub contrib module
jssmith Apr 23, 2026
56789ed
Apply pubsub review feedback: init pattern, force_flush, from_activity
jssmith Apr 23, 2026
6193f80
Migrate pubsub payloads from opaque bytes to Temporal Payload
jssmith Apr 23, 2026
4f9d669
Bump sdk-core submodule to match temporalio-client 0.2.0
jssmith Apr 23, 2026
e9d4e6b
Port Notion narrative into DESIGN-v2.md and add sync-policy note
jssmith Apr 23, 2026
75efe24
Merge remote-tracking branch 'origin/main' into contrib/pubsub
jssmith Apr 23, 2026
68c719e
Apply pubsub API renames to ADK/OpenAI streaming plugins
jssmith Apr 23, 2026
72d296e
Replace PubSubMixin with PubSub dynamic handler registration
jssmith Apr 24, 2026
ef7e041
Document per-poll fan-out and list future-work items in DESIGN-v2
jssmith Apr 24, 2026
99a7a8a
openai_agents: publish raw stream events, drop normalization layer
jssmith Apr 24, 2026
4205242
Fix lint findings from CI (ruff format, pyright, pydocstyle)
jssmith Apr 24, 2026
dddbcef
Fix Python 3.10 lint/type errors in pubsub tests
jssmith Apr 24, 2026
47ee940
pubsub tests: also suppress reportUnreachable on the 3.11 import branch
jssmith Apr 24, 2026
8a971d0
pubsub tests: attach reportUnreachable ignore to the import-stmt line
jssmith Apr 24, 2026
736b570
pubsub: fix dynamic-signal-vs-update race and pydoctor cross-ref
jssmith Apr 24, 2026
47106ad
pubsub: document sync-handler/publish race with asyncio.sleep(0) recipe
jssmith Apr 24, 2026
885d0e8
pubsub tests: switch TruncateWorkflow.truncate to the async recipe
jssmith Apr 24, 2026
2d76877
pubsub: add public async flush() barrier
jssmith Apr 25, 2026
8e5c3e4
pubsub: document migration to server-side request_id dedup
jssmith Apr 25, 2026
9274670
pubsub: accept a single string for subscribe(topics=...)
jssmith Apr 25, 2026
b11748b
pubsub: prefix internal handler names with __temporal_
jssmith Apr 25, 2026
48645d4
pubsub: clean up three lint suppressions flagged by codex review
jssmith Apr 25, 2026
be37937
pubsub: add PubSub.continue_as_new helper
jssmith Apr 28, 2026
82323ae
pubsub: switch timing parameters to timedelta
jssmith Apr 28, 2026
c3370a7
openai-agents: hook stream_response, opt in via Runner.run_streamed
jssmith Apr 28, 2026
88dac52
google-adk: honor stream=True, publish raw LlmResponse chunks
jssmith Apr 28, 2026
59b4083
pubsub: README CAN example uses generic AppState carrier
jssmith Apr 28, 2026
75d9dfa
PR #1423 mechanical cleanup from review
jssmith Apr 28, 2026
eb089e4
pubsub: import Sequence from collections.abc
jssmith Apr 28, 2026
6ee1e67
pubsub: merge per-publisher dedup state into PublisherState
jssmith Apr 28, 2026
18da580
pubsub: move SIGNAL-UPDATE-RACE.md analysis out of contrib
jssmith Apr 28, 2026
373024e
pubsub: soften codec chain wording
jssmith Apr 28, 2026
52fa293
update publish example
jssmith Apr 28, 2026
8fa4d19
contrib: mark pubsub and streaming surfaces as experimental
jssmith Apr 28, 2026
8f707de
openai-agents: drop unused logger imports
jssmith Apr 28, 2026
e2b07f1
pubsub: refresh DESIGN-v2 to match current implementation
jssmith Apr 28, 2026
e569fff
openai-agents: factor workflow-only setup into _prepare_workflow_run
jssmith Apr 28, 2026
a2104b6
contrib: default streaming_event_topic to None for opt-in publishing
jssmith Apr 28, 2026
5890c58
contrib: rename pubsub module to workflow_stream
jssmith Apr 29, 2026
57e52f4
workflow_stream: rename DESIGN-v2.md to DESIGN.md
jssmith Apr 29, 2026
dbe9a6a
contrib: tighten OpenAI/ADK streaming tests, drop redundant cases
jssmith Apr 29, 2026
842ea8d
workflow_stream: clarify activity-side publishing in README
jssmith Apr 29, 2026
5d72da8
workflow_stream: post-rename docs and test cleanup
jssmith Apr 29, 2026
4b88baf
Merge remote-tracking branch 'origin/main' into contrib/pubsub
jssmith Apr 29, 2026
ad961f6
workflow_stream: document standalone-activity usage and cover with tests
jssmith Apr 29, 2026
4279c2e
workflow_stream: ruff format test_workflow_stream.py
jssmith Apr 29, 2026
bd35117
workflow_stream: note deferred final-flag dedup-prune proposal
jssmith Apr 29, 2026
04dfd3d
workflow_stream: trim README to point at docs.temporal.io
jssmith Apr 29, 2026
22ad024
workflow_stream: drop in-tree DESIGN.md
jssmith Apr 29, 2026
1f4099a
openai_agents: require streaming_event_topic and fail fast
jssmith Apr 29, 2026
7c910de
google_adk_agents: single-input dataclass and required topic
jssmith Apr 29, 2026
40d3bff
workflow_stream: rename from_activity to from_within_activity
jssmith Apr 29, 2026
a412d64
workflow_stream: default-decode in subscribe, RawValue for raw access
jssmith Apr 29, 2026
170d570
workflow_streams: rename module from workflow_stream
jssmith Apr 29, 2026
908bc9b
workflow_streams: introduce typed topic handles
jssmith Apr 29, 2026
4831c9a
workflow_streams: reject type=Payload on topic handles
jssmith Apr 29, 2026
a8d3dfc
workflow_streams: remove WorkflowStream(Client).publish in favor of t…
jssmith Apr 29, 2026
e2c76b3
workflow_streams: fix dangling publish refs in docstrings after a8d3dfc1
jssmith Apr 29, 2026
59c7582
contrib: revert openai_agents and google_adk_agents to main
jssmith Apr 29, 2026
19d2e18
workflow_streams: rename WorkflowStream.drain to stop_polling
jssmith Apr 29, 2026
1a19ef5
workflow_streams: make topic(type=...) optional, default to Any
jssmith Apr 29, 2026
553a83b
workflow_streams: rename stop_polling to detach_pollers
jssmith Apr 29, 2026
85f7566
Merge branch 'main' into contrib/pubsub
jssmith Apr 29, 2026
4646f6d
workflow_streams: clarify docstrings flagged in PR #1423 review
jssmith Apr 29, 2026
1b46541
workflow_streams: reject subscribe(result_type=Payload) and add tests
jssmith Apr 30, 2026
587f638
workflow_streams: parametrize WorkflowStreamItem on decoded data type
jssmith Apr 30, 2026
8474292
workflow_streams: tighten README intro and fix samples link
jssmith Apr 30, 2026
540fd05
Merge branch 'main' into contrib/pubsub
jssmith Apr 30, 2026
ad504cb
workflow_streams: fix truncation race + graceful subscribe-on-completion
jssmith Apr 30, 2026
46895fd
Merge remote-tracking branch 'origin/main' into contrib/pubsub
tconley1428 Apr 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ dev = [
"opentelemetry-exporter-otlp-proto-grpc>=1.11.1,<2",
"opentelemetry-semantic-conventions>=0.40b0,<1",
"opentelemetry-sdk-extension-aws>=2.0.0,<3",
"async-timeout>=4.0,<6; python_version < '3.11'",
]

[tool.poe.tasks]
Expand Down
33 changes: 33 additions & 0 deletions temporalio/contrib/workflow_streams/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Temporal Workflow Streams

> ⚠️ **This package is currently at an experimental release stage.** ⚠️

**Workflow Streams** is a Temporal Python SDK contrib library that gives a
Workflow a durable, offset-addressed event channel for keeping outside
observers updated on the progress of the Workflow and its Activities.
Typical uses include driving a UI for a long-running AI agent, surfacing
status during in-flight payment or order processing, and reporting progress
from data pipelines. It is not designed for ultra-low-latency applications
such as real-time voice; per-roundtrip latency is around 100ms, and cost
scales with durable batches rather than tokens.

Under the hood the stream is built directly on Temporal's existing
message-passing primitives: Signals carry publishes, Updates serve
long-poll subscriptions, and a Query exposes the current global offset.
The library packages the boilerplate that turns those primitives into
a usable stream: batching to amortize per-event overhead, deduplication
for exactly-once delivery, topic filtering, and continue-as-new helpers
that hand stream state across Workflow runs.

## Documentation

📖 **The full guide lives in the Temporal documentation site:**
**[Workflow Streams — Python SDK](https://docs.temporal.io/develop/python/libraries/workflow-streams)**

It covers installation, enabling streaming on a Workflow, publishing from
Workflows and Activities, subscribing, continue-as-new, delivery semantics,
codec and payload encoding, architecture, and caveats — with runnable code
snippets throughout.

For runnable end-to-end examples, see the
[Workflow Streams samples](https://github.com/temporalio/samples-python/tree/main/workflow-streams).
43 changes: 43 additions & 0 deletions temporalio/contrib/workflow_streams/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"""Workflow Streams for Temporal workflows.

.. warning::
This package is experimental and may change in future versions.

The Workflow Streams contrib library gives a workflow a durable,
offset-addressed event channel built from Signals and polling Updates
with an SSE bridge. Cost scales with durable batches, not tokens.
Latency is around 100ms per roundtrip; not for ultra-low-latency voice.

See :py:class:`WorkflowStream` for the workflow-side stream object and
:py:class:`WorkflowStreamClient` for the external client interface.
"""

from temporalio.contrib.workflow_streams._client import WorkflowStreamClient
from temporalio.contrib.workflow_streams._stream import WorkflowStream
from temporalio.contrib.workflow_streams._topic_handle import (
TopicHandle,
WorkflowTopicHandle,
)
from temporalio.contrib.workflow_streams._types import (
PollInput,
PollResult,
PublishEntry,
PublisherState,
PublishInput,
WorkflowStreamItem,
WorkflowStreamState,
)

__all__ = [
"PollInput",
"PollResult",
"PublishEntry",
"PublishInput",
"PublisherState",
"TopicHandle",
"WorkflowStream",
"WorkflowStreamClient",
"WorkflowStreamItem",
"WorkflowStreamState",
"WorkflowTopicHandle",
]
Loading
Loading