IWorkflowClient.StreamAsync Method

Definition

Overloads

Name Description
StreamAsync(Workflow, String, String, CancellationToken)

Starts a workflow with string input and returns a streaming handle to watch events in real-time.

StreamAsync<TInput>(Workflow, TInput, String, CancellationToken)

Starts a workflow and returns a streaming handle to watch events in real-time.

StreamAsync(Workflow, String, String, CancellationToken)

Starts a workflow with string input and returns a streaming handle to watch events in real-time.

public System.Threading.Tasks.ValueTask<Microsoft.Agents.AI.DurableTask.Workflows.IStreamingWorkflowRun> StreamAsync(Microsoft.Agents.AI.Workflows.Workflow workflow, string input, string? runId = default, System.Threading.CancellationToken cancellationToken = default);
abstract member StreamAsync : Microsoft.Agents.AI.Workflows.Workflow * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.Agents.AI.DurableTask.Workflows.IStreamingWorkflowRun>
Public Function StreamAsync (workflow As Workflow, input As String, Optional runId As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of IStreamingWorkflowRun)

Parameters

workflow
Workflow

The workflow to execute.

input
String

The string input to pass to the workflow.

runId
String

Optional identifier for the run. If not provided, a new ID will be generated.

cancellationToken
CancellationToken

A cancellation token to observe.

Returns

An IStreamingWorkflowRun that can be used to stream workflow events.

Applies to

StreamAsync<TInput>(Workflow, TInput, String, CancellationToken)

Starts a workflow and returns a streaming handle to watch events in real-time.

public System.Threading.Tasks.ValueTask<Microsoft.Agents.AI.DurableTask.Workflows.IStreamingWorkflowRun> StreamAsync<TInput>(Microsoft.Agents.AI.Workflows.Workflow workflow, TInput input, string? runId = default, System.Threading.CancellationToken cancellationToken = default);
abstract member StreamAsync : Microsoft.Agents.AI.Workflows.Workflow * 'Input * string * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.Agents.AI.DurableTask.Workflows.IStreamingWorkflowRun>
Public Function StreamAsync(Of TInput) (workflow As Workflow, input As TInput, Optional runId As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of IStreamingWorkflowRun)

Type Parameters

TInput

The type of the input to the workflow.

Parameters

workflow
Workflow

The workflow to execute.

input
TInput

The input to pass to the workflow's starting executor.

runId
String

Optional identifier for the run. If not provided, a new ID will be generated.

cancellationToken
CancellationToken

A cancellation token to observe.

Returns

An IStreamingWorkflowRun that can be used to stream workflow events.

Applies to