IWorkflowClient.RunAsync Method

Definition

Overloads

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

Runs a workflow with string input and returns a handle to monitor its execution.

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

Runs a workflow and returns a handle to monitor its execution.

RunAsync(Workflow, String, String, CancellationToken)

Runs a workflow with string input and returns a handle to monitor its execution.

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

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 IWorkflowRun that can be used to monitor the workflow execution.

Applies to

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

Runs a workflow and returns a handle to monitor its execution.

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

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 IWorkflowRun that can be used to monitor the workflow execution.

Applies to