AppSurface Search
API Reference

DurableTask

Type

IDurableTaskWorkerChainRunner<TWork, TResult, TProjection>

Source

Maps durable worker projection contract results into Durable Task-facing decisions.

Type Parameters

  • TWorkType of work carried by the chain.
  • TResultType of terminal execution result.
  • TProjectionType of visible projection repaired from terminal facts.

Remarks

The runner is an adapter, not a hosted runtime. It calls the app-owned projection contract and returns decisions for host-owned Durable Task orchestration code to interpret. It never invokes IDurableWorkerExecutor{TWork,TResult} from projection repair methods. The expected stage order is IDurableTaskWorkerChainRunner{TWork,TResult,TProjection}.TryClaimAsync before executor activity, IDurableTaskWorkerChainRunner{TWork,TResult,TProjection}.CompleteAsync after terminal executor activity, then IDurableTaskWorkerChainRunner{TWork,TResult,TProjection}.ReconcileProjectionAsync for visible-state repair. Retry policies carried by decisions are advisory metadata; hosts translate them into Durable Task retry options, timers, or activity scheduling behavior.

Method

TryClaimAsync

ValueTask<DurableTaskWorkerDecision<TWork, TResult, TProjection>> TryClaimAsync(IDurableWorkerProjectionContract<TWork, TResult, TProjection> contract, TWork work, DurableWorkerCorrelation correlation, CancellationToken cancellationToken = default) Source

Attempts to claim work and maps the claim result to a Durable Task-facing decision.

Parameters

  • contractApp-owned projection contract.
  • workTyped work payload.
  • correlationCorrelation identifiers for the claim.
  • cancellationTokenToken that cancels the claim.

Returns

A durable decision. Valid claim outcomes are claimed, already-completed, noop, stale-fence, conflict, and unrecoverable. Claimed schedules executor activity; duplicate, noop, stale, and failure outcomes do not.

Method

CompleteAsync

ValueTask<DurableTaskWorkerDecision<TWork, TResult, TProjection>> CompleteAsync(IDurableWorkerProjectionContract<TWork, TResult, TProjection> contract, TWork work, TResult result, DurableWorkerCorrelation correlation, CancellationToken cancellationToken = default) Source

Records completion and maps the terminal fact to projection repair or terminal decisions.

Parameters

  • contractApp-owned projection contract.
  • workTyped work payload.
  • resultTerminal result produced by executor activity.
  • correlationCorrelation identifiers for the completion fact.
  • cancellationTokenToken that cancels completion recording.

Returns

A durable decision. Valid completion outcomes are completed, already-completed, noop, stale-fence, conflict, and unrecoverable. Fresh completion schedules projection repair; duplicate and noop completion do not.

Method

ReconcileProjectionAsync

ValueTask<DurableTaskWorkerDecision<TWork, TResult, TProjection>> ReconcileProjectionAsync(IDurableWorkerProjectionContract<TWork, TResult, TProjection> contract, TWork work, TResult result, DurableWorkerCorrelation correlation, CancellationToken cancellationToken = default) Source

Repairs projection state from a terminal fact and maps the result to a Durable Task-facing decision.

Parameters

  • contractApp-owned projection contract.
  • workTyped work payload associated with the terminal fact.
  • resultTerminal result used to repair projection state.
  • correlationCorrelation identifiers for the repair attempt.
  • cancellationTokenToken that cancels projection repair.

Returns

A durable decision. Valid projection outcomes are reconciled, noop, stale-fence, conflict, and unrecoverable. Reconciled carries a projection payload; noop completes without a projection payload; projection repair never maps to executor scheduling.

Method

WaitForExternalEvent

DurableTaskWorkerDecision<TWork, TResult, TProjection> WaitForExternalEvent(DurableWorkerCorrelation correlation, string eventName, FlowTimeout? timeout = null) Source

Creates an external-event wait decision for host-owned Durable Task orchestration code.

Parameters

  • correlationCorrelation identifiers for the wait.
  • eventNameExternal event name expected by the host.
  • timeoutOptional durable timeout metadata.

Returns

A wait-for-external-event decision.

Method

TimedOut

DurableTaskWorkerDecision<TWork, TResult, TProjection> TimedOut(DurableWorkerCorrelation correlation, string eventName, DurableWorkerDiagnostic? diagnostic = null) Source

Creates a timeout decision for a wait branch that expired.

Parameters

  • correlationCorrelation identifiers for the timed-out wait.
  • eventNameExternal event name whose wait expired.
  • diagnosticOptional safe diagnostic details.

Returns

A timed-out decision.

Method

IgnoreLateSignal

