Pauses the workflow until a signal with the given signalId is received.
The workflow suspends durably — it survives process restarts and will
resume exactly once when the matching signal() call delivers data.
condition is the receive side of the signal coordination pair.
The send side is signal(), which can be called from another
workflow, a hook function, or externally via Durable.Client.workflow.signal().
On replay, condition returns the previously stored signal payload
immediately (no actual suspension occurs).
// Paired with hook: spawn work and wait for the result exportasyncfunctionorchestrator(input: string): Promise<string> { constsignalId = `result-${Durable.workflow.random()}`;
// Spawn a hook that will signal back when done awaitDurable.workflow.hook({ taskQueue:'processors', workflowName:'processItem', args: [input, signalId], });
// Wait for the hook to signal completion returnawaitDurable.workflow.condition<string>(signalId); }
Type Parameters
T
The type of data expected in the signal payload.
Parameters
signalId: string
A unique signal identifier shared by the sender and receiver.
Optionaltimeout: string
Optional duration (e.g., '30s', '5m', '1h'). Returns false on timeout.
Pauses the workflow until a signal with the given
signalIdis received. The workflow suspends durably — it survives process restarts and will resume exactly once when the matchingsignal()call delivers data.conditionis the receive side of the signal coordination pair. The send side issignal(), which can be called from another workflow, a hook function, or externally viaDurable.Client.workflow.signal().On replay,
conditionreturns the previously stored signal payload immediately (no actual suspension occurs).Examples