Know who resolved it
The resolver's identity rides the wake as $resolution and lands on the row as resolved_by, so follow-on work can go to the same person.
The situation
The person who approved an order should also pack it. The workflow needs the approver’s user id from the resolve itself, not from a second lookup that can race.
The recipe
import { conditional, type EscalationResolution } from '@hotmeshio/long-tail';
const decision = await conditional<{ approved: boolean; $resolution?: EscalationResolution }>(signalId, { role: 'order-reviewer', metadata: { orderId },});
if (decision && decision.$resolution) { const { escalationId, resolvedBy, resolvedByEmail } = decision.$resolution; await assignPacking({ orderId, userId: resolvedBy });}/escalations/available?status=resolved&facets={"resolved_by":"{lt:me}"}&orderBy=[{"field":"resolved_at","direction":"desc"}]Declare $resolution in the generic to read it. The same resolve merges resolved_by into the row’s GIN-indexed metadata, which the built-in {lt:me} link variable reads.
The guarantee
$resolution carries escalationId, resolvedBy and resolvedByEmail when known. It rides the signal only: the stored resolver_payload keeps the form payload untouched. Every completing resolve records metadata.resolved_by, including batch fills, both rows of an accumulate add and scan acts. See Conditional.
Related patterns
The escalation boundary
Born-assigned hand-off
The next row is created already assigned to a named person, in the same write that creates it. It lands in their list with no claim step.
Resolving from anywhere
Intent on create, outcome on resolve
The row is created with the facets that route it and resolved with the facets that describe what happened. One row answers both questions.
Forms and configuration
Link variables
One pinned link serves every station: a role declares a variable, each device binds its value, and the link resolves at render time.
Identity
Initiator and principal
A run records who asked and who executes as separate facts, so a service account can do the work while the audit still names the person.
