Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
5d6b1ef
Added the Activity owner to the stream service contract and tokens.
moetemp Oct 15, 2026
b10ac05
Served streams that a standalone Activity owns over Nexus.
moetemp Oct 15, 2026
e02fd1b
Merged dr25-attach-first-wait into dr28-activity-stream-idl.
moetemp Oct 15, 2026
744ea57
Merged dr28-activity-stream-idl into dr29-activity-stream-service.
moetemp Oct 15, 2026
666d2a1
Merged dr25-attach-first-wait into dr28-activity-stream-idl.
moetemp Oct 15, 2026
c0665db
Merged dr28-activity-stream-idl into dr29-activity-stream-service.
moetemp Oct 15, 2026
d64ce91
Merged dr25-attach-first-wait into dr28-activity-stream-idl.
moetemp Oct 15, 2026
583e76a
Merged dr28-activity-stream-idl into dr29-activity-stream-service.
moetemp Oct 15, 2026
d1b270d
Merged dr25-attach-first-wait into dr28-activity-stream-idl.
moetemp Oct 15, 2026
c53d233
Merged dr28-activity-stream-idl into dr29-activity-stream-service.
moetemp Oct 15, 2026
7d2129a
Served Workflow Activity streams over Nexus.
moetemp Oct 15, 2026
84df049
Merged dr25-attach-first-wait into dr28-activity-stream-idl.
moetemp Oct 15, 2026
f91dd76
Merged dr28-activity-stream-idl into dr29-activity-stream-service.
moetemp Oct 15, 2026
0722aa0
Merged dr29-activity-stream-service into dr34-wfa-stream-service.
moetemp Oct 15, 2026
751e38a
Merged dr25-attach-first-wait into dr28-activity-stream-idl.
moetemp Oct 15, 2026
3adac36
Merged dr28-activity-stream-idl into dr29-activity-stream-service.
moetemp Oct 15, 2026
8ad00e3
Merged dr29-activity-stream-service into dr34-wfa-stream-service.
moetemp Oct 15, 2026
330b4de
Merged dr25-attach-first-wait into dr28-activity-stream-idl.
moetemp Oct 15, 2026
6c0ab5b
Merged dr28-activity-stream-idl into dr29-activity-stream-service.
moetemp Oct 15, 2026
65363c1
Merged dr29-activity-stream-service into dr34-wfa-stream-service.
moetemp Oct 15, 2026
8066287
Merged dr25-attach-first-wait into dr28-activity-stream-idl.
moetemp Oct 16, 2026
216d12f
Merged dr28-activity-stream-idl into dr29-activity-stream-service.
moetemp Oct 16, 2026
3634dab
Merged dr29-activity-stream-service into dr34-wfa-stream-service.
moetemp Oct 16, 2026
3bd1400
Merged dr25-attach-first-wait into dr28-activity-stream-idl.
moetemp Oct 16, 2026
b61dffd
Merged dr28-activity-stream-idl into dr29-activity-stream-service.
moetemp Oct 16, 2026
9c28b60
Merged dr29-activity-stream-service into dr34-wfa-stream-service.
moetemp Oct 16, 2026
b5bf559
Merged dr25-attach-first-wait into dr28-activity-stream-idl.
moetemp Oct 16, 2026
660f535
Merged dr28-activity-stream-idl into dr29-activity-stream-service.
moetemp Oct 16, 2026
e52dbc6
Merged dr29-activity-stream-service into dr34-wfa-stream-service.
moetemp Oct 16, 2026
f1edae8
Merged dr25-attach-first-wait into dr28-activity-stream-idl.
moetemp Oct 16, 2026
1141d75
Merged dr25-attach-first-wait into dr28-activity-stream-idl.
moetemp Oct 16, 2026
c85988c
Merged dr28-activity-stream-idl into dr29-activity-stream-service.
moetemp Oct 16, 2026
340af0b
Merged dr29-activity-stream-service into dr34-wfa-stream-service.
moetemp Oct 16, 2026
c7b5a12
Merged dr25-attach-first-wait into dr28-activity-stream-idl.
moetemp Oct 16, 2026
3adcc1c
Merged dr28-activity-stream-idl into dr29-activity-stream-service.
moetemp Oct 16, 2026
4db0dca
Merged dr29-activity-stream-service into dr34-wfa-stream-service.
moetemp Oct 16, 2026
d46b70d
Merged dr25 into dr28.
moetemp Oct 16, 2026
3c367bb
Merged dr28 into dr29.
moetemp Oct 16, 2026
70e225a
Merged dr29 into dr34.
moetemp Oct 16, 2026
76c8a6e
Merged dr25 into dr28.
moetemp Oct 16, 2026
fd621f4
Merged dr28 into dr29.
moetemp Oct 16, 2026
e07c109
Merged dr29 into dr34.
moetemp Oct 16, 2026
07972bb
Merged dr25 into dr28.
moetemp Oct 16, 2026
04ef6fa
Merged dr28 into dr29.
moetemp Oct 16, 2026
9cfc83a
Merged dr29 into dr34.
moetemp Oct 16, 2026
61c51b3
Merged dr25 into dr34.
moetemp Oct 16, 2026
4f9f5cc
Merged dr25 into dr34.
moetemp Oct 16, 2026
da507da
Merged dr25 into dr34.
moetemp Oct 16, 2026
47a4e5e
Merged dr25 into dr34.
moetemp Oct 16, 2026
fe4d5eb
Merged dr25 into dr34.
moetemp Oct 16, 2026
942e7e6
Merged dr25 into dr34.
moetemp Oct 16, 2026
0c83933
Merged dr25 into dr34.
moetemp Oct 16, 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
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ message CodecWork {
repeated temporal.api.common.v1.Payload payloads = 4;
// Hand back in `NexusResumeRequest`. Core forgets a continuation 60 s after it asked.
uint64 continuation = 5;
// The kind of the stream's owner. For a standalone Activity owner, `workflow_id` is empty and
// `activity_id` names the Activity, and the codec context has the namespace and the Activity id
// only. For a Workflow Activity owner, both are set, and the codec context has the namespace,
// the Activity id and the Workflow id.
StreamOwnerKind owner_kind = 6;
string activity_id = 7;
}

