Table of Contents

Class ITemporalClientExtensions

Namespace
Temporalio.Client
Assembly
Temporalio.dll

Extensions for ITemporalClient.

public static class ITemporalClientExtensions
Inheritance
ITemporalClientExtensions
Inherited Members

Methods

ExecuteWorkflowAsync(ITemporalClient, string, IReadOnlyCollection<object?>, WorkflowOptions)

public static Task ExecuteWorkflowAsync(this ITemporalClient client, string workflow, IReadOnlyCollection<object?> args, WorkflowOptions options)

Parameters

client ITemporalClient

Client to use.

workflow string

Workflow type name.

args IReadOnlyCollection<object>

Arguments for the workflow.

options WorkflowOptions

Start workflow options. ID and TaskQueue are required.

Returns

Task

Workflow completion task.

Exceptions

ArgumentException

Invalid options.

WorkflowAlreadyStartedException

Workflow was already started according to ID reuse policy.

WorkflowFailedException

Workflow did not complete successfully.

RpcException

Server-side error.

ExecuteWorkflowAsync<TWorkflow>(ITemporalClient, Expression<Func<TWorkflow, Task>>, WorkflowOptions)

public static Task ExecuteWorkflowAsync<TWorkflow>(this ITemporalClient client, Expression<Func<TWorkflow, Task>> workflowRunCall, WorkflowOptions options)

Parameters

client ITemporalClient

Client to use.

workflowRunCall Expression<Func<TWorkflow, Task>>

Invocation of workflow run method without a result.

options WorkflowOptions

Start workflow options. ID and TaskQueue are required.

Returns

Task

Workflow result.

Type Parameters

TWorkflow

Workflow class type.

Exceptions

ArgumentException

Invalid run call or options.

WorkflowAlreadyStartedException

Workflow was already started according to ID reuse policy.

WorkflowFailedException

Workflow did not complete successfully.

RpcException

Server-side error.

ExecuteWorkflowAsync<TResult>(ITemporalClient, string, IReadOnlyCollection<object?>, WorkflowOptions)

public static Task<TResult> ExecuteWorkflowAsync<TResult>(this ITemporalClient client, string workflow, IReadOnlyCollection<object?> args, WorkflowOptions options)

Parameters

client ITemporalClient

Client to use.

workflow string

Workflow type name.

args IReadOnlyCollection<object>

Arguments for the workflow.

options WorkflowOptions

Start workflow options. ID and TaskQueue are required.

Returns

Task<TResult>

Workflow result.

Type Parameters

TResult

Result type that will be set on the handle.

Exceptions

ArgumentException

Invalid options.

WorkflowAlreadyStartedException

Workflow was already started according to ID reuse policy.

WorkflowFailedException

Workflow did not complete successfully.

RpcException

Server-side error.

ExecuteWorkflowAsync<TWorkflow, TResult>(ITemporalClient, Expression<Func<TWorkflow, Task<TResult>>>, WorkflowOptions)

public static Task<TResult> ExecuteWorkflowAsync<TWorkflow, TResult>(this ITemporalClient client, Expression<Func<TWorkflow, Task<TResult>>> workflowRunCall, WorkflowOptions options)

Parameters

client ITemporalClient

Client to use.

workflowRunCall Expression<Func<TWorkflow, Task<TResult>>>

Invocation of workflow run method with a result.

options WorkflowOptions

Start workflow options. ID and TaskQueue are required.

Returns

Task<TResult>

Workflow result.

Type Parameters

TWorkflow

Workflow class type.

TResult

Workflow result type.

Exceptions

ArgumentException

Invalid run call or options.

WorkflowAlreadyStartedException

Workflow was already started according to ID reuse policy.

WorkflowFailedException

Workflow did not complete successfully.

RpcException

Server-side error.

ListWorkflowHistoriesAsync(ITemporalClient, string, WorkflowListOptions?, WorkflowHistoryEventFetchOptions?)

public static IAsyncEnumerable<WorkflowHistory> ListWorkflowHistoriesAsync(this ITemporalClient client, string query, WorkflowListOptions? listOptions = null, WorkflowHistoryEventFetchOptions? historyFetchOptions = null)

Parameters

client ITemporalClient

Client to use.

query string

List query.

listOptions WorkflowListOptions

Options for the list call.

historyFetchOptions WorkflowHistoryEventFetchOptions

Options for each history fetch call.

Returns

IAsyncEnumerable<WorkflowHistory>

Async enumerable of histories.