Table of Contents

Class ITemporalClientExtensions

Namespace
Temporalio.Client
Assembly
Temporalio.dll

Extensions for ITemporalClient.

public static class ITemporalClientExtensions
Inheritance
ITemporalClientExtensions
Inherited Members

Methods

ExecuteUpdateWithStartWorkflowAsync(ITemporalClient, string, IReadOnlyCollection<object?>, WorkflowUpdateWithStartOptions)

Start an update using its name, possibly starting the workflow at the same time. Note that in some cases this call may fail but the workflow will still be started. This is a shortcut for StartUpdateWithStartWorkflowAsync(string, IReadOnlyCollection<object?>, WorkflowStartUpdateWithStartOptions) + GetResultAsync(RpcOptions?).

public static Task ExecuteUpdateWithStartWorkflowAsync(this ITemporalClient client, string update, IReadOnlyCollection<object?> args, WorkflowUpdateWithStartOptions options)

Parameters

client ITemporalClient

Client to use.

update string

Name of the update.

args IReadOnlyCollection<object>

Arguments for the update.

options WorkflowUpdateWithStartOptions

Update options.

Returns

Task

Completed update task.

Remarks

WARNING: Workflow update with start is experimental and APIs may change.

Exceptions

ArgumentException

Invalid run call or options.

WorkflowAlreadyStartedException

Workflow was already started according to ID reuse and conflict policy.

WorkflowUpdateFailedException

Workflow update failed, but the with-start operation still got a workflow handle.

RpcException

Server-side error.

ExecuteUpdateWithStartWorkflowAsync<TWorkflow>(ITemporalClient, Expression<Func<TWorkflow, Task>>, WorkflowUpdateWithStartOptions)

Start an update via a call to a WorkflowUpdate attributed method, possibly starting the workflow at the same time. Note that in some cases this call may fail but the workflow will still be started. This is a shortcut for StartUpdateWithStartWorkflowAsync<TWorkflow>(Expression<Func<TWorkflow, Task>>, WorkflowStartUpdateWithStartOptions) + GetResultAsync(RpcOptions?).

public static Task ExecuteUpdateWithStartWorkflowAsync<TWorkflow>(this ITemporalClient client, Expression<Func<TWorkflow, Task>> updateCall, WorkflowUpdateWithStartOptions options)

Parameters

client ITemporalClient

Client to use.

updateCall Expression<Func<TWorkflow, Task>>

Invocation of workflow update method.

options WorkflowUpdateWithStartOptions

Update options.

Returns

Task

Completed update task.

Type Parameters

TWorkflow

Workflow class type.

Remarks

WARNING: Workflow update with start is experimental and APIs may change.

Exceptions

ArgumentException

Invalid run call or options.

WorkflowAlreadyStartedException

Workflow was already started according to ID reuse and conflict policy.

WorkflowUpdateFailedException

Workflow update failed, but the with-start operation still got a workflow handle.

RpcException

Server-side error.

ExecuteUpdateWithStartWorkflowAsync<TUpdateResult>(ITemporalClient, string, IReadOnlyCollection<object?>, WorkflowUpdateWithStartOptions)

Start an update using its name, possibly starting the workflow at the same time. Note that in some cases this call may fail but the workflow will still be started. This is a shortcut for StartUpdateWithStartWorkflowAsync<TUpdateResult>(string, IReadOnlyCollection<object?>, WorkflowStartUpdateWithStartOptions) + GetResultAsync(RpcOptions?).

public static Task<TUpdateResult> ExecuteUpdateWithStartWorkflowAsync<TUpdateResult>(this ITemporalClient client, string update, IReadOnlyCollection<object?> args, WorkflowUpdateWithStartOptions options)

Parameters

client ITemporalClient

Client to use.

update string

Name of the update.

args IReadOnlyCollection<object>

Arguments for the update.

options WorkflowUpdateWithStartOptions

Update options.

Returns

Task<TUpdateResult>

Completed update task.

Type Parameters

TUpdateResult

Update result type.

Remarks

WARNING: Workflow update with start is experimental and APIs may change.

Exceptions

ArgumentException

Invalid run call or options.

WorkflowAlreadyStartedException

Workflow was already started according to ID reuse and conflict policy.

WorkflowUpdateFailedException

Workflow update failed, but the with-start operation still got a workflow handle.

RpcException

Server-side error.

ExecuteUpdateWithStartWorkflowAsync<TWorkflow, TUpdateResult>(ITemporalClient, Expression<Func<TWorkflow, Task<TUpdateResult>>>, WorkflowUpdateWithStartOptions)

Start an update via a call to a WorkflowUpdate attributed method, possibly starting the workflow at the same time. Note that in some cases this call may fail but the workflow will still be started. This is a shortcut for StartUpdateWithStartWorkflowAsync<TWorkflow, TUpdateResult>(Expression<Func<TWorkflow, Task<TUpdateResult>>>, WorkflowStartUpdateWithStartOptions) + GetResultAsync(RpcOptions?).

public static Task<TUpdateResult> ExecuteUpdateWithStartWorkflowAsync<TWorkflow, TUpdateResult>(this ITemporalClient client, Expression<Func<TWorkflow, Task<TUpdateResult>>> updateCall, WorkflowUpdateWithStartOptions options)

Parameters

client ITemporalClient

Client to use.

updateCall Expression<Func<TWorkflow, Task<TUpdateResult>>>

Invocation of workflow update method.

options WorkflowUpdateWithStartOptions

Update options.

Returns

Task<TUpdateResult>

Completed update task.

Type Parameters

TWorkflow

Workflow class type.

TUpdateResult

Update result type.

Remarks

WARNING: Workflow update with start is experimental and APIs may change.

Exceptions

ArgumentException

Invalid run call or options.

WorkflowAlreadyStartedException

Workflow was already started according to ID reuse and conflict policy.

WorkflowUpdateFailedException

Workflow update failed, but the with-start operation still got a workflow handle.

RpcException

Server-side error.

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.