Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
5d5925e
Pin Core with the Stream runtime
moetemp Nov 21, 2026
818adb3
Add StreamStore and MemoryStreamStore
moetemp Nov 21, 2026
0a8c346
Add Stream Stores to the client
moetemp Nov 21, 2026
d599dc8
Run the Stream writes of Workflow code through Core
moetemp Nov 21, 2026
8f41de9
Let Workflow code read a Stream
moetemp Nov 21, 2026
2d13563
Add BufferedAppender
moetemp Nov 21, 2026
b59a9cc
Decode a `StreamRef[T]` in a dataclass, a list and an optional
moetemp Nov 22, 2026
0f50b4f
Turn workflow task chunking off for new Workflows
moetemp Nov 22, 2026
cd7b431
Drop the Workflow `producer` argument from the Stream docs
moetemp Nov 23, 2026
f8aa893
Add the namespace to the Stream selector context
moetemp Nov 23, 2026
183edbe
Pin Core with refs in the Stream requests
moetemp Nov 24, 2026
91855c9
Pass the request id of a create and an append to a Store
moetemp Nov 24, 2026
d14f531
Drop the Stream helpers that the generated code no longer calls
moetemp Nov 24, 2026
5c14456
Give the Producer of a Workflow's Activity its scheduled event id
moetemp Nov 24, 2026
56100c3
Continue a Workflow read from the last offset of its page
moetemp Nov 24, 2026
3d2063b
Give a page with no last_offset the offset where it ended
moetemp Nov 24, 2026
98bedd9
Shorten the docs of the Stream Store and its helpers
moetemp Nov 24, 2026
ca55fc5
Pin Core with the read limit of the Workflow Stream calls
moetemp Nov 24, 2026
215dc6d
Regenerate the bridge protos and the payload visitor at the new Core
moetemp Nov 24, 2026
7d83f9b
Use the read limit of Core for the Workflow Stream reads
moetemp Nov 24, 2026
f20654f
Pin Core with a read that doesn't wait kept at the read limit
moetemp Nov 24, 2026
86615b2
Say that a read with no wait goes on at the read limit
moetemp Nov 24, 2026
2491c9b
Pin Core with Stream markers and a Store that gets the Stream id
moetemp Nov 25, 2026
3e34ca7
Give a Stream Store the Store requests, with no close
moetemp Nov 25, 2026
611e470
Choose the Store of a Workflow Stream call before Core
moetemp Nov 25, 2026
8cf4cc8
Read again after a page whose wait the read limit cut
moetemp Nov 25, 2026
0811eff
Pin Core to the Streams stack with main merged
moetemp Nov 26, 2026
804dd7e
Start a Workflow Stream call by the name of its Store
moetemp Nov 26, 2026
15f578a
Read on after a Workflow page with no Record
moetemp Nov 26, 2026
ddecff2
Say that a replay fails when the Store of a call changes
moetemp Nov 26, 2026
09f6dda
Give read iterators a default wait and read on everywhere
moetemp Nov 26, 2026
07359ad
Pin Core to the Streams stack after the tie rule
moetemp Nov 26, 2026
035378c
Merge branch 'moe/streams-generated-code' into moe/streams-api
moetemp Nov 26, 2026
b67926b
Say in the StreamStore docs that a refusal message goes in a marker
moetemp Nov 26, 2026
0f050a8
Pin Core to the Store name rule of sdk-rust#1833
moetemp Nov 26, 2026
5415664
Document and test the Store of a ref with no Store name
moetemp Nov 26, 2026
37aec86
Pin Core to the default Stream runtime of sdk-rust#1833
moetemp Nov 26, 2026
7b31d3e
Pin Core to the one-name runtime check of sdk-rust#1833
moetemp Nov 26, 2026
2db60b4
Finalize async generators when the virtual-clock test loop exits
moetemp Nov 27, 2026
7d6a549
Document Stream replay and verify poll cancellation
moetemp Nov 27, 2026
f448233
Merge reviewed Stream bindings
moetemp Nov 27, 2026
d2fa862
Pin replay-compatible Core and clarify Stream contracts
moetemp Nov 27, 2026
03e2cdd
Merge the final generated Stream documentation
moetemp Nov 27, 2026
b26dbb0
Correct the Store cancellation comments
moetemp Nov 27, 2026
a98a63d
Simplify Stream routing and replay tests
moetemp Nov 27, 2026
06528ce
Replace generated StreamRef shapes with fixed cases
moetemp Nov 27, 2026
7f2d20b
Preserve replay when filling a missing Stream cursor
moetemp Nov 28, 2026
3c1fc4f
Merge the reviewed generated Stream API
moetemp Nov 28, 2026
fbe7fa5
Update Core to the reviewed Stream runtime
moetemp Nov 28, 2026
649b351
Preserve historical Stream creation results
moetemp Nov 28, 2026
b16c10d
Use UTC for Activity test timestamps
moetemp Nov 28, 2026
fe2e7e8
Preserve Stream retries and async cleanup
moetemp Nov 28, 2026
a1326a6
Merge the standalone Stream bindings
moetemp Nov 28, 2026
8cce7b3
Close owned replay iterators before shutdown
moetemp Nov 28, 2026
c450d7e
Update Core for replay failure delivery
moetemp Nov 28, 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 changelog/added/nonstretchable-jamie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Core: Stream metrics record Store calls by `stream_store` and failures by `failure_reason`. Live append and read counters exclude replay. Replay Store reads have separate `stream_replay_read_total`, `stream_replay_read_execution_failed`, `stream_replay_read_records` and `stream_replay_read_execution_latency` instruments.
3 changes: 3 additions & 0 deletions changelog/added/steady-stream-heron.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Add experimental Streams for client, Activity and Workflow code, with configurable Stores and append limits. `MemoryStreamStore` supports tests and local runs.
Add Workflow Stream reads and replay through `Replayer(stream_config=...)`. Replay reads Records from the Store again, so retention must cover later replays and queries.
Add `BufferedAppender` for client and Activity batching, plus `current_producer` and `as_producer` for Activity attempts.
1 change: 1 addition & 0 deletions changelog/changed/unhurried-replay-tortoise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A Workflow that starts on this version replays each Workflow Task separately, which keeps the grouping and the timestamps of the activations of its first run. A Workflow that started on an earlier version replays as before.
2 changes: 2 additions & 0 deletions changelog/fixed/blockier-mathias.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Core: A Workflow Stream read returns an unsupported-read error for a single Record over 16 MiB. New read markers preserve the Producer's optional timestamps and signed values during replay. Workers can still replay the original marker format, including previously delivered oversized Records. Older Workers cannot interpret the new digest format.
Core: Workflow replay now skips timed-out tasks consistently when a History page ends at the task start.
1 change: 1 addition & 0 deletions changelog/fixed/nonstretchable-jamie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Core: Workflow queries retain task results when replay needs another History page.
2 changes: 2 additions & 0 deletions changelog/fixed/patient-poll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Client and Activity Stream polling yields to asyncio between empty pages, including when the caller sets a zero wait.
Stream iterators resume from the last Record when a page omits its cursor.
1 change: 1 addition & 0 deletions changelog/fixed/punctual-puffin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`ActivityEnvironment` defaults to the Unix epoch for Activity timestamps in every time zone.
2 changes: 2 additions & 0 deletions changelog/fixed/sleepy-signal-finch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Prevent unawaited Workflow and Signal coroutines when an activation fails before their tasks start.
Close replay iterators when replay returns early so cleanup finishes before the event loop stops.
43 changes: 30 additions & 13 deletions scripts/gen_payload_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,38 @@
from temporalio.converter._payload_converter import _get_transfer_type_converter


