Skip to content

Resolve a set, all or none

Resolving from anywhereHTTPSDKresolveAllOrNonerequireClaimed

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

services/dispatch.ts
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.