Delivery And Workers
Stable outbox, transport, worker, and delivery result values.
Delivery vocabulary spans contract-owned outbox state, transport publish outcomes, and public @runlane/core worker/runtime results. Use these values when building transports, worker orchestration, or operator views.
| Enum | Value | Meaning |
|---|
OutboxMessageStatus.Claimed | claimed | A publisher owns the outbox row for a publish attempt. |
OutboxMessageStatus.DeadLettered | dead_lettered | Publishing is terminally abandoned for this outbox row. |
OutboxMessageStatus.Failed | failed | Last publish attempt failed and the row may become available again. |
OutboxMessageStatus.Pending | pending | Row is waiting to be claimed for publish. |
OutboxMessageStatus.Published | published | Transport accepted the wakeup. |
Outbox failure records use ErrorCode for code; provider-specific detail belongs in meta.
| Path | Outbox behavior |
|---|
Default trigger() | Persists the run and, when creation produced outbox rows, eagerly attempts to publish those new rows. Bounded queues produce outbox rows only after maintenance reserves dispatch capacity. |
tick() | Claims due pending or failed rows for maintenance flushes. |
| Retryable transport publish failure | Leaves the run queued and marks the outbox row failed for later recovery. |
| Storage failure or non-transport publish error | Rejects the trigger or maintenance call. |
TriggerDispatchMode.Deferred | Persists any trigger-created outbox rows and leaves publishing to tick(). |
The default is contractDefaults.dispatch.onTrigger.
| Enum | Value | Meaning | Default |
|---|
TriggerDispatchMode.Eager | eager | trigger() persists the run, then immediately attempts to publish any outbox rows created by that trigger. | Yes |
TriggerDispatchMode.Deferred | deferred | trigger() persists the run and any outbox rows created by that trigger, but publishing waits for tick() or another maintenance runner. | No |
| Enum | Value | Meaning |
|---|
WakeupPublishOutcomeType.Failed | failed | Provider rejected the indexed wakeup publish attempt; the outcome carries an OutboxFailureRecord. |
WakeupPublishOutcomeType.Published | published | Provider accepted the indexed wakeup publish attempt; the outcome carries publishedAt and optional provider message id. |
publishWakeups() returns outcomes by index, not by echoed ids: outcomes[index] is the result for command.attempts[index]. A returned result must include exactly one outcome for every attempted wakeup. Missing, extra, or malformed outcomes are adapter contract violations; operation-level transport outages should reject with TransportUnavailable or TransportPublishFailed instead.
| Enum | Value | Meaning |
|---|
WorkerMode.Drain | drain | Execute currently due work until storage is idle or maxRuns is reached. |
WorkerMode.Poll | poll | Keep polling storage and sleeping on empty polls until stopped. |
| Enum | Value | Meaning |
|---|
ExecuteDeliveryStatus.Executed | executed | The delivered wakeup led to a persisted run outcome. Transport adapters can acknowledge it. |
ExecuteDeliveryStatus.Ignored | ignored | The delivered wakeup was stale or not executable, but safe to acknowledge. |
| Enum | Value | Meaning |
|---|
ExecuteDeliveryIgnoredReason.Abandoned | abandoned | This worker started an attempt but lost lease ownership before it could persist the outcome. |
ExecuteDeliveryIgnoredReason.AlreadyLeased | already_leased | Another worker currently owns the run lease. |
ExecuteDeliveryIgnoredReason.ClaimLost | claim_lost | Storage had due work, but the atomic lease claim did not succeed because another caller changed ownership, sequence, dispatch reservation, or capacity first. |
ExecuteDeliveryIgnoredReason.NotDue | not_due | The run exists but is scheduled for the future. |
ExecuteDeliveryIgnoredReason.RunNotFound | run_not_found | The wakeup points at a run that no longer exists or was never persisted. |
ExecuteDeliveryIgnoredReason.Terminal | terminal | The run is already terminal. |
ExecuteDeliveryIgnoredReason.WrongQueue | wrong_queue | The delivered queue no longer matches the run's current queue. |
Ignored delivery results are ack-safe. Framework, storage, projection, cancellation-before-claim, and persistence failures reject instead so provider integrations can retry or report batch item failure. Missing task or queue registration is persisted as a non-retryable run failure and returns ExecuteDeliveryStatus.Executed.