AppSurface Search
API Reference

DurableTask

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

IDurableTaskWorkerChainRunner<TWork, TResult, TProjection>

Source

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

Type parameters

  • TWork
    Type of work carried by the chain.
  • TResult
    Type of terminal execution result.
  • TProjection
    Type 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)

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

Parameters

  • contract
    App-owned projection contract.
  • work
    Typed work payload.
  • correlation
    Correlation identifiers for the claim.
  • cancellationToken
    Token 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)

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

Parameters

  • contract
    App-owned projection contract.
  • work
    Typed work payload.
  • result
    Terminal result produced by executor activity.
  • correlation
    Correlation identifiers for the completion fact.
  • cancellationToken
    Token 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)

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

Parameters

  • contract
    App-owned projection contract.
  • work
    Typed work payload associated with the terminal fact.
  • result
    Terminal result used to repair projection state.
  • correlation
    Correlation identifiers for the repair attempt.
  • cancellationToken
    Token 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)

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

Parameters

  • correlation
    Correlation identifiers for the wait.
  • eventName
    External event name expected by the host.
  • timeout
    Optional durable timeout metadata.

Returns

A wait-for-external-event decision.

Method

TimedOut

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

Creates a timeout decision for a wait branch that expired.

Parameters

  • correlation
    Correlation identifiers for the timed-out wait.
  • eventName
    External event name whose wait expired.
  • diagnostic
    Optional safe diagnostic details.

Returns

A timed-out decision.

Method

IgnoreLateSignal

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

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

Parameters

  • correlation
    Correlation identifiers for the stale signal.
  • eventName
    External event name associated with the stale signal.
  • diagnostic
    Optional safe diagnostic details.

Returns

An ignore-late-signal decision.

Exceptions

  • ArgumentException
    Thrown when eventName is null, empty, or whitespace.
  • ArgumentNullException
    Thrown when correlation is null.
Type

DurableTaskWorkerChainRunner<TWork, TResult, TProjection>

Source

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

Type parameters

  • TWork
    Type of work carried by the chain.
  • TResult
    Type of terminal execution result.
  • TProjection
    Type of visible projection repaired from terminal facts.
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

  • TWork
    Type of work carried by the chain.
  • TResult
    Type of terminal execution result.
  • TProjection
    Type 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)

Creates an executor scheduling decision for a claimed work item.

Parameters

  • claim
    Claim envelope that authorized executor scheduling.
  • retryPolicy
    Optional retry policy for executor activity.

Returns

A schedule-executor decision.

Exceptions

  • ArgumentException
    Thrown when claim is not a claimed outcome.
  • ArgumentNullException
    Thrown when claim is null.
Method

WaitForExternalEvent

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

Creates an external-event wait decision.

Parameters

  • correlation
    Correlation identifiers for the wait.
  • eventName
    External event name expected by host orchestration code.
  • timeout
    Optional durable timeout for the wait.

Returns

A wait-for-external-event decision.

Exceptions

  • ArgumentException
    Thrown when eventName is null, empty, or whitespace.
  • ArgumentNullException
    Thrown when correlation is null.
Method

RepairProjection

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

Creates a projection repair scheduling decision from a completion envelope.

Parameters

  • completion
    Completion envelope that recorded a terminal fact.
  • retryPolicy
    Optional retry policy for projection repair activity.

Returns

A repair-projection decision.

Exceptions

  • ArgumentException
    Thrown when completion is not a completed outcome.
  • ArgumentNullException
    Thrown when completion is null.
Method

Complete

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

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

Type parameters

  • TPayload
    Envelope payload type.

Parameters

  • envelope
    Envelope that completed the worker chain.

Returns

A complete decision.

Exceptions

  • ArgumentNullException
    Thrown when envelope is null.
Method

CompleteProjection

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

Creates a complete decision from a reconciled projection envelope.

Parameters

  • envelope
    Projection envelope produced by projection repair.

Returns

A complete decision that carries the repaired projection.

Exceptions

  • ArgumentException
    Thrown when envelope is not a reconciled outcome.
  • ArgumentNullException
    Thrown when envelope is null.
Method

Fault

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

Creates a fault decision from a worker envelope.

Type parameters

  • TPayload
    Envelope payload type.

Parameters

  • envelope
    Envelope that faulted the worker chain.

Returns

A fault decision.

Exceptions

  • ArgumentNullException
    Thrown when envelope is null.
Method

IgnoreLateSignal

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

Creates a late-signal decision from a worker envelope.

Type parameters

  • TPayload
    Envelope payload type.

Parameters

  • envelope
    Envelope that identified a stale signal or fence.
  • eventName
    Optional event name associated with the stale signal.

Returns

An ignore-late-signal decision.

Exceptions

  • ArgumentNullException
    Thrown when envelope is null.
Method

WaitForRetry

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

Creates a retry wait decision from a worker envelope.

Type parameters

  • TPayload
    Envelope payload type.

Parameters

  • envelope
    Retryable envelope that should wait before retry.
  • retryPolicy
    Optional 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

  • ArgumentException
    Thrown when envelope is not retryable.
  • ArgumentNullException
    Thrown when envelope is null.
Method

TimedOut

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

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

Parameters

  • correlation
    Correlation identifiers for the timed-out wait.
  • eventName
    External event name whose wait timed out.
  • diagnostic
    Optional safe diagnostic details.

Returns

A timed-out decision.

Exceptions

  • ArgumentException
    Thrown when eventName is null, empty, or whitespace.
  • ArgumentNullException
    Thrown 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.