InProcessExecution.RunAsync Method

Definition

Overloads

Name Description
RunAsync<TInput>(Workflow, TInput, String, CancellationToken)

Initiates a non-streaming execution of the workflow with the specified input.

RunAsync<TInput>(Workflow, TInput, CheckpointManager, String, CancellationToken)

Initiates a non-streaming execution of the workflow with the specified input, with checkpointing.

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

Initiates a non-streaming execution of the workflow with the specified input.

public static System.Threading.Tasks.ValueTask<Microsoft.Agents.AI.Workflows.Run> RunAsync<TInput>(Microsoft.Agents.AI.Workflows.Workflow workflow, TInput input, string? sessionId = default, System.Threading.CancellationToken cancellationToken = default);
static member RunAsync : Microsoft.Agents.AI.Workflows.Workflow * 'Input * string * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.Agents.AI.Workflows.Run>
Public Shared Function RunAsync(Of TInput) (workflow As Workflow, input As TInput, Optional sessionId As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Run)

Type Parameters

TInput

The type of input accepted by the workflow. Must be non-nullable.

Parameters

workflow
Workflow

The workflow to be executed. Must not be null.

input
TInput

The input message to be processed as part of the run.

sessionId
String

An optional unique identifier for the session. If not provided, a new identifier will be generated.

cancellationToken
CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

Returns

A ValueTask<TResult> that represents the asynchronous operation. The result contains a Run for managing and interacting with the streaming run.

Remarks

The workflow will run until its first halt, and the returned Run will capture all outgoing events. Use the Run instance to resume execution with responses to outgoing events.

Applies to

RunAsync<TInput>(Workflow, TInput, CheckpointManager, String, CancellationToken)

Initiates a non-streaming execution of the workflow with the specified input, with checkpointing.

public static System.Threading.Tasks.ValueTask<Microsoft.Agents.AI.Workflows.Run> RunAsync<TInput>(Microsoft.Agents.AI.Workflows.Workflow workflow, TInput input, Microsoft.Agents.AI.Workflows.CheckpointManager checkpointManager, string? sessionId = default, System.Threading.CancellationToken cancellationToken = default);
static member RunAsync : Microsoft.Agents.AI.Workflows.Workflow * 'Input * Microsoft.Agents.AI.Workflows.CheckpointManager * string * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.Agents.AI.Workflows.Run>
Public Shared Function RunAsync(Of TInput) (workflow As Workflow, input As TInput, checkpointManager As CheckpointManager, Optional sessionId As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Run)

Type Parameters

TInput

The type of input accepted by the workflow. Must be non-nullable.

Parameters

workflow
Workflow

The workflow to be executed. Must not be null.

input
TInput

The input message to be processed as part of the run.

checkpointManager
CheckpointManager

The CheckpointManager to use with this run.

sessionId
String

An optional unique identifier for the session. If not provided, a new identifier will be generated.

cancellationToken
CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

Returns

A ValueTask<TResult> that represents the asynchronous operation. The result contains a Run for managing and interacting with the streaming run.

Remarks

The workflow will run until its first halt, and the returned Run will capture all outgoing events. Use the Run instance to resume execution with responses to outgoing events.

Applies to