message NexusResumeRequest {
Expand Down
20 changes: 20 additions & 0 deletions crates/sdk-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,26 @@ relevant information.
attempt that writes on after a newer one started reads as stale. Without the field the attempt
is the Temporal attempt as before. `testdata/streams/activity_attempts.json` in
`temporalio-streams` pins the formula for other SDKs.
* Experimental: the stream service contract's `StreamRef` gains the optional member
`activity_id`, and `kind` takes `"activity"`. An Activity's ref sends `workflow_id` as `""`,
and its `chain_run_id` is the Activity run. A stream operation token carries the kind and the
Activity id, keeps version 2, and leaves `activity_id` out of a Workflow's ref, so a Workflow's
token keeps its bytes. `operation_token_vectors.json` has Activity tokens. `CodecWork` gains
`owner_kind` and `activity_id`. The Nexus calls still refuse an Activity ref.
* Experimental: the stream service's Nexus calls serve streams that a standalone Activity owns.
`append`, `read`, `read_range`, `latest_only`, the floor holder, `AttachCaller` with
`wake_after_counter`, `DetachCaller` and the read-first wake all take an Activity ref. A read's
`wake_token` must name the read's owner kind, Workflow id, Activity id and topic, so a token of
one Activity never wakes another Activity's reader on the same topic. `CodecWork` names the
Activity, so lang's codec context is the namespace and the Activity id. A ref of kind
`activity` with a Workflow id, or of kind `workflow` with an Activity id, is a bad request.
* Experimental: the stream service contract and its Nexus calls serve Workflow Activity streams.
`StreamRef.kind` takes `"workflow_activity"`, with `workflow_id`, `activity_id` and the
scheduling run as `chain_run_id`, all required, and no new member. A stream operation token
carries the kind and the Activity id, keeps version 2, and its chain is the scheduling run.
Reads and replays keep the run, since it names the stream. A carried state must name that run.
A read's `wake_token` must also name the read's run for this kind. `CodecWork` names the
Workflow and the Activity. `operation_token_vectors.json` has Workflow Activity tokens.
* Experimental: the Activity attempt key is `started_unix_ms << 11 | min(attempt, 2047)`, so it
fits 53 bits and a JSON number holds it exactly. The Nexus contract's models and JavaScript
refused the earlier 16-bit form. A start time from May 2109 on is refused. The vector file
Expand Down
60 changes: 58 additions & 2 deletions crates/streams/nexus/operation_token_vectors.json

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

27 changes: 20 additions & 7 deletions crates/streams/nexus/temporal_streams.nexusrpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,29 @@ $defs:
kind:
type: string
description: >-
What owns the stream. Only "workflow" is opened in this release, and
a call with another kind is refused.
What owns the stream: "workflow", "activity" for a standalone
Activity, or "workflow_activity" for an Activity that a Workflow
run scheduled. A call with another kind is refused.
workflow_id:
type: string
description: "The owning Workflow."
description: >-
The owning Workflow, or for kind workflow_activity the Workflow that
scheduled the Activity. Empty for kind activity.
activity_id:
oneOf: [{ type: string }, { type: "null" }]
description: >-
The owning Activity, for kinds activity and workflow_activity. Absent
or null for kind workflow.
chain_run_id:
oneOf: [{ type: string }, { type: "null" }]
description: >-
Names the run chain that holds this run. Absent or null names the
Workflow id's newest chain. It never stops a read at this run: a
read follows the chain across Continue-as-New and ends with the
chain.
For kind workflow, names the run chain that holds this run. Absent
or null names the Workflow id's newest chain. It never stops a read
at this run: a read follows the chain across Continue-as-New and
ends with the chain. For kind activity, the Activity run. Absent or
null names the Activity id's newest run when the read starts. For
kind workflow_activity, the run that scheduled the Activity, which is
required, since an Activity id repeats in each run.
topic:
type: string
description: "The topic on the owner's stream."
Expand Down Expand Up @@ -421,5 +432,7 @@ $defs:
description: >-
The first run of the run chain the start attached to, so a cancel
detaches from it even after the Workflow id moved on to a new chain.
For an Activity owner, the Activity run. For a Workflow Activity
owner, the run that scheduled it.
required: [v, ref, attach, chain]
additionalProperties: false
14 changes: 12 additions & 2 deletions crates/streams/src/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,16 @@ impl Streams {
stream: &StreamAddress,
first_run_id: &str,
) -> StreamResult<()> {
if stream.owner_kind == StreamOwnerKind::WorkflowActivity as i32 {
// The address names the run that keys the stream, so no describe is needed.
if first_run_id != stream.run_id {
return Err(StreamError::cursor(format!(
"the read state names run {first_run_id:?}, which is not the run of {}",
owner_key(stream).label()
)));
}
return Ok(());
}
let key = OwnerKey {
run_id: first_run_id.to_string(),
..owner_key(stream)
Expand All @@ -498,8 +508,8 @@ impl Streams {
Ok(described) if described.first_run_id != first_run_id => {
return Err(StreamError::cursor(format!(
"the read state names run {first_run_id:?}, which doesn't start a run chain \
of Workflow {:?}",
stream.workflow_id
of {}",
key.label()
)));
}
// A chain Temporal no longer holds leaves nothing another chain's reader could
Expand Down
Loading
Loading