Skip to content

Add workflow-streams sample#470

Open
brianstrauch wants to merge 1 commit into
mainfrom
workflow-streams-sample
Open

Add workflow-streams sample#470
brianstrauch wants to merge 1 commit into
mainfrom
workflow-streams-sample

Conversation

@brianstrauch
Copy link
Copy Markdown
Member

Summary

  • Ports the five scenarios from samples-python/workflow_streams to TypeScript, using the experimental @temporalio/workflow-streams contrib package on the contrib/pubsub branch of sdk-typescript.
  • Scenarios: basic publish/subscribe with heterogeneous topics, reconnecting subscriber, external (non-Activity) publisher, bounded log via truncate(), and LLM token streaming with retry handling.
  • Workflow files import from @temporalio/workflow-streams/workflow; client/activity/runner files import from @temporalio/workflow-streams/client. The split keeps the workflow bundle free of crypto/@temporalio/activity/@temporalio/client.
  • Depends on the unpublished contrib package via a local `file:` link (`file:../../sdk-typescript/contrib/workflow-streams`). Should switch to a published `^1.17.x` range once the package ships to npm.

Test plan

  • `npm install`, `tsc --build`, `eslint .`, `prettier --check .` all clean
  • Workflow bundles compile (regression case for the contrib/pubsub split-entrypoints work)
  • Scenarios 1–4 run end-to-end against `temporal server start-dev` and produce output shaped like the Python sample
  • Scenario 5 verified end-to-end with `OPENAI_API_KEY` set; tokens stream, complete event terminates cleanly
  • Retry path for scenario 5 (kill LLM worker mid-stream, confirm ANSI rewind) — not exercised in CI; manual reproduction only

🤖 Generated with Claude Code

Ports the five scenarios from samples-python/workflow_streams to TypeScript,
using the @temporalio/workflow-streams contrib package (currently on the
contrib/pubsub branch of sdk-typescript). Covers basic publish/subscribe,
reconnecting subscriber, external (non-Activity) publisher, bounded log via
truncate(), and LLM token streaming with retry handling.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@brianstrauch brianstrauch requested a review from a team as a code owner May 22, 2026 20:35
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.

1 participant