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
TWorkflowWorkflow class type.
TResultResult 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
ClientITemporalClientClient used for workflow handle calls.
IdstringWorkflow ID.
RunIdstringRun 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.
ResultRunIdstringRun 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.
FirstExecutionRunIdstringRun 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
followRunsboolWhether to follow runs until the latest workflow is reached.
rpcOptionsRpcOptionsRPC 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).