Class WorkflowHandle<TWorkflow, TResult>
- Namespace
- Temporalio.Client
- Assembly
- Temporalio.dll
A workflow handle with a known workflow type and a known workflow result type.
public record WorkflowHandle<TWorkflow, TResult> : WorkflowHandle<TWorkflow>, IEquatable<WorkflowHandle>, IEquatable<WorkflowHandle<TWorkflow>>, IEquatable<WorkflowHandle<TWorkflow, TResult>>
Type Parameters
TWorkflow
Workflow class type.
TResult
Result type of the workflow.
- Inheritance
-
WorkflowHandle<TWorkflow>WorkflowHandle<TWorkflow, TResult>
- Implements
-
IEquatable<WorkflowHandle<TWorkflow>>IEquatable<WorkflowHandle<TWorkflow, TResult>>
- Inherited Members
Constructors
WorkflowHandle(ITemporalClient, string, string?, string?, string?)
A workflow handle with a known workflow type and a known workflow result 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, queries, and updates 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
GetResultAsync(bool, RpcOptions?)
Get the result of a workflow, deserializing into the known result type.
public Task<TResult> GetResultAsync(bool followRuns = true, RpcOptions? rpcOptions = null)
Parameters
followRuns
boolWhether to follow runs until the latest workflow is reached.
rpcOptions
RpcOptionsRPC options.
Returns
- Task<TResult>
Result of the workflow.
Exceptions
- WorkflowFailedException
Exception thrown for unsuccessful workflow result. The cause can be CanceledFailureException, TerminatedFailureException, TimeoutFailureException, or any exception deserialized that was thrown in the workflow (usually an ApplicationFailureException).