Skip to content

Queue-Async Runtime ​

QUEUE_ASYNC is the background execution path. The caller submits work and receives an execution id instead of waiting for the whole pipeline result. TPF stores the execution, dispatches work through the configured dispatcher, retries failed transitions, and exposes status/result endpoints for follow-up.

The same semantics have two supported coordination hosts: the native compute-first coordinator and AWS Durable Coordination. AWS Durable changes mechanical hosting, not execution authority or the worker protocol.

It can use in-process providers for local development or durable providers such as DynamoDB/SQS-backed implementations for production-style recovery. To get real HA behaviour, use durable providers and more than one worker-capable runtime instance. memory + event is useful for local development, but it does not give crash-surviving distributed recovery.

For boundary-cost and runtime-mode tradeoffs, see Runtime Boundaries And Performance.

Release-aware REST targets ​

The default pipeline.orchestrator.worker.targeting-mode=legacy preserves the existing local or fixed REST/gRPC/SQS target selection. Opt-in registered-rest selects a REST worker using the execution's persisted tenant, Pipeline, Contract and Release identity. Activating another Release does not redirect retries or Await continuations of an existing execution.

Deployment configuration owns named bindings under pipeline.orchestrator.worker.targets.<target-id>. Each binding contains tenant-id, pipeline-id, contract-version, release-version, worker-id, endpoint, shared-secret-ref, artifact-id and artifact-digest; protocol defaults to rest. Use the exact immutable Release identities and an existing secret reference, such as env:PAYMENTS_WORKER_SECRET. Registration does not grant a worker authority to choose its destination or replace these identities. The (tenant-id, pipeline-id, worker-id) tuple must be unique across target entries, including entries for different Releases.

Registered REST targeting requires one whole-bundle runnable archive covering the pinned Contract's steps and declared capabilities. The Compiled Truth carrier is not assumed to be runnable. Distributed placement across several archives remains unsupported by this mode.

The default typed coordination path requires the pinned Contract to equal the Coordinator's generated Contract, including its layout. For an application-free Coordinator, the candidate opt-in path selects pipeline.orchestrator.control-plane.payload-materialization=SERIALIZED. That path validates the pinned canonical type catalogue and deferred-completion metadata from each Release, rather than loading its application classes or requiring one locally generated application Contract. It also accepts a qualifying whole-bundle lambda-zip alongside application-archive. It requires the corresponding immutable entry binding; a target URL alone is insufficient.

The serialized path is a candidate implementation and requires a compatible compiler, Contract and runtime set; unsupported runtimes may fall back to the default TYPED path. See runtime layouts for the required set.

For independently invoked serverless runtime units, the intended generated boundary is REST/FUNCTION, with QUEUE_ASYNC execution semantics. Local calls inside the typed runtime do not qualify a LOCAL/COMPUTE application as that serverless deployment. Registering a REST worker and successfully invoking one transition establish only those boundaries.

Qualify the complete admitted path, including Commands with their durable effect authority, Await suspension, continuation and recovery. Preserve the Coordinator's scheduling ownership when configuring the worker; changing its execution mode alone is insufficient. The whole-bundle requirement above remains a placement constraint, and does not promise independently deployed segment archives. Use execution-segment placement guidance with the existing supported layouts and verify the emitted Release entry points.

Availability and dispatch use the same target resolution. Both require a matching healthy, non-stale, non-draining lifecycle record and authenticated endpoint capabilities, including known artefact identity/digest. Missing known identity is unverified. Bindings require HTTPS origins without credentials, query, fragment or non-root path. Explicit pipeline.orchestrator.worker.allow-loopback-http=true permits HTTP only for literal loopback development addresses. Do not combine this mode with the legacy fixed remote-target switches or customise native REST routes.

Eligible replicas are considered in stable target-id order. An unavailable capability check may select another replica of the same pinned Release before execution. Once dispatch begins, a possibly executed request does not immediately fail over; the existing unknown-remote-outcome rules below still apply. Re-registering a draining worker does not undrain it; replacement needs a distinct worker identity and its corresponding deployment binding. None of this deploys artefacts or changes an existing execution's immutable pin.

