Share via


DurableTaskClient.WaitForInstanceCompletionAsync Method

Definition

Overloads

WaitForInstanceCompletionAsync(String, CancellationToken)

Waits for an orchestration to complete and returns a OrchestrationMetadata object that contains metadata about the started instance.

WaitForInstanceCompletionAsync(String, Boolean, CancellationToken)

Waits for an orchestration to complete and returns a OrchestrationMetadata object that contains metadata about the started instance.

WaitForInstanceCompletionAsync(String, CancellationToken)

Waits for an orchestration to complete and returns a OrchestrationMetadata object that contains metadata about the started instance.

public virtual System.Threading.Tasks.Task<Microsoft.DurableTask.Client.OrchestrationMetadata> WaitForInstanceCompletionAsync (string instanceId, System.Threading.CancellationToken cancellation);
abstract member WaitForInstanceCompletionAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.DurableTask.Client.OrchestrationMetadata>
override this.WaitForInstanceCompletionAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.DurableTask.Client.OrchestrationMetadata>
Public Overridable Function WaitForInstanceCompletionAsync (instanceId As String, cancellation As CancellationToken) As Task(Of OrchestrationMetadata)

Parameters

instanceId
String
cancellation
CancellationToken

Returns

Applies to

WaitForInstanceCompletionAsync(String, Boolean, CancellationToken)

Waits for an orchestration to complete and returns a OrchestrationMetadata object that contains metadata about the started instance.

public abstract System.Threading.Tasks.Task<Microsoft.DurableTask.Client.OrchestrationMetadata> WaitForInstanceCompletionAsync (string instanceId, bool getInputsAndOutputs = false, System.Threading.CancellationToken cancellation = default);
abstract member WaitForInstanceCompletionAsync : string * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.DurableTask.Client.OrchestrationMetadata>
Public MustOverride Function WaitForInstanceCompletionAsync (instanceId As String, Optional getInputsAndOutputs As Boolean = false, Optional cancellation As CancellationToken = Nothing) As Task(Of OrchestrationMetadata)

Parameters

instanceId
String

The unique ID of the orchestration instance to wait for.

getInputsAndOutputs
Boolean

Specify true to fetch the orchestration instance's inputs, outputs, and custom status, or false to omit them. The default value is false to minimize the network bandwidth, serialization, and memory costs associated with fetching the instance metadata.

cancellation
CancellationToken

A CancellationToken that can be used to cancel the wait operation.

Returns

Returns a OrchestrationMetadata record that describes the orchestration instance and its execution status or null if no instance with ID instanceId is found.

Remarks

A "completed" orchestration instance is any instance in one of the terminal states. For example, the Completed, Failed, or Terminated states.

Orchestrations are long-running and could take hours, days, or months before completing. Orchestrations can also be eternal, in which case they'll never complete unless terminated. In such cases, this call may block indefinitely, so care must be taken to ensure appropriate timeouts are enforced using the cancellation parameter.

If an orchestration instance is already complete when this method is called, the method will return immediately.

Applies to