Skip to content

Sample code for Workflow Streams#783

Merged
brianstrauch merged 6 commits into
mainfrom
workflow-streams
Jul 14, 2026
Merged

Sample code for Workflow Streams#783
brianstrauch merged 6 commits into
mainfrom
workflow-streams

Conversation

@brianstrauch

Copy link
Copy Markdown
Member

What was changed

Adds a workflowstreams sample demonstrating the experimental io.temporal:temporal-workflowstreams contrib module — a durable publish/subscribe log hosted inside a Temporal workflow. Mirrors the Go and Python workflow streams samples.

Five scenarios:

  1. Basic publish/subscribe — an order workflow and its activity publish to topics; a subscriber consumes both.
  2. Reconnecting subscriber — a new client resumes from a saved offset with no gaps or duplicates.
  3. External publisher — a hub workflow hosts the stream while an external client publishes into it.
  4. Truncating ticker — bounded history via truncation; a late subscriber is fast-forwarded past truncated entries.
  5. LLM token streaming — an activity republishes streaming OpenAI token deltas, with retry/rewind handling.

Also adds a CODEOWNERS entry and a unit test.

Note: depends on the unreleased temporal-workflowstreams module, so javaSDKVersion is pinned to 1.36.0-SNAPSHOT (published locally from the workflow-streams branch of sdk-java). Do not merge until a tagged SDK release ships and the pin is dropped.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@brianstrauch
brianstrauch requested review from a team, antmendoza and tsurdilo as code owners June 12, 2026 17:12
brianstrauch and others added 4 commits July 13, 2026 09:54
SDK main now publishes 1.37.0-SNAPSHOT, and snapshots moved from
oss.sonatype.org to central.sonatype.com when OSSRH was decommissioned.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Scenario 2 subscribes with a WorkflowStreamListener instead of iterating:
two order workflows are consumed concurrently on one shared executor
thread, with CompletionStage-based backpressure and done futures instead
of a parked thread per subscription. Later scenarios renumbered, and the
stale SDK snapshot note updated for the Central snapshots repository.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The temporal-workflowstreams module is now in the tagged 1.37.0 release
on Maven Central, so drop the -SNAPSHOT pin and the snapshots repository.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@brianstrauch
brianstrauch enabled auto-merge (squash) July 14, 2026 22:49
@brianstrauch
brianstrauch merged commit 08eae4d into main Jul 14, 2026
10 checks passed
@brianstrauch
brianstrauch deleted the workflow-streams branch July 14, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants