Skip to content

Commit 9dd6db5

Browse files
authored
Merge branch 'main' into fix/langgraph-timeout-test-flake
2 parents 27e51c0 + bb433be commit 9dd6db5

11 files changed

Lines changed: 4219 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ dev = [
8686
"opentelemetry-exporter-otlp-proto-grpc>=1.11.1,<2",
8787
"opentelemetry-semantic-conventions>=0.40b0,<1",
8888
"opentelemetry-sdk-extension-aws>=2.0.0,<3",
89+
"async-timeout>=4.0,<6; python_version < '3.11'",
8990
]
9091

9192
[tool.poe.tasks]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Temporal Workflow Streams
2+
3+
> ⚠️ **This package is currently at an experimental release stage.** ⚠️
4+
5+
**Workflow Streams** is a Temporal Python SDK contrib library that gives a
6+
Workflow a durable, offset-addressed event channel for keeping outside
7+
observers updated on the progress of the Workflow and its Activities.
8+
Typical uses include driving a UI for a long-running AI agent, surfacing
9+
status during in-flight payment or order processing, and reporting progress
10+
from data pipelines. It is not designed for ultra-low-latency applications
11+
such as real-time voice; per-roundtrip latency is around 100ms, and cost
12+
scales with durable batches rather than tokens.
13+
14+
Under the hood the stream is built directly on Temporal's existing
15+
message-passing primitives: Signals carry publishes, Updates serve
16+
long-poll subscriptions, and a Query exposes the current global offset.
17+
The library packages the boilerplate that turns those primitives into
18+
a usable stream: batching to amortize per-event overhead, deduplication
19+
for exactly-once delivery, topic filtering, and continue-as-new helpers
20+
that hand stream state across Workflow runs.
21+
22+
## Documentation
23+
24+
📖 **The full guide lives in the Temporal documentation site:**
25+
**[Workflow Streams — Python SDK](https://docs.temporal.io/develop/python/libraries/workflow-streams)**
26+
27+
It covers installation, enabling streaming on a Workflow, publishing from
28+
Workflows and Activities, subscribing, continue-as-new, delivery semantics,
29+
codec and payload encoding, architecture, and caveats — with runnable code
30+
snippets throughout.
31+
32+
For runnable end-to-end examples, see the
33+
[Workflow Streams samples](https://github.com/temporalio/samples-python/tree/main/workflow-streams).
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
"""Workflow Streams for Temporal workflows.
2+
3+
.. warning::
4+
This package is experimental and may change in future versions.
5+
6+
The Workflow Streams contrib library gives a workflow a durable,
7+
offset-addressed event channel built from Signals and polling Updates
8+
with an SSE bridge. Cost scales with durable batches, not tokens.
9+
Latency is around 100ms per roundtrip; not for ultra-low-latency voice.
10+
11+
See :py:class:`WorkflowStream` for the workflow-side stream object and
12+
:py:class:`WorkflowStreamClient` for the external client interface.
13+
"""
14+
15+
from temporalio.contrib.workflow_streams._client import WorkflowStreamClient
16+
from temporalio.contrib.workflow_streams._stream import WorkflowStream
17+
from temporalio.contrib.workflow_streams._topic_handle import (
18+
TopicHandle,
19+
WorkflowTopicHandle,
20+
)
21+
from temporalio.contrib.workflow_streams._types import (
22+
PollInput,
23+
PollResult,
24+
PublishEntry,
25+
PublisherState,
26+
PublishInput,
27+
WorkflowStreamItem,
28+
WorkflowStreamState,
29+
)
30+
31+
__all__ = [
32+
"PollInput",
33+
"PollResult",
34+
"PublishEntry",
35+
"PublishInput",
36+
"PublisherState",
37+
"TopicHandle",
38+
"WorkflowStream",
39+
"WorkflowStreamClient",
40+
"WorkflowStreamItem",
41+
"WorkflowStreamState",
42+
"WorkflowTopicHandle",
43+
]

0 commit comments

Comments
 (0)