Skip to content

Await Boundary Operations ​

Deferred completion is operationally different from an ordinary remote call. An operation decorated with await: produces its trusted immediate result, dispatches a completion request, and admits only correlated final observations. Some paths park a QUEUE_ASYNC execution as WAITING_EXTERNAL; brokered itemised streams can keep a live session open and use the parked state as the recovery fallback.

Use this page with Await Boundaries for application design, Await runtime setup for adapter configuration, and Replay & Live Topology for replay inspection.

Resuming nested Await ​

For a LOCAL ONE_TO_ONE call chain, a pending interaction retains the suspended definition and execution position, each caller's callsite and return position, and the invocation occurrences. These positions refer to the compiled steps of the execution's pinned release, including generated observers.

When PadelPot waits for owner review inside personal-agent, an admitted answer resumes after the Await operation in that invocation. The child executes its remaining policy and observers, completes its declared output, and returns through the caller's remaining steps. A self-call can repeat negotiation before returning. Another operation may suspend during child execution or caller return. The owning root publishes its terminal output only when the complete execution finishes.

When diagnosing a failed or unexpected resume:

  1. Identify the execution, its pinned release, and the pending interaction. Repeated reviews at the same authored operation can belong to different invocation occurrences. Submit the answer for the interaction that requested it.
  2. Keep that release's compiled definition orders and invocation bindings available. A saved position must resolve against the same release when the process restarts.
  3. Inspect the retained definition identity, callsite, occurrence and suspended position together. A root range with no remaining steps can still have unfinished child work.
  4. Check pipeline.max-recursive-depth when a self-call fails. Self-calls consume the recursion allowance; ordinary nested composition does not.
  5. Treat a rejected continuation version or mismatched callsite as a release or metadata compatibility failure. Restore the pinned release and investigate the stored record before retrying. Editing positions to fit a newer topology risks resuming a different operation.

Legacy records without an invocation continuation resume as root executions. Incompatible retained continuation metadata is rejected explicitly. Existing correlation, duplicate admission, timeout and cancellation rules also apply to nested waits. Keep external dispatch and effects idempotent across recovery.

Await belongs on the operation inside the definition. Attaching await: directly to a pipeline invocation is unsupported. The compiler rejects nested suspension paths crossing streaming or remote invocation boundaries. Existing non-nested streaming Await has its own live-session and durable-fallback behaviour below.

Runtime Requirements ​

For a native Command using await.callback, completion is registered before effect dispatch. The Quarkus HTTP ingress is pipeline/callbacks/{signed-token} relative to the application's public base. Configure the application endpoint resolver and authenticator, keep the resume-token secret stable across replicas, and route the public path to the owning application release. Authenticate provider requests even though the resume token is signed.

Treat callback URLs as credentials: redact their token-bearing paths in reverse-proxy and HTTP access logs, and do not put raw signatures or payloads in application authentication diagnostics. The ingress bounds bodies to 1 MiB and headers to 32 KiB, and emits empty rejection responses. Invalid requests and terminal admission rejections return 400. Internal lookup, authentication-service, or completion failures return 503 so the provider can retry without receiving internal diagnostics. Provider retries may receive the pinned success acknowledgement after duplicate admission. An early callback cannot advance execution until Command dispatch settles; a late callback resumes through ordinary Await admission. See callback setup.

For restart recovery, retain the execution state, Await state, Command effect history, deployed release, and resume-token secret. The packaged callback proof restarts the JVM against the same Dynamo tables and admits the original callback without another provider dispatch. A successful callback after ambiguous dispatch does not turn the effect history into a confirmed provider acknowledgement.

Await requires QUEUE_ASYNC. The owning execution must be stored before it can wait on an external result.

At minimum:

properties
pipeline.orchestrator.mode=QUEUE_ASYNC
pipeline.orchestrator.resume-token-secret=${PIPELINE_ORCHESTRATOR_RESUME_TOKEN_SECRET}

