The queue vocabulary
The sixteen semantics of a queue, and what Durable does for each.
Generated from the SDK's own source (
docs/durable/queues.md) at build; edit there.
Durable in the words a queue customer brings from SQS, EventBridge, Step
Functions, Kafka, Pub/Sub, Cloud Tasks, Inngest, Trigger.dev and Restate
(ADR-0076 D06; FP-030). One row per semantic: what the platforms call it
and the figures their pages state, then Durable's word and figure. The
platforms' figures were read from each vendor's public documentation on
2026-10-12 (ADR-0076's input C, the gap report kept outside the tree; the
pages are listed under "Sources"). Durable's figures are the tree's: a
constant is named with its module, a measurement with its pin in
tests/bench/targets.json (the pin's measured, the run that set it
named on the pin), a rule with its ADR decision. The guard
docs-parity/queues-page-figures (the docs-parity guard)
reads every figure this page quotes beside a constant or a pin and holds
it to the tree's value, so a number here is never stale by more than one
pnpm check; a figure the tree cannot answer is written as unmeasured
with the unit that measures it.
Every row is Durable's: priority and fairness landed as FP-025 ("Priority
and fairness per partition", 2026-10-12, #622) in the Fair queues and
Priority rows, time-window replay and the archive as FP-027 ("Time-window
replay (event.replay) and the archive tier (OutboxArchive,
archiveDays)", 2026-10-12, #619) in the Archive and replay row, and the
producer's idempotency key with its window as FP-026 ("The per-emit and
per-start idempotency key with a TTL window", 2026-10-12) in the
Deduplication row, as the per-listener retry policy with the DLQ redrive
at a velocity is FP-028's and debounce and throttle per key FP-029's, and
the fairness group per tenant with the tenant quotas at the doors landed
as SR-006 (ADR-0078 D06, "Tenant fairness and quotas", 2026-10-13) in
the Fair queues row. Each landed after this page, under the words D06
gives it, and this page was rewritten at its landing. The limits that bound an invocation are the
time contract's, time, and the cost of a day is
cost's; this page names them and does not restate them.
The sixteen semantics#
| Semantic | The platforms' word and figure | Durable's word and figure |
|---|---|---|
| Delivery guarantee | SQS standard at-least-once, duplicates possible; SQS FIFO "exactly-once processing" inside its 5-minute dedup window at +25 % of the price; Pub/Sub at-least-once, exactly-once on pull alone in one region at "significantly higher" latency; Kafka at-least-once by default, transactions read under read_committed; Cloud Tasks "> 99.999 %" once with duplicates possible; every page adds that an external side effect still needs its own key |
At-least-once delivery, effectively-once processing, no mode sold ("Effectively-once, stated" below): a fact is delivered until a listener run records an outcome, at most MAX_ATTEMPTS 8 transport attempts a row (packages/durable-core/src/events/limits.ts); the listener's run is started at most once per key (listener.<name>:<outboxId>); a step's output is served from its row on every later attempt; a provider write is an external step under a writeKey, its intent on the row before the call and reconciled from the landed row or the world after a crash (ADR-0041, ADR-0063 B06) |
| Ordering | SQS FIFO strict order per message group, standard best-effort; Kafka "exactly the same order as they were written" per partition; Pub/Sub ordering keys at 1 MBps per key, the order may break into a dead-letter topic; EventBridge's Custom bus FIFO per EventGroupId at 1,500 events+KB a second per group; Restate calls to one virtual object "in order of arrival, serially" |
In order inside a row's stored partition, in (occurredAt, id) order; a partition moves only when its head does (stuckWhere in packages/durable-core/src/events/outbox.ts, ADR-0041), the head rule judged by the claim itself (ClaimHead, FW-025); one ordered read per partition pass (fetchPartition, ADR-0076 FP-010); DISPATCH_DEFAULTS.dispatchConcurrency 4 partitions delivered abreast in one lane (packages/durable-core/src/events/tick.ts); a delayed fact takes its natural place once due and holds nothing back (ADR-0050 decision 1); the order held on every store double by the conformance suite |
| Visibility timeout | SQS 30 s default, 0 to 12 h, ChangeMessageVisibility extends it, the 12 h cap counts from the first receive; Pub/Sub ack deadline 10 to 600 s; Kafka max.poll.interval.ms 300,000 and session.timeout.ms 45,000; Restate inactivity_timeout 1 min, abort_timeout 10 min; Vercel Queues visibility up to 1 h (time.md's plan table) |
Two things, stated below: a claimed row is invisible to the dispatcher until its retryAt (the backoff, RETRY_BASE_MS 15 s × 2^attempts at most RETRY_MAX_MS 600 s) or, where the claim's tick died, until the next claim finds that the attempt recorded no outcome (deadClaimNote, FW-025); and an attempt's lease is LEASE_MS 890 s (app/lib/platform.ts: leaseMsFor, the function limit MAX_DURATION_S 800 s plus two heartbeats of HEARTBEAT_S 45 s, packages/durable-core/src/platform.ts), extended by the heartbeat and capped by the kill (a stored kill plus KILL_GRACE_MS 45 s; a run never touched claimed at UNTOUCHED_CLAIM_MS 90 s, FP-008). There is no extension verb: a step that needs longer parks the run (continue, ADR-0066), which is the extension |
| In-flight cap | SQS about 120,000 in flight per queue; Inngest concurrency { limit, key, scope }, the plan's 5 / 100 / 500 concurrent steps; Trigger.dev 20 / 50 / 200 concurrent runs with 2.0× burst, concurrency { total, perKey }; Cloud Tasks max_concurrent_dispatches; Kafka one consumer per partition per group |
Per workflow, defineWorkflow({ concurrency: { max, key } }): a start over the cap parks on a slot wait and is admitted in start order (ADR-0052 decision 5; throughput.runs.perMinute.capped.c32 298.8 a minute at a cap of 8 under 32 starters); per process, DISPATCH_DEFAULTS.dispatchLanes 1 lane of DISPATCH_DEFAULTS.dispatchConcurrency 4 partitions taking DISPATCH_DEFAULTS.dispatchLimit 200 rows a tick, INLINE_CONCURRENCY 4 drains with INLINE_BACKLOG_MAX 32 partitions waiting under inline and QUEUE_MAX_CONCURRENCY 8 consumers under queue (packages/durable-vercel/src/options.ts), a batch wave of BATCH_MAX_CONCURRENCY 8 chunks (packages/durable-core/src/engine/batch.ts); every store verb of the drains, the waves and the wakes under the pool gate, the pool's connections less POOL_GATE_SPARE 2 (packages/durable-core/src/engine/pool-gate.ts, FP-014). A cap per listener is FP-028's |
| Dead-letter queue and redrive | SQS RedrivePolicy { maxReceiveCount } default 10, StartMessageMoveTask up to 500 messages a second for at most 36 h, 100 tasks an account, oldest first, a redriven message new; Pub/Sub maxDeliveryAttempts 5 to 100, best effort; EventBridge MaximumRetryAttempts 0 to 185 and MaximumEventAgeInSeconds 60 to 86,400 per target, the DLQ a standard SQS queue; Restate 70 attempts then pause |
The backoff ladder, then a person: a transport failure backs the row off RETRY_BASE_MS 15 s × 2^attempts at most RETRY_MAX_MS 600 s (30, 60, 120, 240, 480, 600 and 600 s after the seven failed claims, about 35 minutes, ADR-0076 E §3 F8); at MAX_ATTEMPTS 8 the row is exhausted and announced in the final backoff's own statement (event.exhausted, FP-007; events.blockedHeadAgeMs on GET health), listed on the Errors page and GET events?undelivered=1, and comes back only from the console: event.reset one row or BULK_RESET_MAX 500 ids a request (packages/durable-core/src/operator/limits.ts), event.dismiss the same, event.redeliver one listener once more; a listener run that failed is limbo, redriven by run.redrive or runs.redrive (BULK_REDRIVE_IDS_MAX 5 000 ids, fanned out in chunks of BULK_REDRIVE_CHUNK 100); a run whose function dies every time is a person's after RESUME_MAX_ATTEMPTS 8 abandoned resumes (ADR-0063 B17). A maxReceiveCount per listener, the exhausted rows listed per listener and events.redrive at a velocity are FP-028's |
| Deduplication | SQS FIFO MessageDeduplicationId or a content hash, the 5-minute interval; EventBridge's Custom bus DeduplicationId, 300 s, answered DEDUPLICATED; Inngest an event id for 24 h; Restate Idempotency-Key for 24 h; Trigger.dev idempotencyKey for 30 days with scopes; Cloud Tasks a deleted task's name refused for 24 h |
A fact's identity is its catalog key (defineEvents: key(payload), a pure function of the payload, never the clock; at most RELAY_KEY_MAX 512 characters, packages/durable-core/src/events/relay.ts): a resend collapses onto the row while the row lives (OutboxStore.emit, insert-if-absent on the key; the outcome inserted, shared or collapsed, event.collapsed in the log), a delivered row living outboxDays 7 (RETENTION, packages/durable-core/src/engine/retention-windows.ts). A start's identity is the workflow key (defineWorkflow({ key }), a field list or a pure function; the same key answers the stored run, KeyCollision while it runs, execute.key_reused for another input under a field-list key, ADR-0063 B20), its row living with the run and idempotencyDays 30 past a COMPLETED one. A producer's own idempotencyKey with its window rides on emit, ctx.emit and execute (ADR-0076 FP-026; packages/durable-core/src/events/dedupe.ts: a key of at most DEDUPE_KEY_MAX 512 characters, ttl in the duration grammar, DEDUPE_TTL_DEFAULT_MS 24 h unless said and DEDUPE_TTL_MAX_MS 30 d at most), judged against its own DedupeKey row inside the fact's or the run's own statement (OutboxStore.emitDeduped, createRunWithKey's dedupe, the finish's keys' CTE): a repeat inside the window inserts nothing, wakes nothing and answers the first's id as a value ({ emitted: false, deduplicated: true, id }, { status: "deduplicated", runId }), a repeat after the window is a new row, the expired keys are the pass's last rule (expired_dedupe_keys, counted as dedupe), and the keys naming a row or a run are dedupe on GET events/:id and GET runs/:id |
| Message groups | SQS MessageGroupId, 128 characters, required on FIFO, one message of a group in flight; Pub/Sub ordering key at most 1 KB; Kafka the partition key; EventBridge EventGroupId; Restate the virtual object's key; Trigger.dev concurrencyKey with perKey: 1 |
The partition: the host's rule bound in durable.config.ts (partition(name, key, payload)), computed at the emit and stored on the row, never recomputed (ADR-0041 items 7 and 14); a relayed copy under relay:<origin>:<the origin's partition>. The dispatcher names at most STUCK_PARTITIONS_MAX 5 000 stuck partitions by name (packages/durable-core/src/events/limits.ts); a partition whose oldest live row is STALLED_PARTITION_MS 15 min old is announced as partition.stalled at most once per STALLED_ANNOUNCE_MS 1 h (packages/durable-core/src/platform.ts, FP-017); GET workers names the worst PRESSURE_OLDEST_LIMIT 10 partitions among the oldest PRESSURE_OLDEST_SCAN 1 000 live rows. The host's keys are reviewed in docs/runbook.md "The partition keys" |
| Delay | SQS DelaySeconds 0 to 900, the 15-minute cap the page itself routes around; EventBridge Scheduler 10,000,000 schedules a Region; Trigger.dev delay with no maximum; Inngest step.sleep up to a year inside the plan's run length; Cloud Tasks 30 days ahead; Restate sendOpts({ delay }) |
emit(name, payload, { deliverAt }): the row exists for nobody until its moment, the moment never a key part, a resend never moves it (ADR-0050 decision 1), a scheduled row cancelled by key before it (ctx.cancelScheduled inside a step, durable.cancelScheduled outside one); inside a run ctx.sleep and ctx.sleepUntil with no cap, the run parked and no function held (ADR-0050 decision 3); on the definition schedule (every of at least a minute, or at least 10 s where the platform says subMinute (ADR-0076 FP-036: queue and inline on a plan whose cron runs every minute, the coming minute's slots emitted at one tick as delayed facts at their moments, six a tick at most), or a five-field UTC cron; catchUp 1), the slot in the key (ADR-0050 decision 2, ADR-0060 decision 5). The precision: seconds inside the deploy window, WAKE_MAX_DELAY_S 120 s (packages/durable-core/src/platform.ts: a delayed wake rides the queue or a bounded timer), the cron minute beyond it; wait.sleepToResumed.p95Ms 5 013.6 ms from a 5 s sleep's start to the step after it on the queue path |
| Long polling | SQS WaitTimeSeconds 1 to 20 s; Pub/Sub push, EventBridge targets, Inngest and Trigger.dev calling your endpoint; Restate GET /restate/attach/{id} |
A push, never a consumer's poll: a committed fact wakes its partition through the bound platform (Platform.wake, ADR-0045: inline drains it in the committing process, queue sends a Vercel Queues message, self a kick coalesced per KICK_COALESCE_MS 3 s; the cron minute the sweeper for every wake lost, late or refused); event.wake.inline.emitToDelivered.p95Ms 159.7 ms from the emit to the delivered mark under inline, event.wake.emitToDelivered.p95Ms 2 874.1 ms under self. A caller that wants a run's answer waits on the long-poll await (FP-035, D07): GET runs/:id?wait=<duration> holds the request until the run lands or the wait ends (at most 20 s a request, SQS's bound), awaitRun(id, { timeout }) the same wait in process, durable-sdk await <runId> --api <url> the loop over the route; the finish statement says the run's id with pg_notify inside its own RETURNING (no statement added: the per-run pins stand) and a waiter holds one LISTEN session for the length of its wait, so the answer after a landing is the notification's flight (run.await.afterLanding.p95Ms 4 ms on the laptop's loopback database, the forced poll 357 ms there), a read of the run every 500 ms where the store cannot listen (a transaction pooler: the store's one probe on the first await decides, never the URL's text; DURABLE_AWAIT=poll forces it); execute(input, { awaitMs }) keeps its in-process read of a run another call started |
| Batch | SQS 10 entries a call, 1,048,576 bytes a send; EventBridge's Custom bus 100 entries a PutEvents, 1 to 500 a delivery with a window of 0 to 300 s; Pub/Sub 1,000 a publish; Trigger.dev 1,000 a batch trigger; Inngest 5,000 events a send, 5 / 100 / 500 a batched run; Kafka max.poll.records 500 |
A batch listener, on(event, name, body, { batch: { maxSize, maxWait } }), receives a slice: the partition's contiguous live rows of its event from the head, at most maxSize, claimed in one statement and run once under the head's key, a short slice waiting maxWait from the head's moment (ADR-0052 decision 3); throughput.facts.perMinute.batched.p8 46 153.5 a minute at a slice of 100 against throughput.facts.perMinute.p8 7 417.1 one at a time, throughput.statements.perSlice.batched.p8 16.9 statements a slice. Inside a run, ctx.batch runs chunks of BATCH_DEFAULT_SIZE 500 items, at most BATCH_MAX_CONCURRENCY 8 in flight as one wave (ADR-0061), batch.perItem.chunk100.msPerItem 0.1 ms an item. The relay posts RELAY_BATCH 200 facts a request (packages/durable-core/src/events/relay.ts) |
| Size and retention | SQS 1,048,576 bytes a message, retention 60 s to 14 days (default 4); Pub/Sub 10 MB, retention 10 min to 31 days; Kafka message.max.bytes 1,048,588 and log.retention.hours 168; EventBridge's Custom bus 1 to 365 days; Step Functions 256 KiB an input, 90 days of history; Inngest 24 h / 7 d / 14 d / 90 d of history by plan; Trigger.dev 1 / 7 / 30 days of logs; Restate a 24 h journal |
A fact's stored payload at most MAX_EVENT_PAYLOAD_CHARS 256 000 characters (packages/durable-core/src/engine/ledger.ts, through the redaction policy); a step's input or output MAX_IO_CHARS 16 000 (an output past it refused for every effect but read, ADR-0060 decision 9); a run's stored input MAX_RESUME_INPUT_CHARS 64 000 (packages/durable-core/src/engine/run-store.ts); a relay request RELAY_MAX_BODY_BYTES 1 000 000 bytes; a console API answer ANSWER_BYTES_MAX 4 000 000 bytes (packages/durable-core/src/events/limits.ts, ADR-0076 FP-041: over it the bundle's and the run page's lists are cut in order and counted on truncated, a bare page keeps its newest rows that fit, an answer with no list to cut is 413, never the platform's 500 at 4.5 MB), one over ANSWER_BYTES_WARN 1 000 000 bytes said as console.api.large and counted. The windows (RETENTION, packages/durable-core/src/engine/retention-windows.ts; ADR-0026 as amended 2026-10-09): a delivered fact outboxDays 7, one a peer has not acknowledged outboxUnsentDays 30, a listener run listenerRunsDays 7, a completed unledgered run runsDays 14, a completed run's step rows stepsDays 90, a completed run's key idempotencyDays 30, RETENTION.batch 5000 rows a statement; a ledgered run and its ledger rows stay. A deployment sets other numbers through createDurable({ retention: { windows } }) |
| Fair queues | SQS fair queues: MessageGroupId as the tenant id, the in-flight share per tenant watched, quiet tenants served first when one backs up, no per-tenant cap and no tenant-count limit; Inngest concurrency scoped to a key |
Fairness between partitions is the dispatcher's lane order (ADR-0076 FP-025, 2026-10-12; SQS fair queues' shape: next in dispatchOutbox, packages/durable-core/src/events/outbox.ts): a pass delivers its groups in the window's order, DISPATCH_DEFAULTS.dispatchConcurrency 4 abreast and each sequential inside, and a partition whose claims in the pass pass the window's quota (ceil(limit × FAIR_SHARE), FAIR_SHARE 0.125 of packages/durable-core/src/events/limits.ts: 25 of the default DISPATCH_DEFAULTS.dispatchLimit 200) yields the next claim to the quietest partition the pass holds a row of; a pass whose full window was one partition's looks past it once (the same window read with the partitions it holds excluded, head-checked, its rows delivered first, said once as event.window_yielded), never a drop, never a second read of a row, no statement added for the share (the pass counts its own claims; DispatchResult.yielded and the tick's yielded), a partition pass never looking or yielding; no per-partition cap and no partition-count limit, as SQS's, and a stalled partition is still announced (FP-017). Measured on the throughput family's fairness case (1 000 facts in one hot partition, then one fact in each of 31 quiet partitions, drained at the default knobs): the quiet partitions' p95 emit-to-delivered 1 514.5 ms before on the laptop and throughput.fairness.quiet.p95Ms 282.5 ms after on the pool's EPYC 9V74 (36 ms on the laptop; the first pass claims 25 hot rows, looks past its full window once and delivers the 31 quiet rows ahead of the hot partition's remaining 175), pinned at 150 ms as the metric's first bound. Since ADR-0078 D06 (SR-006, 2026-10-13) the quota is a fairness group's: createDurable({ fairness: { group } }) names the group a partition's claims are counted under (the partition itself when none is bound, today's lane order byte for byte; the plane's tenantGroup the tenant:<id> prefix of the partition, the partition whole otherwise, so a tenant with a thousand noisy partitions holds one share of the window and yields to the quietest group's partition, the partition still the ordering unit, group on the event.window_yielded line), and a tenant's buckets stand at the two doors, createDurable({ quotas: { tenant, emit, start } }): the tenant resolved from the fact's or the run's scope (tenantOf, the prefix; null, nothing taken), one token taken from rate.tenant.<id>.emit at emit() and from rate.tenant.<id>.start at execute() before any row is written (one statement, the settings store's takeTokens), a take over the bucket a value and never an error ({ emitted: false, refused: "quota", tenant, bucket, retryAt }, said as event.quota_refused, a webhook route's 429 with Retry-After; { status: "refused", reason: "quota", runId: "", tenant, bucket, retryAt }, said as run.quota_refused), nothing on a door with no quota bound and nothing for the engine's own starts (a listener's run, a child, a resume, a redrive, a continuation, an operator action): SQS fair queues' MessageGroupId as the tenant, and a bucket per tenant where SQS caps nobody. Measured on the throughput family's tenant-group case (1 000 facts over 32 hot partitions of one tenant, then one fact in each of 31 quiet partitions of another, drained at the default knobs): the quiet tenant's p95 emit-to-delivered 591 ms under the fairness per partition (six passes a round, no yield: each hot partition under its own share) and throughput.fairness.group.quiet.p95Ms 75.5 ms under the group on the laptop (five passes, 31 yields a round), pinned at 1 200 ms, the partition row's floor, no per-CPU key |
| Throughput mode | SQS FIFO 300 TPS an API action (3,000 messages a second batched), high-throughput mode per message group up to 70,000 TPS in three Regions; EventBridge PutEvents 10,000 TPS, the Custom bus 500,000 events a second a bus; Cloud Tasks 500 dispatches a second a queue; Trigger.dev 1,500 API requests a minute |
One mode, measured (tests/bench/targets.json, each pin's measured; ADR-0052 decision 1): throughput.facts.perMinute.p1 4 947, throughput.facts.perMinute.p8 7 417.1 and throughput.facts.perMinute.p32 7 401 facts a minute one at a time, throughput.facts.perMinute.batched.p8 46 153.5 to a batch listener, burst.facts.perMinute.p32 3 791.6 from 32 wakes of 2 000 facts under inline with a batch wave beside them (FP-014); throughput.runs.perMinute.c1 706.2, throughput.runs.perMinute.c8 1 070.1 and throughput.runs.perMinute.c32 1 055.1 runs a minute; a ten-step run throughput.statements.perRun 12 statements under completion: "behind" and throughput.rows.perRun 12 rows. Postgres is the only store, a feature for the audit and a ceiling for raw throughput (overview) |
| Archive and replay | EventBridge an archive per bus for days or indefinitely, a replay over a window to named rules, the events marked replay-name, at most 10 replays at once; the Custom bus 1 to 365 days and a subscriber started from a past position; Kafka a group's offset rewound inside log.retention.hours 168; Pub/Sub seek over 31 days; Trigger.dev runs.replay on the latest version |
A delivered fact lives outboxDays 7 in the outbox and then archiveDays 30 in the archive tier (ADR-0076 FP-027, 2026-10-12, #619; EventBridge's shape): retention's delivered_events rule moves the rows it would delete into OutboxArchive in its one statement while archiveDays is above 0 (archivedAt the pass's moment, the row never in both tables or in neither; 0 is the archive off and 365 the most a deployment may bind, packages/durable-core/src/engine/retention-windows.ts), the store's eighth rule archive_expired deletes the archived rows whose own moment is past the window, oldest first, a batch at a time, and GET overview and GET workers carry archive (the rows, the oldest and newest archived moments, the two windows in force, a minute's copy). A window is replayed by the operator action event.replay { since, until?, listener?, partition?, execute?, requestId } (POST events/replay, the MCP events_replay, packages/durable-core/src/operator/replay-events.ts; at most 10 open at once, the eleventh refused by name): the window's delivered rows, the archive's first and then the live table's, are handed in (occurredAt, id) order to the listener named or to every listener of the row's event, each as a new run keyed listener.<name>:<outboxId>:replay:<requestId> over the row's own event with the payload's requestId under the replay: prefix, so every door keyed on the request starts afresh; an execute-policy listener runs under execute: true alone, a batch or debounced listener never, the rows themselves are untouched, a resend answers the same runs, each chunk a counts-only ledger row, 2 statements a replayed row. One row to one listener once more stays event.redeliver (POST events/:id/redeliver, keyed on the row, the listener and the request, ADR-0051 §12), a production run replayed on a laptop from its bundle durable-sdk replay (ADR-0051 §8), an unsent copy kept outboxUnsentDays 30 and a peer's deliveries re-marked unsent by relay.backfill (ADR-0053 decision 5) |
| Priority | Inngest priority.run, an integer of seconds in −600 to 600, a run moved ahead of runs queued within that many seconds, under a backlog alone; Trigger.dev priority, a seconds offset against your own runs |
A fact's priority is a seconds offset on its ordering moment alone (ADR-0076 FP-025, 2026-10-12; Inngest's shape): emit(name, payload, { priority }) and ctx.emit(…, { priority }) take an integer of seconds in −600…600 (PRIORITY_MAX_S 600 s, packages/durable-core/src/events/limits.ts), defineWorkflow({ priority }) is the default of a run's facts and on(…, { priority }) the listener's run's, each door refusing an offset off the grammar by name (emit.priority.bound, workflow.priority.bound, listener.priority.bound); the row's orderAt (occurredAt less the offset, the database's generated column of schema version 27) is what every read inside a partition orders and compares by (the window, the partition read, the slice's read, the head check, the claim's head predicate), so a fact emitted sixty seconds ahead stands before the rows of its partition that occurred within the minute and behind the older ones; the key, the delivery, occurredAt, the stuck read's age, the relay, retention and the console keep the row's own moment, nothing moves across partitions, a shared row keeps the first emit's offset and a relayed copy lands at 0; priority rides every event row of the console API (API 2.134) and the Events page's +60 s chip; a run's place under the cap is unchanged (a start parks in start order). Under a backlog alone, as Inngest's: an empty partition delivers its next row at once whatever the offset, and what a moved row gains is the throughput family's fairness case (throughput.fairness.quiet.p95Ms 282.5 ms on the pool, the quiet partitions' p95 beside a 1 000-row neighbour) |
| Debounce and throttle | Inngest debounce period 1 s to 7 d with a key, the last event wins; throttle limit per period with burst, the excess queued FIFO; rate limit GCRA, the excess skipped; Trigger.dev debounce { key, delay, mode leading or trailing, maxDelay }; Cloud Tasks max_dispatches_per_second up to 500 a queue with max_burst_size |
A provider's rate is a token bucket per account (rateLimit: { perSecond, burst } on the account, ADR-0052 decision 5): one conditional statement under the row lock a take (SettingsStore.takeTokens, rate.bucket.acquire.statements 1, rate.bucket.acquire.p95Ms 4.9 ms); a take over the bucket waits inside the step within the budget, then parks the run on a rate wait (RateLimited); a 429 lowers the bucket for the window named and halves its refill for RATE_HALVED_MS 60 s, a 429 without a window holding it RATE_HOLD_DEFAULT_MS 10 s (packages/durable-core/src/engine/rate-limit.ts). A batch listener's maxWait folds a burst of one event into one run, the nearest word to a debounce. debounce { key, period, mode, maxDelay } and throttle { limit, period, burst, key } on on() are FP-029's |
The visibility timeout, stated#
A queue hides a received message for a bounded time and lets the consumer extend it. Durable's analogue is two things, and a reader who looks for one number will not find it.
The first is the claim. A delivered row is claimed by one tick in one
compare-and-set (claimEvent, claimEvents for a slice: attempts + 1,
retryAt cleared, the row's partition judged as the head's in the same
statement). While the claim stands the row is invisible to every other
tick. The claim ends with the listener's outcome: a delivered mark, a
park (the run failed and waits in limbo), or a backoff after a transport
failure, retryAt = now + min(RETRY_BASE_MS × 2^attempts, RETRY_MAX_MS)
with RETRY_BASE_MS 15 s and RETRY_MAX_MS 600 s
(packages/durable-core/src/events/limits.ts; ADR-0041 item 15). A claim
whose tick died records no outcome; the next claim of the row finds the
charged attempt with retryAt null, writes the note that the attempt
recorded no outcome and goes on (deadClaimNote, FW-025), so a dead
tick costs the row one attempt and one tick, never a timeout a person
tunes. A claim is the tick's own: a listener run still going answers
in_progress, the claim is given back and the next tick asks again.
The second is the lease. A listener's run is an attempt under a lease of
LEASE_MS 890 s (app/lib/platform.ts, leaseMsFor(MAX_DURATION_S):
the function limit MAX_DURATION_S 800 s plus two heartbeats of
HEARTBEAT_S 45 s, the numbers time's), touched every
heartbeat, fenced on every write (a zombie that still writes meets
AttemptFenced), and capped by the kill the platform states: a stored
kill plus KILL_GRACE_MS 45 s claims the run again whatever its
heartbeat (ADR-0066 D08), a run nothing touched since its insert is
claimed at UNTOUCHED_CLAIM_MS 90 s (ADR-0076 FP-008). There is no
ChangeMessageVisibility: a step that needs longer than its invocation
parks the run on a continue wait at the boundary before it and
resumes in a fresh invocation (ADR-0066 D04; run.parked_before_kill),
which is the extension, and a wait of any kind holds no invocation at
all. The lease says who owns a run, never when a listener must be done.
Effectively-once, stated#
SQS FIFO sells exactly-once inside its dedup window at +25 %, Pub/Sub on
pull alone in one region, Kafka under read_committed, Step Functions
Standard per transition; every page adds that an external side effect
still needs its own key (C §"exactly-once"). Durable sells no mode. Its
word is effectively-once, and it is this:
- A fact is delivered at least once: a row is claimed until a listener
run records an outcome, up to
MAX_ATTEMPTS8 times. - A listener run is started at most once per key: the run's key is
listener.<name>:<outboxId>(a slice's its head's), the run and its key land in one statement, and a second claim finds the run. - A step's output is served from its row on every later attempt: a crash
after the row replays the answer and never re-runs the body
(
step.replay_missedthe warn for a row the memo cannot serve). - A provider write is an external step under a
writeKey(writeKey,packages/durable-core/src/engine/write-key.ts): its intent lands on the step row before the call, its ledger row after it, and the next attempt reconciles the intent from the landed row or from the world (RECONCILED), so the provider sees the write once where the intent's identity can be looked up (a label by its shipment, a send by its dedupe key) and twice where it cannot.
The second case is counted, never hidden. The double-run guard
(the workflow-replay guard, ADR-0060 decision 1; FW-015)
crashes every registered definition inside every step that writes a
provider or the warehouse and names each boundary the resumed attempt
writes again. Today the list stands at:
| List | Workflows | Inside boundaries |
|---|---|---|
DOUBLE_WRITES_ON_CRASH_INSIDE_STEP (its own entries) |
2 | 4 |
FLOOR_INSIDE_FINDINGS (spread into it) |
0 | 0 |
| Together | 2 | 4 |
FP-042 (ADR-0076 D01, 2026-10-13) took the lists from thirteen workflows
and thirty-three boundaries to these two: every raw MDM command is named
by its run's identity and looked up at the provider before it is sent
(commandSent), the phone's word on a row is reconciled with it, the
retire reads the lock off the record, the pickup doors write through the
primitive. What stands is said by decision: device.register rotates
the bearer a re-invoked registration mints (ADR-0041 item 11, the token
the first invocation's reply never carried), and mdm.app.configure's
push (mdm.app.config.push, its own step since the unit) is a command
no provider hands back, pushed again on a resumed attempt, the same
configuration delivered once more. The guard holds this table to the
file, so the count on this page is the tree's on the day it is read.
The primitives#
Each primitive as a queue user meets it: the verb, what its door refuses
(the ids of REFUSALS, packages/durable-core/src/refusals.ts;
durable-sdk explain <id> answers one offline), the store statement
behind it and what it costs, the costs the bench's pins in
tests/bench/targets.json.
The fact: emit#
- The verb:
emit(name, payload, { deliverAt? })outside a run (a webhook route'stoFacts, a request's door);ctx.emit(name, payload)inside a body, queued with the run's landing infinishRun's one statement, never inside a step, at mostEMIT_QUEUED_MAX10 000 a run;emitMany(facts, { actor })outside a run for a list (ADR-0011 amendment 2026-10-30): the one lightweight runemit.manylands the list in its finish's one statement under the key of the facts' catalog keys hashed in order, so a resend finds the run and inserts nothing, every fact judged at the door asemitjudges one and the list for its shape, its count, a key spelled twice and the stored size of the run's input (MAX_RESUME_INPUT_CHARS64 000: the run re-runs from it after a crash, so the list a call lands is what fits, about four hundred facts of a job fact's shape; thousands at once are a lightweight keyed run whose body derives them from a small input); a run that did not land is answered by its status as a value:in_progressa landing to wait for (a route answers 503),failedthe list in limbo under its key until the operator's redrive, every resend inserting nothing (the door takes noredrive). A name is a row of the host's catalog (defineEvents) with its key parts, its moments and its payload schema, judged at the door. - Refused:
emit.inside_step,emit.key.too_long,event.payload.invalidat the emit;emit.queued.maxat the queue;emit.many.shape,emit.many.max,emit.many.key_duplicate,emit.many.option.unknown,emit.many.options.shape,emit.many.input_bound,emit.many.input_secretat the list's door;catalog.key.missing,catalog.key.reads_clock,catalog.moment.undeclared,catalog.schema.part_optional,catalog.name.twice,catalog.unknownat the boot. - The statement:
OutboxStore.emit, insert-if-absent on the key and its read-back, two statements; then the wake, sent after the commit underkeepAliveand never awaited (aqueueorinlinewake first claimswake.<partition>by compare-and-set,throughput.wake.claimStatements.p322 statements a wake, ADR-0076 FP-022). - The cost: a fact whole on the
inlinepath is 14 statements, the emit's two and the drain'sevent.wake.statements11 (exact; ADR-0076 FP-010 and FP-019: the dispatcher's 5 and the threerun.failedlisteners' runs the bench's failing fact starts, a create and a finish each, the core's auto-redrive among them since ADR-0084),event.wake.inline.emitToDelivered.p95Ms159.7 ms. A run's facts land in one statement whatever their number and wake once per distinct partition: a lightweight run queuing 1 000 or 10 000 facts across eight partitions sendsthroughput.emit.statements.manyFacts2 statements (exact: the create with its key and the finish carrying the insert as its CTE), landingthroughput.emit.facts.perMinute.run626 933.9 a minute at 10 000 a run (a laptop reading under load, a provisional pin until the pool's run; the same two statements for anemitManyof four hundred on the reference store,tests/pg/emit-many.pg.test.ts), against two statements and a wake attempt a fact throughemit.
The listener: on#
- The verb:
on(event, name, body, { relay, describe, batch?, lightweight? }), a keyed workflowlistener.<name>started once per row (or per slice) under the row's partition; its outcome a value (ListenerOutcome), a throw transport that backs the row off. A batch listener may be lightweight (ADR-0052 decision 3 as amended 2026-10-30; ADR-0076 FP-038): one run row and its key a slice, no step row, the shape for one idempotent handler that changes nothing worth imaging. A listener withoutbatchregistered beside a batch listener receives each row of the slice as its own run, in order, inside the slice's delivery, and a row it failed on parks alone, its own run named, while the rows whose reactions completed are delivered, in the one mark statement: one bad message parks alone, as a value, with its run, today, at the per-row listener's cost. The slice has no ceiling at the door (listener.batch.max_sizerefuses a non-integer or a value under 1 alone). Inside a partition no slice is claimed while the one before it runs: a slice is contiguous from the head and the claim judges the head rule, so delivery pipelines across partitions alone (DISPATCH_DEFAULTS.dispatchConcurrency4 abreast in a lane), and a prefetch of the next window during the current run is the one admissible form, a read's latency a slice and no statement. - Refused:
listener.describe.missing,listener.option.unknown,listener.option.alias,listener.batch.shape,listener.batch.max_size,listener.batch.max_wait,listener.batch.second. - The statements: a pass's one ordered read of the partition
(
fetchPartition), the claim (claimEvent,claimEvents), the open waits' one read (findWaitsFor, FW-037), the listener run's insert with its key and its finish, then the mark (deliverEvent,deliverEvents,parkEvents,backoffEvent,backoffEvents,releaseEvents). - The cost:
throughput.statements.perFact.p812.1 statements a fact at eight partitions on the pin's run (a laptop read 5 after FP-010 and FP-019, the next develop bench re-measures it);throughput.statements.perSlice.batched.p816.9 a slice of 100, andthroughput.statements.perSlice.batched.lightweight.p88.4 a slice of 100 to the lightweight twin (a laptop reading under load, a provisional pin until the pool's run, as are the four rates that follow); wider slicesthroughput.facts.perMinute.batched.p8.s500946 406.1 andthroughput.facts.perMinute.batched.p8.s10001 028 711.3 a minute at one full slice a partition; the one-at-a-time backlog drained 8 and 16 partitions abreast in one lanethroughput.facts.perMinute.p8.c860 141 andthroughput.facts.perMinute.p8.c1666 009.1 a minute (four laptop runs disagree on the direction, sixteen over eight by a tenth to a fifth on three and under it on one at load 56, 49 619 against 46 750, a spread as wide as the gap: at eight partitions a pass holds the eight whatever the knob, and no gain is claimed for sixteen until the pool's run); the tick that finds nothingevent.tick.empty.statements10 (exact, ADR-0076 FP-024) atevent.tick.empty.p95Ms75.8 ms.dispatchLanesis not benched: a lane is a separate HTTP invocation and every pin here runs the dispatcher in the test process.
The partition#
- The verb: none at the emit; the rule is the configuration's,
createDurable({ partition }), read at the insert and stored on the row; the catalog's descriptor may name apartitionof its own. - Refused: nothing at a door; a bad key is the catalog's (
catalog.*). - The statements: the bounded stuck query (
stuckWhere, at mostSTUCK_PARTITIONS_MAX5 000 names), the ordered read per pass (fetchPartition), the stall check'soldestLivePerPartitiononce per tick that saw rows and its claim ofpartition.stalled.<partition>throughclaimWindow(FP-017). - The cost: a one-fact wake
event.wake.statements11; an empty wake 2 (ADR-0076 FP-010); a stalled partition one fact an hour.
The delay#
- The verbs:
emit(name, payload, { deliverAt });ctx.cancelScheduled(key)inside a step anddurable.cancelScheduled(key, { actor })outside one (the answer a value:cancelled,delivered,absent,not_scheduled);ctx.sleep,ctx.sleepUntil;defineWorkflow({ schedule }). - Refused:
step.cancel_scheduled_outside_step;wait.duration.not_string,wait.duration.grammar,wait.duration.not_positive,wait.moment.invalid;schedule.missing,schedule.both,schedule.every.grammar,schedule.every.under_minute(a period under a minute where the platform holds no wake inside it),schedule.every.sub_minute_floor(a period under 10 s anywhere, ADR-0076 FP-036),schedule.slot_not_in_key,schedule.tz.not_utc,schedule.catch_up,schedule.input.threw. - The statements:
deliverAtrides every due predicate of the store (deliverAt IS NULL OR deliverAt <= now); a sleep isparkRun(RUNNING to WAITING and the wait row in one fenced transaction),listDueWaitsandclaimWaitingat the moment; a schedule's slot is recorded onschedule.<workflow>by compare-and-set, and a schedule below the minute (every: "10s"and up where the platform sayssubMinute, ADR-0076 FP-036) is the coming minute's slots emitted at one tick as delayed facts, each delivered at its moment by the queue's delayed wake. - The cost: a park is one transaction and no function; the precision
WAKE_MAX_DELAY_S120 s then the cron minute;wait.sleepToResumed.p95Ms5 013.6 ms for a 5 s sleep on the queue path.
The backoff, the dead-letter path and the redrive#
- The verbs: the ladder, automatic; then the console's:
event.reset(POST events/:id/reset, orevents/resetforBULK_RESET_MAX500 ids a request),event.dismiss(BULK_DISMISS_MAX500),event.redeliver,run.redrive(withinvalidateto undo named steps first),runs.redrive(BULK_REDRIVE_IDS_MAX5 000 ids asrun.redrive.requestedfacts, one keyedrun.redriveper id),run.dismiss,runs.scrub; each anoperatorAction(), keyed per target and request, ledgered, undoable. - Refused: an action answers
not_foundorrefusedas a value;execute.redrive_ticket,execute.invalidate_not_redrive,execute.accept_version_not_redrive,execute.accept_version_mismatchguard the redrive's door. - The statements:
backoffEventandbackoffEvents, theevent.exhaustedfact inserted in the final backoff's own statement (FP-007);resetEvent, a compare-and-set on the attempts the person saw;restoreEventthe undo;listExhausted;setSentMarkfor the relay. - The cost: 30, 60, 120, 240, 480, 600 and 600 s between the eight claims; a reset one keyed, ledgered run.
The key: the idempotent start#
- The verb:
defineWorkflow({ key: ["shop", "orderId", "requestId"] })or a pure function of the input;execute(input, { requestId, actor, client, awaitMs, signals, secrets }); the same key answers the stored run (reused: true), the moment rides in the input asrequestId. - Refused:
workflow.key.empty,workflow.key.reads_clock,workflow.key.secret_part,execute.key_not_string,execute.key_reused,input.unstorable,execute.tags_invalid,execute.secrets.shape,execute.signal_name. - The statement:
beginRun's one, the key's insert gating the run's (KeyCollisionas a value before any run exists;keyOwnersfor the console's read). - The cost:
throughput.statements.perRun12 for a ten-step run undercompletion: "behind"(22 under the default) andthroughput.rows.perRun12 rows;throughput.runs.perMinute.c1706.2 runs a minute from one starter.
The wait#
- The verbs:
ctx.waitFor(name, { match, deadline | forever: true }),ctx.waitForApproval({ token }),ctx.child(workflow, input),ctx.poll(name, fn, { every, until }); from outside,run.signalby id or by key (runs/:id/signal,runs/signal),execute(input, { signals })for a signal that arrives with the start,run.wakefor a timer fired early. - Refused:
wait.bound,wait.match.redacted,wait.moment.invalid,wait.outside_step,wait.woken_open,wait.child_not_reverted,wait.hold_row_outcome;run.wake.not_waiting,run.wake.not_a_timer,run.wake.already_fired. - The statements:
createWaitandparkRun; the dispatcher'sfindWaitsForon a matching local fact, paged;fireWait, a compare-and-set onfiredAt IS NULL; the look-back at the park overOutboxStore.findDelivered, clamped tooutboxDays7. - The cost: a park one transaction, a fire one statement; the wake within
seconds inside
WAKE_MAX_DELAY_S120 s and the cron minute beyond.
The concurrency cap#
- The verb:
defineWorkflow({ concurrency: { max, key? } }); the match<workflow>[:<key>]on the run row. - Refused:
workflow.concurrency.shape,workflow.concurrency.max,workflow.concurrency.key_not_function,execute.concurrency_key_not_string. - The statements: the store's counting insert under a mutex on the match;
a start over the cap parks on a
slotwait before any step; every landing releases the slot and admits the oldest waiter (admitSlot), a redrive count-checked the same (redriveUnderCap). - The cost:
throughput.runs.perMinute.capped.c32298.8 runs a minute at a cap of 8 under 32 starters againstthroughput.runs.perMinute.c321 055.1 uncapped: the cap keeps eight on the pool and the hand-off costs a park, a fire, a wake and a claim a run.
The rate bucket#
- The verb:
rateLimit: { perSecond, burst }on the connector's account,acquireTokenonce inside the client's request function above its onefetch,reportLimitedon a 429 or aRetry-After. - Refused:
rate.per_second,rate.burst,rate.key.parts,rate.tokens,rate.tokens.over_burst,settings.take_tokens.duplicate_key. - The statement:
SettingsStore.takeTokens, the refill, the predicate and the debit in oneINSERT … ON CONFLICT DO UPDATE … WHERE(FW-086); the bucket one settings row per account,rate.<connector>.<account>. - The cost:
rate.bucket.acquire.statements1 (exact),rate.bucket.acquire.p95Ms4.9 ms a take,rate.bucket.acquire.c32.p95Ms505.3 ms under 32 takers; a refused take waits inside the step within the budget and then parks the run on aratewait.
The batch step#
- The verb:
ctx.batch(name, items, body, { size, concurrency, needs, ledger }), the chunks as rows<name>#<n>, the wave parked between chunks at the budget and never into the kill. - Refused:
batch.size,batch.concurrency,batch.concurrency.max,batch.declares,batch.ledger.mode,batch.needs.exceeds_invocation,batch.output.truncated,batch.output.redacted,batch.retry,batch.wave.open,batch.record_outside_chunk. - The statement: a chunk's images land in one fenced
appendEntriesflush at the chunk's end (ADR-0052 decision 4). - The cost:
batch.perItem.chunk100.msPerItem0.1 ms an item,batch.ledger.chunk100.msPerItem0.2 ms an item with its ledger row; chunks ofBATCH_DEFAULT_SIZE500, at mostBATCH_MAX_CONCURRENCY8 abreast.
Cancel, hold and resume#
- The verbs:
run.cancel,run.hold,run.resume(runs/:id/cancel,/hold,/resume),runs.scrub; inside a bodyi.stopinto every call andi.yield()on every turn of a loop. - Refused:
run.hold.in_limbo,run.hold.completed,run.hold.undone,run.resume.not_held,run.resume.landed. - The statements: a flag on the run row (
patchRun), read at every step boundary through the fenced step insert; the attempt endsCancelledand compensates, a held run parks on aholdwait with nothing undone. - The cost: the latency is a heartbeat,
HEARTBEAT_S45 s, the cancel's and the hold's (time); a call in flight ends within it.
The external write#
- The verbs:
defineExternalStep,recordedWrite,recordedRowWrite, each under awriteKey(base, id?); a step declarescompensateorirreversible: "<reason>", never neither and never both. - Refused:
write.outside_step,step.write_key.shared,write_key.base,write_key.id,write_key.too_long,write.compared.undefined,step.pending_write.unreached,external.desired_carries_provider_id,step.undo.declares,step.undo.both,step.undo.blank,step.undo.reason,step.undo.effect. - The statements: the intent on
WorkflowStep.pendingbefore the call, the ledger row after it (ledger.append.statements1, exact: the one write statement under the head memo, no read, ADR-0076 FP-023 as amended 2026-10-30; one read and one write statement before it), the reconcile on the next attempt from the landed row or the world. - The cost:
ledger.append.uncontended.p95Ms4.3 ms (p50 3.7 ms) andledger.append.8way.p95Ms69.2 ms with eight writers on develop's bench run 40945075490 of 2026-10-29 (the pins'latest, never typed; the floors 40 and 510 ms).
Retention#
- The verb:
retention.apply, scheduled on its definition and run by the tick'sschedulestask; a host's tables asHostRetentionRules bound throughcreateDurable({ retention: { rules } }). - Refused:
durable.retention.windows,durable.retention.rule.name,durable.retention.rule.days,durable.retention.rule.prune,durable.retention.rule.reserved,durable.retention.rule.twice,durable.retention.keep_unsent,durable.retention.schedule. - The statements:
RetentionStore.prune, one boundedDELETE … WHERE <pk> IN (SELECT … LIMIT batch)per rule atRETENTION.batch5000 rows, the run rules taking their keys in the same statement. - The cost: one pass a day; the windows the "Size and retention" row's.
What a queue user must still do#
- Key the external side effect. At-least-once delivery means a
listener body may run twice; a provider write inside it is an external
step under a
writeKeywhose read phase can find what the write landed (a label by its shipment, a message by its dedupe key, an order by the id the provider lets you set), so the next attempt reconciles instead of writing again; a write with no such lookup isirreversiblewith its reason and counted on the double-run guard's list until it has one. Every page of every platform says the same in its own words. - Choose the partition key. The partition is the ordering and the
one-in-flight unit: a key per job, order or customer keeps the rest
moving while one is held; a coarse key (
shop:<shop>, a schedule's name) serialises everything under it, and a stuck head starves its partition untilpartition.stallednames it (FP-017). A wait row is never a partition's head. The host's keys and the reasons for the coarse ones are in docs/runbook.md "The partition keys". - Keep the moment out of the key. A fact's key and a workflow's key
are pure functions of the payload or the input: the moment rides as a
requestId, a webhook's id or the cause's own stamp, so a resend collapses and a retry finds its run. - Read the retention windows before you promise a replay. A delivered
fact is gone after
outboxDays7, a peer's unsent copy afteroutboxUnsentDays30, a listener run afterlistenerRunsDays7, a completed unledgered run afterrunsDays14 and its steps afterstepsDays90; a ledgered run and its ledger rows stay. A replay pastoutboxDaysreads the archive tier,archiveDays30 (FP-027, landed 2026-10-12: a delivered row moves there instead of going); a deployment that needs other numbers bindscreateDurable({ retention: { windows } }). - Pass the stop and declare the need.
i.stopinto every call,needson a step that holds longer than the default, a batch for work past one invocation: the function's kill is the budget and a wait parks the run (time).
Sources#
The platforms' figures were read on 2026-10-12 from
https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/
(SQS), https://docs.aws.amazon.com/eventbridge/latest/userguide/ and
https://docs.aws.amazon.com/scheduler/latest/UserGuide/ (EventBridge,
the Custom bus, Scheduler),
https://docs.aws.amazon.com/step-functions/latest/dg/ (Step Functions),
https://kafka.apache.org/43/ and the Apache repository's
docs/design/design.md (Kafka), https://docs.cloud.google.com/pubsub/docs/
and https://docs.cloud.google.com/tasks/docs/ (Pub/Sub, Cloud Tasks),
https://www.inngest.com/docs/ (Inngest), https://trigger.dev/docs/
(Trigger.dev) and https://docs.restate.dev/ (Restate); a price a vendor
renders in the browser alone is quoted as the gap report named it. The
figures are the pages' on that date and move with the vendors; Durable's
move with the tree and are held by the guard.