Skip to content

Added the notification channel surface to the external-streams branch. - #25

Open
moedash wants to merge 6 commits into
moe/AI-198-ch-pyext-1-core-pinfrom
moe/AI-198-ch-pyext-2-channel-surface
Open

moedash wants to merge 6 commits into
moe/AI-198-ch-pyext-1-core-pinfrom
moe/AI-198-ch-pyext-2-channel-surface

Conversation

@moedash

@moedash moedash commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

This PR adds the notification channel surface to the external-streams branch, the same API the main SDK chain gets.

What changed?

  • temporalio.common.Execution and ExecutionType, so a call can name a workflow or a standalone activity as a channel's owner.
  • The five Client channel calls with execution= and the workflow_id= shorthand, ChannelAddress, ChannelDescription, the interceptor inputs and workflow.Notification.
  • workflow.subscribe_channel, workflow.linked_channel and ChannelSubscription.unsubscribe(). The runtime routes the notifications_received job to the handle of the matching kind and puts it with the Signals, so a task knows what woke it before anything resolves.
  • WorkflowExecutionDescription.channel_subscriptions with ChannelSubscriptionInfo.
  • The tests and the channel changelog entry.

Part of AI-198 (epic AI-37).

Why?

The external runtime will use channels as its wake transport, and a workflow on this branch should reach the same channels a main-SDK workflow does. The text matches the main chain line for line, so the eventual union has one copy of every channel symbol. Two spots differ by design. The runtime keeps a set of the channels it subscribed to and the ones linked to it, and drops a notification nobody asked for. Both are where the external runtime hooks in later. The test probe asks the server through Client.describe_channel which kinds it serves, so these tests don't depend on the external runtime.

How did you test it?

Link to a test plan if any -

  • Unit Tests
  • Staging
  • End to End Tests

poe lint is clean, and each commit type-checks on its own. The channel unit cases, the external stream, client and visitor suites, and the worker workflow suite pass on the dev server the fixtures start. Every case in test_channels.py passes with -E against a server built from the channel chain. That includes the workflow subscribe case, both linked-channel cases and the probe's linked answer.

A linked channel names its owner as an execution, a workflow or a standalone activity, so the client needs a typed value for it.
The five calls reach an independent channel or one linked to an execution. Polls return workflow.Notification, so the workflow side shares the type later.
The unit cases fake the service. The live cases skip unless -E names a server
that serves channels.
A workflow subscribes by command or listens on its linked channel, and Core hands the notifications over as a job. The handle routes them by kind and ends with unsubscribe().
Describe is how an operator sees what a run listens on and what is pending for it.
The unit cases drive the instance with hand-built activations. The live cases
skip unless -E names a channel server, and the linked ones ask the server
through the client which kinds it serves.
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