Ask for what is missing
When a run lacks a fact it needs, it asks the one person who has it with a form for just that field, then continues.
The situation
An order arrives without a delivery phone number. Failing the run loses the order; guessing ships it wrong. The person who placed it can answer in ten seconds if someone asks them.
The recipe
import { Durable } from '@hotmeshio/hotmesh';import { conditional, type LTEnvelope } from '@hotmeshio/long-tail';
export async function fulfilOrder(envelope: LTEnvelope) { const { orderId, placedBy } = envelope.data; let phone: string | undefined = envelope.data.phone;
if (!phone) { const { workflowId } = Durable.workflow.workflowInfo(); const answer = await conditional<{ phone: string }>(`missing-phone-${workflowId}`, { role: 'customer-contact', assignee: placedBy, description: `Order ${orderId} needs a delivery phone number`, metadata: { orderId, form_schema: { title: 'Delivery phone', required: ['phone'], properties: { phone: { type: 'string', format: 'tel', description: 'Number the carrier can call' } }, }, }, timeout: '48h', }); if (!answer) return { data: { orderId, status: 'held' } }; phone = answer.phone; }
return { data: { orderId, phone, status: 'ready-to-ship' } };}assignee places the row straight into one person’s list. The form asks for the single field the run is missing, and the answer validates before it reaches the workflow.
The guarantee
The run pauses durably on the gap instead of failing, the request reaches exactly one person, and the deadline returns false if nobody answers. See conditional.
Related patterns
Identity
One-time user
Route one item to one named person with a self-scoped membership; they see and answer exactly that form and nothing else in the queue.
The escalation boundary
Answer, timeout or cancel
Every wait ends in one of three typed values: the answer, false on timeout, or null on cancel. Each branch is explicit in code.
The escalation boundary
Pin the form edition per row
Each row renders and validates against the form version its code was written for, while the role's form keeps evolving.