For crash-surviving environments, use durable queue-async providers:

properties
pipeline.orchestrator.state-provider=dynamo
pipeline.orchestrator.dispatcher-provider=sqs
pipeline.orchestrator.dlq-provider=sqs

The state transition that parks or resumes the execution is guarded by the orchestrator store. External dispatch and external side effects remain at-least-once.

Await Adapter Responsibilities ​

Await adapterOperational responsibility
interaction-apiA UI or client must list pending interactions and call the generated completion API.
webhookConfigure a stable resume-token secret, reachable callback URLs, and partner retry/idempotency handling.
kafkaConfigure request and response channels, monitor broker/consumer health, and keep correlation ids stable.
sqsConfigure request and response queues, monitor poller health, size visibility timeouts, and attach queue DLQ policy.

Kafka and SQS await use framework-owned request and completion envelopes. The external provider is not a pipeline step; it is the actor that completes the await interaction.

Idempotency And Completion ​

Await protects TPF-owned execution state, not external business effects.

Design each external boundary with:

  1. stable business idempotency keys,
  2. duplicate-safe provider requests,
  3. duplicate-safe completion admission,
  4. durable or queryable business records where the external effect matters.

Late or duplicate completions can be dropped when the target interaction is already terminal, stale, or otherwise not admissible. Monitor:

  • tpf.await.completion.dropped.total

Recovering Itemised Continuations ​

Itemised Await recovery uses PipelineControlPlane.processAwaitItemContinuation for one reactive continuation attempt. With durable providers, a fresh runtime can rediscover the work after completion admission, even if the admitting process stopped before updating the Await unit. The continuation-work projection supplies discovery and retry timing; the interaction, unit and child execution records retain semantic authority.

Each recovery invocation converges the admitted facts in this order:

  1. A completed interaction idempotently records its item completion in the Await unit.
  2. A succeeded child records any missing continuation-completion fact. An existing continuation-completion fact still reconciles the required parent release.
  3. Continuation work is retired only after those consequences have been reconciled. If reconciliation or release delivery fails, the work remains available for another invocation.

ALREADY_COMPLETED means the durable outcome has been reconciled, including outstanding parent-release bookkeeping. It does not mean that recovery skipped that bookkeeping. Sequential and concurrent replay reuse the same child identity and transition key; conditional writes prevent another item-completion count, child-success transition or parent release. Physical queue delivery remains at-least-once.

The action does not sleep, schedule retries or subscribe internally. Saturation returns a retry disposition without consuming an attempt; a failed continuation records the next retry attempt and due time. Native hosting may schedule bounded invocations, and provider hosting may invoke them from events, wake-ups or reconciliation. Either host must continue driving pending work. See queue-async recovery.

Diagnosing a remote Await in the proposed mode ​

Start with the execution’s tenant, Release, worker binding and interaction version. A pending interaction and its Release metadata should remain readable while the worker is unavailable. If completion is blocked, distinguish the external reply from a failed conversion or projection in the original typed worker. A retried callback can recover a pending projection using retained evidence. If the interaction timed out while projection was running, the Coordinator rejects the stale result.

For itemised work, check the unit seal and retained item count before diagnosing continuation dispatch. An incomplete unit can have individual completed interactions. For the sequence and ownership boundaries, see ADR-0089.

Runtime Signals ​

In QUEUE_ASYNC, itemised deferred completion has a live path and a durable fallback path.

In the live path, a brokered operation stream keeps an in-memory await session open while the parent transition is alive. A completion is still recorded durably first, then the live session emits it to the resumed segment when downstream requests it. This is the normal connector-first CSV Payments path.

For the eligible portable shape, the transition worker is the live owner. Durable interaction admission and retry state remain framework-owned; the coordinator does not need to take ownership of the live Multi simply because the completion transport is remote.