def discover_system_nexus_roots() -> list[Descriptor]:
module_path = base_dir / "temporalio" / "nexus" / "system" / "workflow_service"
spec = spec_from_file_location(
"temporalio_nexus_system_workflow_service",
module_path / "__init__.py",
submodule_search_locations=[str(module_path)],
)
if spec is None or spec.loader is None:
raise RuntimeError(f"Cannot load generated system service from {module_path}")
module = module_from_spec(spec)
sys.modules[spec.name] = module
spec.loader.exec_module(module)
def discover_system_nexus_services() -> list[type]:
services: list[type] = []
system_dir = base_dir / "temporalio" / "nexus" / "system"
for module_path in sorted(path.parent for path in system_dir.glob("*/services.py")):
spec = spec_from_file_location(
f"temporalio_nexus_system_{module_path.name}",
module_path / "__init__.py",
submodule_search_locations=[str(module_path)],
)
if spec is None or spec.loader is None:
raise RuntimeError(
f"Cannot load generated system service from {module_path}"
)
module = module_from_spec(spec)
sys.modules[spec.name] = module
spec.loader.exec_module(module)
services.extend(
value
for value in vars(module.services).values()
if isinstance(value, type) and nexusrpc.get_service_definition(value)
)
return services


def discover_system_nexus_roots() -> list[Descriptor]:
roots: list[Descriptor] = []
for annotation in get_type_hints(module._services.WorkflowService).values():
annotations = [
annotation
for service in discover_system_nexus_services()
for annotation in get_type_hints(service).values()
]
for annotation in annotations:
if get_origin(annotation) is not nexusrpc.Operation:
continue
for operation_type in get_args(annotation):
Expand Down
76 changes: 76 additions & 0 deletions temporalio/bridge/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions temporalio/bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ temporalio-sdk-core = { version = "0.12.0", path = "./sdk-core/crates/sdk-core",
"ephemeral-server",
"envconfig",
"prometheus",
# Replay must retain the result groups of Stream create and describe Local Activities.
"disable_workflow_task_chunking",
] }
temporalio-streams = { version = "0.1.0", path = "./sdk-core/crates/streams" }
tokio = "1.26"
# Matches the sdk-core client crate's rustls stack; used to build the custom
# server certificate verifier for TLSConfig.verification_server_name.
Expand Down
91 changes: 91 additions & 0 deletions temporalio/bridge/_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,32 @@ async def _visit_coresdk_workflow_activation_ResolveNexusOperation(
if o.HasField("result"):
await self._visit_coresdk_nexus_NexusOperationResult(fs, o.result)

async def _visit_coresdk_workflow_activation_ResolveStreamAppend(
self, fs: VisitorFunctions, o: Any
):
if o.HasField("failed"):
await self._visit_temporal_api_failure_v1_Failure(fs, o.failed)

async def _visit_temporal_api_stream_v1_StreamRecord(
self, fs: VisitorFunctions, o: Any
):
if o.HasField("body"):
await self._visit_temporal_api_common_v1_Payload(fs, o.body)

async def _visit_coresdk_workflow_activation_StreamPage(
self, fs: VisitorFunctions, o: Any
):
for v in o.records:
await self._visit_temporal_api_stream_v1_StreamRecord(fs, v)

async def _visit_coresdk_workflow_activation_ResolveStreamRead(
self, fs: VisitorFunctions, o: Any
):
if o.HasField("page"):
await self._visit_coresdk_workflow_activation_StreamPage(fs, o.page)
elif o.HasField("failed"):
await self._visit_temporal_api_failure_v1_Failure(fs, o.failed)

async def _visit_coresdk_workflow_activation_WorkflowActivationJob(
self, fs: VisitorFunctions, o: Any
):
Expand Down Expand Up @@ -353,6 +379,14 @@ async def _visit_coresdk_workflow_activation_WorkflowActivationJob(
await self._visit_coresdk_workflow_activation_ResolveNexusOperation(
fs, o.resolve_nexus_operation
)
elif o.HasField("resolve_stream_append"):
await self._visit_coresdk_workflow_activation_ResolveStreamAppend(
fs, o.resolve_stream_append
)
elif o.HasField("resolve_stream_read"):
await self._visit_coresdk_workflow_activation_ResolveStreamRead(
fs, o.resolve_stream_read
)

async def _visit_coresdk_workflow_activation_WorkflowActivation(
self, fs: VisitorFunctions, o: Any
Expand Down Expand Up @@ -492,6 +526,11 @@ async def _visit_coresdk_workflow_commands_ScheduleNexusOperation(
if o.HasField("input"):
await self._visit_nexus_operation_input_payload(fs, o.input)

async def _visit_coresdk_workflow_commands_AppendToStream(
self, fs: VisitorFunctions, o: Any
):
await self._visit_payload_container(fs, o.bodies)

async def _visit_coresdk_workflow_commands_WorkflowCommand(
self, fs: VisitorFunctions, o: Any
):
Expand Down Expand Up @@ -551,6 +590,10 @@ async def _visit_coresdk_workflow_commands_WorkflowCommand(
await self._visit_coresdk_workflow_commands_ScheduleNexusOperation(
fs, o.schedule_nexus_operation
)
elif o.HasField("append_to_stream"):
await self._visit_coresdk_workflow_commands_AppendToStream(
fs, o.append_to_stream
)

async def _visit_coresdk_workflow_completion_Success(
self, fs: VisitorFunctions, o: Any
Expand Down Expand Up @@ -639,6 +682,54 @@ async def _visit_temporal_api_notificationservice_v1_OnCompleteResponse(
) -> None:
pass

async def _visit_temporal_api_sdk_v1_CreateStreamRequest(
self, fs: VisitorFunctions, o: Any
) -> None:
pass

async def _visit_temporal_api_sdk_v1_CreateStreamResponse(
self, fs: VisitorFunctions, o: Any
) -> None:
pass

async def _visit_temporal_api_stream_v1_AppendRecord(
self, fs: VisitorFunctions, o: Any
):
if o.HasField("body"):
await self._visit_temporal_api_common_v1_Payload(fs, o.body)

async def _visit_temporal_api_sdk_v1_AppendRecordsRequest(
self, fs: VisitorFunctions, o: Any
):
for v in o.records:
await self._visit_temporal_api_stream_v1_AppendRecord(fs, v)

async def _visit_temporal_api_streamservice_v1_AppendRecordsResponse(
self, fs: VisitorFunctions, o: Any
) -> None:
pass

async def _visit_temporal_api_sdk_v1_ReadRecordsRequest(
self, fs: VisitorFunctions, o: Any
) -> None:
pass

async def _visit_temporal_api_streamservice_v1_ReadRecordsResponse(
self, fs: VisitorFunctions, o: Any
):
for v in o.records:
await self._visit_temporal_api_stream_v1_StreamRecord(fs, v)

async def _visit_temporal_api_sdk_v1_DescribeStreamRequest(
self, fs: VisitorFunctions, o: Any
) -> None:
pass

async def _visit_temporal_api_streamservice_v1_DescribeStreamResponse(
self, fs: VisitorFunctions, o: Any
) -> None:
pass

async def _visit_temporal_api_common_v1_Header(self, fs: VisitorFunctions, o: Any):
for v in o.fields.values():
await self._visit_temporal_api_common_v1_Payload(fs, v)
Expand Down
Loading
Loading