Interface ITemporalClient
- Namespace
- Temporalio.Client
- Assembly
- Temporalio.dll
Interface to a client to Temporal.
public interface ITemporalClient : IWorkerClient
- Inherited Members
- Extension Methods
Properties
Connection
Gets the connection associated with this client.
ITemporalConnection Connection { get; }
Property Value
- See Also
OutboundInterceptor
Gets the outbound interceptor in use.
ClientOutboundInterceptor OutboundInterceptor { get; }
Property Value
- See Also
Methods
CreateScheduleAsync(string, Schedule, ScheduleOptions?)
Create a schedule and return its handle.
Task<ScheduleHandle> CreateScheduleAsync(string scheduleID, Schedule schedule, ScheduleOptions? options = null)
Parameters
scheduleID
stringUnique ID for the schedule.
schedule
ScheduleSchedule to create.
options
ScheduleOptionsOptions for creating the schedule.
Returns
- Task<ScheduleHandle>
Handle to the created schedule.
Remarks
This can throw ScheduleAlreadyRunningException if the ID already exists.
- See Also
GetAsyncActivityHandle(byte[])
Get a handle to complete an activity asynchronously using its task token.
AsyncActivityHandle GetAsyncActivityHandle(byte[] taskToken)
Parameters
taskToken
byte[]Task token for the activity.
Returns
- AsyncActivityHandle
Async activity handle.
- See Also
GetAsyncActivityHandle(string, string, string)
Get a handle to complete an activity asynchronously using its qualified identifiers.
AsyncActivityHandle GetAsyncActivityHandle(string workflowID, string runID, string activityID)
Parameters
workflowID
stringID for the activity's workflow.
runID
stringRun ID for the activity's workflow.
activityID
stringID for the activity.
Returns
- AsyncActivityHandle
Async activity handle.
- See Also
GetScheduleHandle(string)
Gets the schedule handle for the given ID.
ScheduleHandle GetScheduleHandle(string scheduleID)
Parameters
scheduleID
stringSchedule ID to get the handle for.
Returns
- ScheduleHandle
Schedule handle.
- See Also
GetWorkflowHandle(string, string?, string?)
Get a workflow handle for an existing workflow with unknown return type.
WorkflowHandle GetWorkflowHandle(string id, string? runID = null, string? firstExecutionRunID = null)
Parameters
id
stringID of the workflow.
runID
stringRun ID of the workflow or null for latest.
firstExecutionRunID
stringOptional first execution ID used for cancellation and termination.
Returns
- WorkflowHandle
Created workflow handle.
- See Also
GetWorkflowHandle<TWorkflow>(string, string?, string?)
Get a workflow handle for an existing workflow with known type.
WorkflowHandle<TWorkflow> GetWorkflowHandle<TWorkflow>(string id, string? runID = null, string? firstExecutionRunID = null)
Parameters
id
stringID of the workflow.
runID
stringRun ID of the workflow or null for latest.
firstExecutionRunID
stringOptional first execution ID used for cancellation and termination.
Returns
- WorkflowHandle<TWorkflow>
Created workflow handle.
Type Parameters
TWorkflow
Workflow class type.
- See Also
GetWorkflowHandle<TWorkflow, TResult>(string, string?, string?)
Get a workflow handle for an existing workflow with known type and return type.
WorkflowHandle<TWorkflow, TResult> GetWorkflowHandle<TWorkflow, TResult>(string id, string? runID = null, string? firstExecutionRunID = null)
Parameters
id
stringID of the workflow.
runID
stringRun ID of the workflow or null for latest.
firstExecutionRunID
stringOptional first execution ID used for cancellation and termination.
Returns
- WorkflowHandle<TWorkflow, TResult>
Created workflow handle.
Type Parameters
TWorkflow
Workflow class type.
TResult
Result type of the workflow.
- See Also
ListSchedulesAsync(ScheduleListOptions?)
List schedules.
IAsyncEnumerable<ScheduleListDescription> ListSchedulesAsync(ScheduleListOptions? options = null)
Parameters
options
ScheduleListOptionsOptions for the list call.
Returns
- IAsyncEnumerable<ScheduleListDescription>
Async enumerator for the schedules.
- See Also
ListWorkflowsAsync(string, WorkflowListOptions?)
List workflows with the given query.
IAsyncEnumerable<WorkflowExecution> ListWorkflowsAsync(string query, WorkflowListOptions? options = null)
Parameters
query
stringQuery to use for filtering.
options
WorkflowListOptionsOptions for the list call.
Returns
- IAsyncEnumerable<WorkflowExecution>
Async enumerator for the workflows.
- See Also
StartWorkflowAsync(string, IReadOnlyCollection<object?>, WorkflowOptions)
Start a workflow by name.
Task<WorkflowHandle> StartWorkflowAsync(string workflow, IReadOnlyCollection<object?> args, WorkflowOptions options)
Parameters
workflow
stringWorkflow type name.
args
IReadOnlyCollection<object>Arguments for the workflow.
options
WorkflowOptionsStart workflow options. ID and TaskQueue are required.
Returns
- Task<WorkflowHandle>
Workflow handle for the started workflow.
Exceptions
- ArgumentException
Invalid options.
- WorkflowAlreadyStartedException
Workflow was already started according to ID reuse policy.
- RpcException
Server-side error.
- See Also
StartWorkflowAsync<TWorkflow>(Expression<Func<TWorkflow, Task>>, WorkflowOptions)
Start a workflow via lambda invoking the run method.
Task<WorkflowHandle<TWorkflow>> StartWorkflowAsync<TWorkflow>(Expression<Func<TWorkflow, Task>> workflowRunCall, WorkflowOptions options)
Parameters
workflowRunCall
Expression<Func<TWorkflow, Task>>Invocation of workflow run method with no result.
options
WorkflowOptionsStart workflow options. ID and TaskQueue are required.
Returns
- Task<WorkflowHandle<TWorkflow>>
Workflow handle for the started workflow.
Type Parameters
TWorkflow
Workflow class type.
Exceptions
- ArgumentException
Invalid run call or options.
- WorkflowAlreadyStartedException
Workflow was already started according to ID reuse policy.
- RpcException
Server-side error.
- See Also
StartWorkflowAsync<TWorkflow, TResult>(Expression<Func<TWorkflow, Task<TResult>>>, WorkflowOptions)
Start a workflow via lambda invoking the run method.
Task<WorkflowHandle<TWorkflow, TResult>> StartWorkflowAsync<TWorkflow, TResult>(Expression<Func<TWorkflow, Task<TResult>>> workflowRunCall, WorkflowOptions options)
Parameters
workflowRunCall
Expression<Func<TWorkflow, Task<TResult>>>Invocation of workflow run method with a result.
options
WorkflowOptionsStart workflow options. ID and TaskQueue are required.
Returns
- Task<WorkflowHandle<TWorkflow, TResult>>
Workflow handle for the started workflow.
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.
- RpcException
Server-side error.
- See Also