The durable fallback path is used when the live session is unavailable, after worker loss, or when a later claim must resume from stored state. In that path, the runtime uses durable coordination gates:

  1. Interaction dispatched: TPF created await interactions and handed requests to the configured await transport.
  2. Unit dispatch complete: the durable-fallback await unit has finished dispatching its known item set.
  3. Parent wait durable: the parent execution is stored as WAITING_EXTERNAL for that await unit when the transition suspends.
  4. Completion admitted: a provider completion matched an interaction and was recorded idempotently.
  5. Early completion held: a completion arrived when no live session could accept it and before the fallback release gates were true, so it was recorded but not used to start continuation yet.
  6. Resume released: dispatch is complete, the parent wait is durable, and enough completions exist to resume the next segment from stored state.
  7. Unit terminal: the await unit completed, timed out, or failed.

The unit dispatch and parent-wait gates are durable-recovery gates. They are not prerequisites for a live item handoff and should not appear as a per-item critical path while a live owner is healthy.

The matching metrics are:

GateMetric
Interaction dispatchedtpf.await.interaction.dispatched.total
Unit dispatch completetpf.await.unit.dispatch_complete.total
Completion admittedtpf.await.completion.admitted.total
Item completed (fallback aggregate)tpf.await.item.completed.total
Early completion heldtpf.await.completion.early_held.total
Resume releasedtpf.await.resume.released.total
Unit terminaltpf.await.unit.terminal.total
Completion latencytpf.await.completion.latency
Unit durationtpf.await.unit.duration

Operational interpretation:

  1. In the live path, admitted completions may move directly into downstream step telemetry without a separate durable resume release per item.
  2. Admitted completions rising without downstream step progress points to live-session demand, provider/broker ordering, downstream backpressure, or fallback-release pressure.
  3. Early-held completions are normal during races where providers answer quickly and no live session accepts the completion, but they should drain after the parent execution is durably waiting.
  4. Dropped completions indicate stale, duplicate, or non-admissible completions; correlate them with transport retries and replay events.
  5. Queue depth and provider lag remain provider-native signals. TPF does not scan the await store to synthesize backlog gauges.

Replay And Tracing ​

Replay and trace events expose the durable-fallback lifecycle of the await unit:

  • await_interaction_dispatched
  • await_unit_dispatch_complete
  • await_execution_waiting
  • await_unit_item_completed
  • await_unit_completed
  • await_resume_released
  • await_unit_terminal

Use these events to separate durable fallback from viewer interpretation. A healthy live itemised handoff is instead visible through interaction completion and downstream step events; it does not synthesise await-unit item-completion or resume-release events. For example, in csv-payments, Process Csv Payments Input emits one pending PaymentRecord per row and decorates each with deferred completion, so downstream progress should begin as provider responses are admitted. Replay shows a completion overlay on that semantic operation rather than a separate Await node.

Troubleshooting Runbook ​

Parser Appears To Race Ahead ​

In a healthy connector-first stream, the parser can be ahead of the provider, but it should not blast the whole source before downstream work starts. Compare replay times:

  1. first parser emit,
  2. first await dispatch,
  3. first downstream step start,
  4. last parser event,
  5. last await completion.

If downstream status processing starts while parser and completion dispatch are still active, the live path is working. If every parser event happens before the first downstream event, check pipeline.max-concurrency, admission wait and pending signals, step buffer metrics, and whether the decorated operation is running through the live brokered path or durable fallback only. Interpret pipeline.max-concurrency as the shared unresolved-work budget for the external provider, not as a target for local CPU utilisation.

Await Stays Hot Or Red In Replay ​

Treat await heat as a question about where time is spent:

  1. If dispatch finishes quickly but completions arrive slowly, inspect provider permits, provider latency, and broker lag.
  2. If completions arrive but downstream steps do not start, inspect live-session demand and durable fallback metrics such as tpf.await.completion.early_held.total and tpf.await.resume.released.total.
  3. If await_resume_released is low but downstream steps are running, that can be normal live-path behavior. Live handoff is visible through downstream step events, not through a durable release event per item.

