Resolve a set, all or none
Each row in a set resolves with its own payload in one statement, waking each workflow with its own value, or nothing resolves.
The situation
A dispatcher pairs three parts with three stations and must hand each station its own instruction. If one station’s row was cancelled meanwhile, sending the other two would split the job.
The recipe
const result = await lt.escalations.resolveAllOrNone({ items: [ { id: 'esc-a', resolverPayload: { partId: 'P-1', recipe: 'r-left' } }, { id: 'esc-b', resolverPayload: { partId: 'P-2', recipe: 'r-right' } }, { id: 'esc-c', resolverPayload: { partId: 'P-3', recipe: 'r-center' } }, ], metadata: { outcome: 'dispatched' }, requireClaimed: true,});
if (result.status === 409) { // nothing resolved; result.data.failed names each blocking row and its reason}requireClaimed asserts, inside the same statement, that every row is still assigned to the caller. The shared metadata patch lands on every row.
The guarantee
All listed rows resolve, each waiter woken with its own payload, or none do. A 409 lists only the rows that blocked (not-found, already-resolved, already-cancelled, already-expired, assignee-mismatch, unsupported-resolution-path); the rest stay pending and untouched for a retry. One schema violation blocks the whole set. Up to 100 items per call. See Faceted routing.
Related patterns
The queue as a market
All-or-none claim
Claim exactly N rows or none. A dispatcher that needs four free stations either locks four or locks nothing and tries again.
The queue as a market
Two-sided dispatcher
Demand and supply are both rows. A dispatcher counts free supply, claims that much demand, locks the supply all-or-none, and pairs them.
The queue as a market
Claim complete groups
A consumer claims whole orders, every unit at once, and only orders whose units have all arrived. No order is ever split across consumers.
Resolving from anywhere
One contract, one 422
Every resolve surface rejects a bad payload with the same 422 body naming each field, so every client handles validation one way.
