Class WorkflowHandle<TWorkflow>
- Namespace
- Temporalio.Client
- Assembly
- Temporalio.dll
A workflow handle with a known workflow type.
public record WorkflowHandle<TWorkflow> : WorkflowHandle, IEquatable<WorkflowHandle>, IEquatable<WorkflowHandle<TWorkflow>>
Type Parameters
TWorkflow
Workflow class type.
- Inheritance
-
WorkflowHandle<TWorkflow>
- Implements
-
IEquatable<WorkflowHandle<TWorkflow>>
- Derived
- Inherited Members
Constructors
WorkflowHandle(ITemporalClient, string, string?, string?, string?)
A workflow handle with a known workflow type.
public WorkflowHandle(ITemporalClient Client, string Id, string? RunId = null, string? ResultRunId = null, string? FirstExecutionRunId = null)
Parameters
Client
ITemporalClientClient used for workflow handle calls.
Id
stringWorkflow ID.
RunId
stringRun ID used for signals and queries if present to ensure a very specific run to call. This is only set when getting a workflow handle, not when starting a workflow.
ResultRunId
stringRun ID used for get result calls to ensure getting a result starting from this run. This is set the same as a run ID when getting a workflow handle. When starting a workflow, this is set as the resulting run ID.
FirstExecutionRunId
stringRun ID used for cancellation and termination to ensure they happen on a workflow starting with this run ID. This can be set when getting a workflow handle. When starting a workflow, this is set as the resulting run ID if no start signal was provided.
Methods
QueryAsync<TQueryResult>(Expression<Func<TWorkflow, TQueryResult>>, WorkflowQueryOptions?)
Query a workflow via a lambda that calls a WorkflowQuery attributed method or accesses a WorkflowQuery attributed property.
public Task<TQueryResult> QueryAsync<TQueryResult>(Expression<Func<TWorkflow, TQueryResult>> queryCall, WorkflowQueryOptions? options = null)
Parameters
queryCall
Expression<Func<TWorkflow, TQueryResult>>Invocation of a workflow query method or access of workflow query property.
options
WorkflowQueryOptionsExtra options.
Returns
- Task<TQueryResult>
Query result.
Type Parameters
TQueryResult
Query result type.
Exceptions
- WorkflowQueryFailedException
Query failed on worker.
- WorkflowQueryRejectedException
Query rejected by server based on rejection condition.
- RpcException
Server-side error.
SignalAsync(Expression<Func<TWorkflow, Task>>, WorkflowSignalOptions?)
Signal a workflow via a lambda call to a WorkflowSignal attributed method.
public Task SignalAsync(Expression<Func<TWorkflow, Task>> signalCall, WorkflowSignalOptions? options = null)
Parameters
signalCall
Expression<Func<TWorkflow, Task>>Invocation of a workflow signal method.
options
WorkflowSignalOptionsExtra options.
Returns
- Task
Signal completion task. Means signal was accepted, but may not have been processed by the workflow yet.
Exceptions
- RpcException
Server-side error.