Table of Contents

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, 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 ITemporalClient

Client used for workflow handle calls.

Id string

Workflow ID.

RunId string

Run 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 string

Run 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 string

Run 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 bool

Whether to follow runs until the latest workflow is reached.

rpcOptions RpcOptions

RPC 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).