waitForEvent
Signature
Section titled “Signature”function waitForEvent<TPayload>( eventOrName: EventDefinition<TPayload> | string, options?: { timeout?: string | number; match?: Record<string, unknown> },): Promise<TPayload>def wait_for_event(name: str) -> objectThe TypeScript options object is part of the SDK type. The operation you can rely on for Cloud and trigora dev is the event name: trigora send <id> <name> resumes that wait. A send for a different name returns event_mismatch.
Parameters
Section titled “Parameters”eventOrName— a string literal, orevent("approved")from@trigora/sdk.- Python takes the name string only.
Return value
Section titled “Return value”The JSON payload of the sent event. Omit --payload and the payload is empty.
Durable semantics
Section titled “Durable semantics”The Execution commits the wait and leaves running. Status becomes waiting with { type: "event", event }. No compute is held. Recovery restores that wait. It does not replay earlier effects.
Failure
Section titled “Failure”- An empty name throws.
- A send while the Execution is not waiting on that name fails with
event_mismatch. - Outside an Execution, the call throws.
Example
Section titled “Example”const review = await waitForEvent("approved");trigora send <execution-id> approved --payload '{"ok":true}'