Durable Execution ​

Every correctness-relevant QUEUE_ASYNC operation can be driven and recovered through bounded, idempotent actions without requiring a resident coordinator process. Crash-surviving recovery requires durable providers and a host that drives pending work through events, wake-ups or reconciliation. Native COMPUTE hosting may continue to schedule those actions. For itemised Await, replay reconciles unit completion and any required parent release before retiring continuation work; see itemised continuation recovery.

Durable execution means accepted work is recorded outside the current JVM or process before the runtime depends on it. If a coordinator worker crashes or the application restarts, another worker can recover the stored execution and run it again after the lease expires.

While a claimed transition is still running, the coordinator renews its execution lease before expiry. Renewal is conditional on the same worker, execution version, and an unexpired current lease. If that ownership check fails, the worker cancels the transition path and cannot commit with its stale version. This lets legitimate long-running transitions exceed one lease interval without preventing takeover after a worker actually stops.

To diagnose SQS work delivery, enable the following Quarkus log category on the coordinator:

properties
quarkus.log.category."org.pipelineframework.diagnostics.queue".level=DEBUG

Correlate receives, visibility extensions and acknowledgements by message ID. The work action links the message to the execution ID used by lease and page-advance events. SQS message visibility and the execution lease have separate timers and ownership checks.

The in-memory execution, await, and event providers are also supported for a single-process, attended QUEUE_ASYNC application. They preserve the queue-async and await lifecycle while that process remains alive, but they are not durable execution providers: a restart loses execution, await, command-effect, lease, and admission state. A future local durable profile needs an embedded implementation of that complete coordination-store suite, not a product registry or persistence-plugin adapter.

This is lease-based recovery. For an explicitly paged resumable source, TPF also persists the current page index and provider-opaque page-start checkpoint. That bounds source replay to the current page. TPF does not persist arbitrary step-level or per-item continuation inside an open page.

Durability protects TPF execution state and dispatch/retry flow. External systems called by your business code still need idempotency, because a retry or takeover can call the same operator or downstream system again.

Guarantees ​

In QUEUE_ASYNC mode:

  1. committed execution state transitions are exactly-once (OCC/conditional-write guarded),
  2. dispatch and operator invocation are at-least-once,
  3. duplicate invocation can occur and must be handled with idempotency keys,
  4. generic async result payloads are still persisted as bounded terminal payloads,
  5. persisted protobuf payload descriptors store _tpf_message as the protobuf schema full name.

For the DynamoDB state provider, pipeline.orchestrator.dynamo.execution-payload-table is a separate table with payload_id as its partition key and payload_part as its sort key. Materialized multi-payloads, and inline candidates larger than the safe inline budget, are serialized once into an immutable manifest and byte chunks before the execution row is updated to reference the manifest. Chunks are limited to 256 KiB, well below DynamoDB's 400 KiB item limit; this is a byte-storage invariant, not an item-count batching setting. TPF reconstructs the original serialized payload before decoding it, so this does not change the execution result API. The payload table belongs to the DynamoDB coordinator configuration; no object-store plugin is involved.

Terminal Object Publish is the connector-owned exception to the older "materialize then write a final file" pattern. When output.to is configured, queue-async terminal output is published through the Object Publish connector before the execution is marked successful. The persisted execution result may still keep a compatibility payload, but the external object write is not a user-authored final business step.

Paged Object Publish writes bounded, attempt-safe parts under stable page and group identities. Each page commits its part manifests before the page checkpoint advances. The exhausted page triggers streaming composition in page order and publishes the existing single final object key only after composition succeeds. No page output list crosses the transition-worker result boundary.

Crash Behaviour ​

Think about QUEUE_ASYNC in terms of safe re-execution:

ScenarioWhat TPF preservesWhat happens nextWhat your code must tolerate
Crash before async work is acceptedNothing yetCaller retries submissionduplicate submissions
Crash after acceptance but before completionStored execution row and due-work timinga worker can claim the execution later and run it againrepeated business invocation
Coordinator worker dies while holding a leaseStored execution row remains; lease expiresanother coordinator worker can claim the execution and rerun itat-least-once step execution
Remote REST caller deadline expiresExecution is REMOTE_OUTCOME_UNKNOWN; worker disposition is not knownautomatic retry is suppressedreconcile the prior invocation before explicit re-drive
Crash after downstream side effect but before commitdownstream side effect may already have happenedTPF may rerun the same work itemidempotent external calls
Terminal failure after retries are exhaustedterminal status and failure detailsexecution moves to DLQ or failure statereplay or operator investigation process

The important boundary is this: TPF makes the orchestrator state crash-surviving, but your business-side effects must still be safe when the same work is attempted again.

Use Command Steps when the external side effect itself should be a managed pipeline boundary with a deterministic command id, effect log, duplicate policy, and recorded output replay.

Remote Transition Deadlines ​

A remote transition worker is a stateless data-plane executor for one bounded continuation. The coordinator owns the execution record, lease, retry policy, re-drive, and result/status authority. A worker availability heartbeat proves that a worker is registered and recently healthy; it does not prove the disposition of a particular transition invocation.

An eligible portable live Await transition can legitimately run longer than ordinary request/reply work. For REST transition workers, TPF emits one remote_transition_deadline_warning log event at 75% of the configured request deadline. The warning identifies the execution, attempt, transition key, protocol, target, elapsed time, and deadline; it does not include payload data. A slow transition is not considered failed by that warning.

If the REST caller reaches its request deadline, TPF records the execution as REMOTE_OUTCOME_UNKNOWN. That means the caller did not receive a result and TPF has no authoritative evidence that the remote worker stopped. The execution is excluded from automatic sweep, lease claim, and retry; HttpTimeoutException is not treated as worker death. The coordinator logs remote_transition_outcome_unknown with decision=automatic_retry_suppressed.

REMOTE_OUTCOME_UNKNOWN does not provide transparent mid-transition takeover, result recovery, or live-stream resurrection. An operator may use the existing explicit failed-execution re-drive path only after independently confirming that the original worker invocation completed, was cancelled, or is otherwise no longer able to make effects. That re-drive is a new attempt and still needs normal idempotency safeguards. A durable remote-attempt result/ownership protocol is a separate capability, not a worker-local cache.

Re-execution, Re-entrancy, And Idempotency ​

These three ideas are related but not identical:

  1. Re-execution means TPF may run the same accepted execution again after retry, redelivery, or lease takeover.
  2. Re-entrancy means your step or downstream boundary behaves correctly when it is entered again for the same logical work item.
  3. Idempotency means repeating the same operation does not create a second business effect.

In practice, teams should design QUEUE_ASYNC steps around these rules:

  1. keep side effects at explicit boundaries, not hidden across several helper calls,
  2. give external systems a stable business idempotency key when they support one,
  3. make database writes upsert/merge-aware where possible,
  4. treat retries and worker takeover as normal behaviour, not exceptional edge cases,
  5. assume orchestrator state is exactly-once committed, but step invocation is still at-least-once.

Example: Payment Capture ​

Suppose a payment-capture step calls an external provider and the worker crashes after the provider accepts the charge but before TPF commits success.

On recovery, TPF can run that work again. The safe design is:

  1. send a provider idempotency key such as orderId or paymentRequestId,
  2. persist the capture result after the provider confirms it,
  3. make repeated callback handling return the same logical payment status instead of charging again.

Without that boundary-level idempotency, TPF can still recover the execution, but your payment side effect may be duplicated.

Example: Queryable Read Model ​

Suppose a pipeline persists an order summary that the UI reads later.

The safe design is:

  1. write by stable business key such as orderId,
  2. update the existing record if the same execution is replayed,
  3. keep expensive derived data in cache so replay can reuse stable upstream work.

That gives you crash recovery plus a queryable result without turning retries into duplicate rows.