DurableTaskWorkerDecision<TWork, TResult, TProjection> IgnoreLateSignal(DurableWorkerCorrelation correlation, string eventName, DurableWorkerDiagnostic? diagnostic = null) Source

Creates a stale or late signal decision without scheduling additional work.

Parameters

  • correlationCorrelation identifiers for the stale signal.
  • eventNameExternal event name associated with the stale signal.
  • diagnosticOptional safe diagnostic details.

Returns

An ignore-late-signal decision.

Exceptions

  • ArgumentExceptionThrown when eventName is null, empty, or whitespace.
  • ArgumentNullExceptionThrown when correlation is null.
Type

DurableTaskWorkerChainRunner<TWork, TResult, TProjection>

Source

Default implementation of IDurableTaskWorkerChainRunner{TWork,TResult,TProjection}.

Type Parameters

  • TWorkType of work carried by the chain.
  • TResultType of terminal execution result.
  • TProjectionType of visible projection repaired from terminal facts.
Type

AppSurfaceWorkersDurableTaskOptions

Source

Configures the passive Durable Task worker adapter.

Remarks

Options describe retry intent for host-owned Durable Task activity scheduling. They do not register workers, create storage providers, or execute retries by themselves.

Property

ExecutorRetryPolicy

FlowRetryPolicy? ExecutorRetryPolicy { get; set; } Source

Gets or sets the retry policy attached to executor scheduling decisions.

Remarks

Hosts translate this value into Durable Task activity retry options when a claim maps to DurableTaskWorkerDecisionKind.ScheduleExecutor.

Property

ProjectionRetryPolicy

FlowRetryPolicy? ProjectionRetryPolicy { get; set; } Source

Gets or sets the retry policy attached to projection repair scheduling decisions.

Remarks

Hosts translate this value into Durable Task activity retry options when a completion maps to DurableTaskWorkerDecisionKind.RepairProjection.

Type

AppSurfaceWorkersDurableTaskModule

Source

Registers the passive AppSurface Workers Durable Task adapter boundary.

Remarks

The module depends on AppSurface Workers and Flow DurableTask, registers decision-mapping services, and leaves Durable Task worker/client hosting, storage providers, endpoints, authentication, and background services to the application.

Type

DurableTaskWorkerDecision<TWork, TResult, TProjection>

Source

Durable Task-facing decision produced by the worker adapter.

Type Parameters

  • TWorkType of work carried by the chain.
  • TResultType of terminal execution result.
  • TProjectionType of visible projection repaired from terminal facts.

Remarks

Decisions are passive instructions for host-owned orchestration code. They do not schedule activities, persist state, create timers, deliver external events, or own Durable Task worker/client setup.

Method

ScheduleExecutor

DurableTaskWorkerDecision<TWork, TResult, TProjection> ScheduleExecutor(DurableWorkerEnvelope<TWork> claim, FlowRetryPolicy? retryPolicy = null) Source

Creates an executor scheduling decision for a claimed work item.

Parameters

  • claimClaim envelope that authorized executor scheduling.
  • retryPolicyOptional retry policy for executor activity.

Returns

A schedule-executor decision.

Exceptions

  • ArgumentExceptionThrown when claim is not a claimed outcome.
  • ArgumentNullExceptionThrown when claim is null.
Method

WaitForExternalEvent

DurableTaskWorkerDecision<TWork, TResult, TProjection> WaitForExternalEvent(DurableWorkerCorrelation correlation, string eventName, FlowTimeout? timeout = null) Source

Creates an external-event wait decision.

Parameters

  • correlationCorrelation identifiers for the wait.
  • eventNameExternal event name expected by host orchestration code.
  • timeoutOptional durable timeout for the wait.

Returns

A wait-for-external-event decision.

Exceptions

  • ArgumentExceptionThrown when eventName is null, empty, or whitespace.
  • ArgumentNullExceptionThrown when correlation is null.
Method

RepairProjection

DurableTaskWorkerDecision<TWork, TResult, TProjection> RepairProjection(DurableWorkerEnvelope<TResult> completion, FlowRetryPolicy? retryPolicy = null) Source

Creates a projection repair scheduling decision from a completion envelope.

Parameters

  • completionCompletion envelope that recorded a terminal fact.
  • retryPolicyOptional retry policy for projection repair activity.

Returns

A repair-projection decision.

Exceptions

  • ArgumentExceptionThrown when completion is not a completed outcome.
  • ArgumentNullExceptionThrown when completion is null.
Method

Complete

DurableTaskWorkerDecision<TWork, TResult, TProjection> Complete<TPayload>(DurableWorkerEnvelope<TPayload> envelope) Source

