Table of Contents

Interface IOrchestrationServiceClient

Namespace
DurableTask.Core
Assembly
DurableTask.Core.dll

Interface to allow creation of new task orchestrations and query their status.

public interface IOrchestrationServiceClient

Methods

CreateTaskOrchestrationAsync(TaskMessage)

Creates a new orchestration

Task CreateTaskOrchestrationAsync(TaskMessage creationMessage)

Parameters

creationMessage TaskMessage

Orchestration creation message

Returns

Task

Exceptions

OrchestrationAlreadyExistsException

Will throw an OrchestrationAlreadyExistsException exception If any orchestration with the same instance Id exists in the instance store.

CreateTaskOrchestrationAsync(TaskMessage, OrchestrationStatus[])

Creates a new orchestration and specifies a subset of states which should be de duplicated on in the client side

Task CreateTaskOrchestrationAsync(TaskMessage creationMessage, OrchestrationStatus[] dedupeStatuses)

Parameters

creationMessage TaskMessage

Orchestration creation message

dedupeStatuses OrchestrationStatus[]

States of previous orchestration executions to be considered while de-duping new orchestrations on the client

Returns

Task

Exceptions

OrchestrationAlreadyExistsException

Will throw an OrchestrationAlreadyExistsException exception If any orchestration with the same instance Id exists in the instance store and it has a status specified in dedupeStatuses.

ForceTerminateTaskOrchestrationAsync(string, string)

Forcefully terminate the specified orchestration instance

Task ForceTerminateTaskOrchestrationAsync(string instanceId, string reason)

Parameters

instanceId string

Instance to terminate

reason string

Reason for termination

Returns

Task

GetOrchestrationHistoryAsync(string, string)

Get a string dump of the execution history of the specified orchestration instance specified execution (generation) of the specified instance

Task<string> GetOrchestrationHistoryAsync(string instanceId, string executionId)

Parameters

instanceId string

Instance id

executionId string

Execution id

Returns

Task<string>

String with formatted JSON representing the execution history

GetOrchestrationStateAsync(string, bool)

Get a list of orchestration states from the instance storage for the most current execution (generation) of the specified instance.

Task<IList<OrchestrationState>> GetOrchestrationStateAsync(string instanceId, bool allExecutions)

Parameters

instanceId string

Instance id

allExecutions bool

True if method should fetch all executions of the instance, false if the method should only fetch the most recent execution

Returns

Task<IList<OrchestrationState>>

List of OrchestrationState objects that represents the list of orchestrations in the instance store

GetOrchestrationStateAsync(string, string)

Get a list of orchestration states from the instance storage for the specified execution (generation) of the specified instance.

Task<OrchestrationState> GetOrchestrationStateAsync(string instanceId, string executionId)

Parameters

instanceId string

Instance id

executionId string

Execution id

Returns

Task<OrchestrationState>

The OrchestrationState of the specified instanceId or null if not found

PurgeOrchestrationHistoryAsync(DateTime, OrchestrationStateTimeRangeFilterType)

Purges orchestration instance state and history for orchestrations older than the specified threshold time. Also purges the blob storage.

Task PurgeOrchestrationHistoryAsync(DateTime thresholdDateTimeUtc, OrchestrationStateTimeRangeFilterType timeRangeFilterType)

Parameters

thresholdDateTimeUtc DateTime

Threshold date time in UTC

timeRangeFilterType OrchestrationStateTimeRangeFilterType

What to compare the threshold date time against

Returns

Task

SendTaskOrchestrationMessageAsync(TaskMessage)

Send a new message for an orchestration

Task SendTaskOrchestrationMessageAsync(TaskMessage message)

Parameters

message TaskMessage

Message to send

Returns

Task

SendTaskOrchestrationMessageBatchAsync(params TaskMessage[])

Send a new set of messages for an orchestration

Task SendTaskOrchestrationMessageBatchAsync(params TaskMessage[] messages)

Parameters

messages TaskMessage[]

Messages to send

Returns

Task

WaitForOrchestrationAsync(string, string, TimeSpan, CancellationToken)

Wait for an orchestration to reach any terminal state within the given timeout

Task<OrchestrationState> WaitForOrchestrationAsync(string instanceId, string executionId, TimeSpan timeout, CancellationToken cancellationToken)

Parameters

instanceId string

Instance id of the orchestration

executionId string

Execution id of the orchestration

timeout TimeSpan

Maximum amount of time to wait

cancellationToken CancellationToken

Task cancellation token

Returns

Task<OrchestrationState>