Runtime Components ​

Runtime provider choices:

  1. ExecutionStateStore: memory (dev), dynamo (durable).
  2. WorkDispatcher: event (in-process), sqs (durable queue).
  3. DeadLetterPublisher: log (built-in fallback), sqs (durable DLQ).

Failure channel split:

  1. Execution-level terminal failures use orchestrator DLQ (DeadLetterPublisher).
  2. Step-level recover-and-continue failures use Item Reject Sink (pipeline.item-reject.*, rejectItem / rejectStream).

Execution Lifecycle ​

One transition runs per worker claim:

text
Submit(run-async)
  -> createOrGetExecution (dedupe key + execution row)
  -> enqueue work item
  -> worker claimLease (OCC + lease expiry)
  -> execute transition
     -> live await sessions may stream completed item output while transition is alive
     -> otherwise await suspension parks execution as WAITING_EXTERNAL
  -> publish terminal connector output when configured
  -> commit transition (markSucceeded / scheduleRetry / markTerminalFailure)
  -> enqueue next transition OR finalize terminal state

For a paged source, the transition repeats as follows:

Duplicate invocation reuses the execution, page, group, and item-position identities. A duplicate page commit observes an already advanced state and does not enqueue another successor. After confirmed owner loss, recovery reopens the current page from its start checkpoint; completed pages are not read again. A REST deadline with uncertain worker disposition remains REMOTE_OUTCOME_UNKNOWN and is not evidence of owner loss.

Recovery points:

  1. crash before commit: queue redelivery replays the transition.
  2. crash after commit before next enqueue: due sweeper re-dispatches.
  3. coordinator worker death while leased: lease expiry allows takeover.
  4. a remote REST caller deadline: the execution is parked as REMOTE_OUTCOME_UNKNOWN; no automatic takeover is attempted.

These guarantees are deterministic for orchestrator state, not for external side effects; downstream step boundaries must accept at-least-once invocation.

Deferred completion adds one more lifecycle boundary to an ordinary operation. For a brokered operation emitting a stream, the live queue-async transition can keep a live await session open: completions are recorded durably, signalled to the session, and emitted to downstream demand without waiting for every item in the unit to finish. That is how CSV Payments lets the parser, Kafka completion transport, status processing, and Object Publish move together.

The durable WAITING_EXTERNAL path still exists. It is the recovery and fallback path when no live session can accept the completion, or when the worker suspends and another claim must resume later. In that path, the coordinator waits for dispatch completion and the parent execution's WAITING_EXTERNAL state before releasing item continuations from the stores.

HA Baseline ​

Use this as a minimum production baseline for crash-surviving background execution:

properties
pipeline.orchestrator.mode=QUEUE_ASYNC
pipeline.orchestrator.state-provider=dynamo
pipeline.orchestrator.dispatcher-provider=sqs
pipeline.orchestrator.dlq-provider=sqs
pipeline.orchestrator.queue-url=https://sqs.eu-west-1.amazonaws.com/123456789012/tpf-work
pipeline.orchestrator.dlq-url=https://sqs.eu-west-1.amazonaws.com/123456789012/tpf-dlq
pipeline.orchestrator.idempotency-policy=CLIENT_KEY_REQUIRED
pipeline.orchestrator.strict-startup=true

Operational expectations for this baseline:

  1. state transitions remain OCC-guarded and lease-claimed,
  2. queue delivery and operator invocation remain at-least-once,
  3. terminal dead-letter events are stored outside the current process, not process-local log-only.

CI confidence for this baseline:

  1. SYNC remains the default runtime mode and the fast baseline configuration.
  2. QUEUE_ASYNC remains opt-in and requires explicit provider configuration for crash recovery.
  3. the HA gate exercises the checkout deliver-order recovery path against dynamo + sqs behaviour with DynamoDB Local + ElasticMQ.
  4. this gate covers worker kill takeover, sweeper redispatch, duplicate submit determinism, and DLQ publication that survives process restarts.

Diagram