Creates a complete decision from a worker envelope without carrying a projection payload.

Type Parameters

  • TPayloadEnvelope payload type.

Parameters

  • envelopeEnvelope that completed the worker chain.

Returns

A complete decision.

Exceptions

  • ArgumentNullExceptionThrown when envelope is null.
Method

CompleteProjection

DurableTaskWorkerDecision<TWork, TResult, TProjection> CompleteProjection(DurableWorkerEnvelope<TProjection> envelope) Source

Creates a complete decision from a reconciled projection envelope.

Parameters

  • envelopeProjection envelope produced by projection repair.

Returns

A complete decision that carries the repaired projection.

Exceptions

  • ArgumentExceptionThrown when envelope is not a reconciled outcome.
  • ArgumentNullExceptionThrown when envelope is null.
Method

Fault

DurableTaskWorkerDecision<TWork, TResult, TProjection> Fault<TPayload>(DurableWorkerEnvelope<TPayload> envelope) Source

Creates a fault decision from a worker envelope.

Type Parameters

  • TPayloadEnvelope payload type.

Parameters

  • envelopeEnvelope that faulted the worker chain.

Returns

A fault decision.

Exceptions

  • ArgumentNullExceptionThrown when envelope is null.
Method

IgnoreLateSignal

DurableTaskWorkerDecision<TWork, TResult, TProjection> IgnoreLateSignal<TPayload>(DurableWorkerEnvelope<TPayload> envelope, string? eventName = null) Source

Creates a late-signal decision from a worker envelope.

Type Parameters

  • TPayloadEnvelope payload type.

Parameters

  • envelopeEnvelope that identified a stale signal or fence.
  • eventNameOptional event name associated with the stale signal.

Returns

An ignore-late-signal decision.

Exceptions

  • ArgumentNullExceptionThrown when envelope is null.
Method

WaitForRetry

DurableTaskWorkerDecision<TWork, TResult, TProjection> WaitForRetry<TPayload>(DurableWorkerEnvelope<TPayload> envelope, FlowRetryPolicy? retryPolicy = null) Source

Creates a retry wait decision from a worker envelope.

Type Parameters

  • TPayloadEnvelope payload type.

Parameters

  • envelopeRetryable envelope that should wait before retry.
  • retryPolicyOptional retry policy that explains host retry intent. When null, the host chooses its default retry or timer behavior.

Returns

A wait-for-retry decision.

Exceptions

  • ArgumentExceptionThrown when envelope is not retryable.
  • ArgumentNullExceptionThrown when envelope is null.
Method

TimedOut

DurableTaskWorkerDecision<TWork, TResult, TProjection> TimedOut(DurableWorkerCorrelation correlation, string eventName, DurableWorkerDiagnostic? diagnostic = null) Source

Creates a timeout decision for a wait branch that has expired.

Parameters

  • correlationCorrelation identifiers for the timed-out wait.
  • eventNameExternal event name whose wait timed out.
  • diagnosticOptional safe diagnostic details.

Returns

A timed-out decision.

Exceptions

  • ArgumentExceptionThrown when eventName is null, empty, or whitespace.
  • ArgumentNullExceptionThrown when correlation is null.
Property

Kind

DurableTaskWorkerDecisionKind Kind { get; } Source

Gets the decision kind.

Property

Correlation

DurableWorkerCorrelation Correlation { get; } Source

Gets the correlation identifiers associated with the decision.

Property

Diagnostic

DurableWorkerDiagnostic? Diagnostic { get; } Source

Gets optional safe diagnostic details.

Property

Work

TWork? Work { get; } Source

Gets the work payload when carried by this decision.

Property

Result

TResult? Result { get; } Source

Gets the terminal result payload when carried by this decision.

Property

Projection

TProjection? Projection { get; } Source

Gets the projection payload when carried by this decision.

Property

EventName

string? EventName { get; } Source

Gets the external event name for wait, timeout, or late-signal decisions.

Property

Timeout

FlowTimeout? Timeout { get; } Source

Gets the optional timeout associated with an external event wait.

Property

RetryPolicy

FlowRetryPolicy? RetryPolicy { get; } Source

Gets retry intent that host orchestration code can translate into Durable Task retry options.

Property

SourceOutcome

DurableWorkerProjectionOutcome? SourceOutcome { get; } Source

Gets the worker contract outcome that produced the decision, when one exists.

Enum

DurableTaskWorkerDecisionKind

Source

Identifies the Durable Task-facing decision produced by the AppSurface worker adapter.

Remarks

Numeric values are part of the adapter compatibility contract and may appear in durable history, tests, or telemetry. Do not reorder, remove, renumber, or reuse values.