Interface ITemporalClient
Interface to a client to Temporal.
Namespace: Temporalio.Client
Assembly: Temporalio.dll
Syntax
public interface ITemporalClient : IWorkerClient
Properties
Connection
Gets the connection associated with this client.
Declaration
ITemporalConnection Connection { get; }
Property Value
Type | Description |
---|---|
ITemporalConnection |
OutboundInterceptor
Gets the outbound interceptor in use.
Declaration
ClientOutboundInterceptor OutboundInterceptor { get; }
Property Value
Type | Description |
---|---|
ClientOutboundInterceptor |
Methods
GetWorkflowHandle(String, Nullable<String>, Nullable<String>)
Get a workflow handle for an existing workflow with unknown return type.
Declaration
WorkflowHandle GetWorkflowHandle(string id, string? runID = null, string? firstExecutionRunID = null)
Parameters
Type | Name | Description |
---|---|---|
String | id | ID of the workflow. |
Nullable<String> | runID | Run ID of the workflow or null for latest. |
Nullable<String> | firstExecutionRunID | Optional first execution ID used for cancellation and termination. |
Returns
Type | Description |
---|---|
WorkflowHandle | Created workflow handle. |
GetWorkflowHandle<TResult>(String, Nullable<String>, Nullable<String>)
Get a workflow handle for an existing workflow with known return type.
Declaration
WorkflowHandle<TResult> GetWorkflowHandle<TResult>(string id, string? runID = null, string? firstExecutionRunID = null)
Parameters
Type | Name | Description |
---|---|---|
String | id | ID of the workflow. |
Nullable<String> | runID | Run ID of the workflow or null for latest. |
Nullable<String> | firstExecutionRunID | Optional first execution ID used for cancellation and termination. |
Returns
Type | Description |
---|---|
WorkflowHandle<TResult> | Created workflow handle. |
Type Parameters
Name | Description |
---|---|
TResult | Result type of the workflow. |
StartWorkflowAsync(Func<Task>, WorkflowStartOptions)
Start a workflow with the given run method.
Declaration
Task<WorkflowHandle> StartWorkflowAsync(Func<Task> workflow, WorkflowStartOptions options)
Parameters
Type | Name | Description |
---|---|---|
Func<Task> | workflow | Workflow run method with no result or argument. |
WorkflowStartOptions | options | Start workflow options. ID and TaskQueue are required. |
Returns
Type | Description |
---|---|
Task<WorkflowHandle> | Workflow handle for the started workflow. |
Exceptions
Type | Condition |
---|---|
WorkflowAlreadyStartedException | Workflow was already started according to ID reuse policy. |
RpcException | Server-side error. |
StartWorkflowAsync(String, IReadOnlyCollection<Nullable<Object>>, WorkflowStartOptions)
Start a workflow with the given run method.
Declaration
Task<WorkflowHandle> StartWorkflowAsync(string workflow, IReadOnlyCollection<object?> args, WorkflowStartOptions options)
Parameters
Type | Name | Description |
---|---|---|
String | workflow | Workflow type name. |
IReadOnlyCollection<Nullable<Object>> | args | Arguments for the workflow. |
WorkflowStartOptions | options | Start workflow options. ID and TaskQueue are required. |
Returns
Type | Description |
---|---|
Task<WorkflowHandle> | Workflow handle for the started workflow. |
Exceptions
Type | Condition |
---|---|
WorkflowAlreadyStartedException | Workflow was already started according to ID reuse policy. |
RpcException | Server-side error. |
StartWorkflowAsync<T>(Func<T, Task>, T, WorkflowStartOptions)
Start a workflow with the given run method.
Declaration
Task<WorkflowHandle> StartWorkflowAsync<T>(Func<T, Task> workflow, T arg, WorkflowStartOptions options)
Parameters
Type | Name | Description |
---|---|---|
Func<T, Task> | workflow | Workflow run method with an argument but no result. |
T | arg | Workflow argument. |
WorkflowStartOptions | options | Start workflow options. ID and TaskQueue are required. |
Returns
Type | Description |
---|---|
Task<WorkflowHandle> | Workflow handle for the started workflow. |
Type Parameters
Name | Description |
---|---|
T | Workflow argument type. |
Exceptions
Type | Condition |
---|---|
WorkflowAlreadyStartedException | Workflow was already started according to ID reuse policy. |
RpcException | Server-side error. |
StartWorkflowAsync<TResult>(Func<Task<TResult>>, WorkflowStartOptions)
Start a workflow with the given run method.
Declaration
Task<WorkflowHandle<TResult>> StartWorkflowAsync<TResult>(Func<Task<TResult>> workflow, WorkflowStartOptions options)
Parameters
Type | Name | Description |
---|---|---|
Func<Task<TResult>> | workflow | Workflow run method with a result but no argument. |
WorkflowStartOptions | options | Start workflow options. ID and TaskQueue are required. |
Returns
Type | Description |
---|---|
Task<WorkflowHandle<TResult>> | Workflow handle for the started workflow. |
Type Parameters
Name | Description |
---|---|
TResult | Workflow result type. |
Exceptions
Type | Condition |
---|---|
WorkflowAlreadyStartedException | Workflow was already started according to ID reuse policy. |
RpcException | Server-side error. |
StartWorkflowAsync<TResult>(String, IReadOnlyCollection<Nullable<Object>>, WorkflowStartOptions)
Start a workflow with the given run method.
Declaration
Task<WorkflowHandle<TResult>> StartWorkflowAsync<TResult>(string workflow, IReadOnlyCollection<object?> args, WorkflowStartOptions options)
Parameters
Type | Name | Description |
---|---|---|
String | workflow | Workflow type name. |
IReadOnlyCollection<Nullable<Object>> | args | Arguments for the workflow. |
WorkflowStartOptions | options | Start workflow options. ID and TaskQueue are required. |
Returns
Type | Description |
---|---|
Task<WorkflowHandle<TResult>> | Workflow handle for the started workflow. |
Type Parameters
Name | Description |
---|---|
TResult | Result type that will be set on the handle. |
Exceptions
Type | Condition |
---|---|
WorkflowAlreadyStartedException | Workflow was already started according to ID reuse policy. |
RpcException | Server-side error. |
StartWorkflowAsync<T, TResult>(Func<T, Task<TResult>>, T, WorkflowStartOptions)
Start a workflow with the given run method.
Declaration
Task<WorkflowHandle<TResult>> StartWorkflowAsync<T, TResult>(Func<T, Task<TResult>> workflow, T arg, WorkflowStartOptions options)
Parameters
Type | Name | Description |
---|---|---|
Func<T, Task<TResult>> | workflow | Workflow run method with a result and argument. |
T | arg | Workflow argument. |
WorkflowStartOptions | options | Start workflow options. ID and TaskQueue are required. |
Returns
Type | Description |
---|---|
Task<WorkflowHandle<TResult>> | Workflow handle for the started workflow. |
Type Parameters
Name | Description |
---|---|
T | Workflow argument type. |
TResult | Workflow result type. |
Exceptions
Type | Condition |
---|---|
WorkflowAlreadyStartedException | Workflow was already started according to ID reuse policy. |
RpcException | Server-side error. |