Completions Lag ​

Check the provider and broker before tuning TPF:

  1. provider-side rate limit or permits,
  2. request topic/queue publish latency,
  3. response topic/queue consumer lag,
  4. completion admission drops or duplicate completions.

The await store is the idempotency point, but it is not the external provider backlog. Use provider-native and broker-native dashboards for backlog age.

Object Publish Drips Slowly ​

Object Publish is the terminal output boundary. It should start after terminal step output exists and must finish before execution success. If it appears slow:

  1. compare object_publish_grouped and object_publish_published replay events,
  2. check target provider write duration and bytes published,
  3. check whether the terminal step is still producing output slowly,
  4. verify grouping.maxOpenGroups is intentional for the input shape.

For CSV Payments, grouping.maxOpenGroups: 1 is expected because Object Ingest admits one source object per execution.

Kafka Topic Warnings ​

Short-lived local stacks can log transient UNKNOWN_TOPIC_OR_PARTITION warnings while topics are being created or containers are starting. Treat them as benign only if the consumer later joins, requests are dispatched, completions are admitted, and the run finishes. Persistent warnings mean the topic/bootstrap configuration or startup ordering is wrong.

Stale Runtime Or Packaged Classes ​

If local behavior disagrees with source changes, rebuild with a worktree-local Maven cache and clear corrupted image/layer cache only when the build reports cache extraction errors. For CSV Payments, rebuild the selected layout before rerunning E2E so generated classes and packaged org.pipelineframework artifacts match the branch under test.

Journal Or Index Misconfiguration ​

When the control-plane journal is enabled, due-work and timeout behavior depend on journal writes and indexes as well as the existing projections. If executions stop sweeping or timeouts do not fire, verify journal append success, projection version conflicts, due-work index configuration, and timeout index configuration before redriving executions.

Cardinality And Limits ​

Deferred completion applies once to every result emitted by the authored operation. There is no aggregate Await cardinality. If a provider acts on a whole batch, represent that batch with an explicit bounded canonical collection type. Existing concurrency, payload-size, deadline, and transport limits still apply to each interaction and its completion.

Await Versus Checkpoint Handoff ​

Await and checkpoint handoff both cross a process boundary, but they assign ownership differently.

ConcernAwaitCheckpoint handoff
Execution ownershipone execution parks and later resumesone pipeline publishes and another pipeline admits independent work
Boundarymid-pipeline external waitterminal or named publication boundary
Completioncorrelated interaction completiondownstream checkpoint admission
Retry and DLQowning execution remains responsibledownstream orchestrator owns retry and DLQ after admission
Use whenthe external result belongs to the same business flowanother pipeline should own the next lifecycle

Use await for human approvals, webhook callbacks, and brokered provider decisions that must resume the same execution. Use checkpoint handoff when the receiving workflow has separate ownership, scaling, or operational responsibility.

Provider replacement and retained execution identity ​

A provider execution stopping does not by itself cancel or complete the TPF execution. With the AWS Durable recovery host, keep the permanently stopped original provider execution and its replacement distinct in the evidence.

Record both provider ARNs, the unchanged semantic execution ID, original Pipeline/Contract/Release and worker pins, and the advanced generation. A late message from the stopped generation cannot commit work for the replacement. Provider acceptance, queue acknowledgement and callback delivery each require their corresponding authoritative TPF observation before reporting business completion.

When reconstructing a client's execution context, use the original client key and Release to read semantic admission, then observe the current locator. Do not select today's active Release or assume generation 1. Missing admission, a claimed generation awaiting locator registration, or a concurrent successor remains pending evidence. It does not authorise another execution or a different Await token. The existing retained interaction and actor/token rules still govern completion. See the Action observation contract.

Diagram