Skip to content

Is Workflow Streams intended as the message-queue bridge for PydanticAI's TemporalAgent event_stream_handler? #1661

Description

@Anjayg

Pydantic AI's Temporal docs state that Agent.run_stream()/run_stream_events()/iter() aren't supported inside a Temporal-backed run, and instead recommend an event_stream_handler on TemporalAgent, noting that getting events from the handler (running inside an activity) out to the workflow/frontend requires "an external system... like a message queue."
Question: Is Workflow Streams (temporalio.contrib.workflow_streams) the intended/recommended implementation of that "message queue" for this use case — i.e., publishing from within an event_stream_handler via WorkflowStreamClient.from_within_activity(), and having an external HTTP/API layer subscribe to the same workflow's stream to receive those events? Or is there a different pattern the SDK team recommends for bridging activity-side streaming output to an external consumer?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions