Skip to content
Trigora
Start building →

Events

waitForEvent("approved") suspends until a matching event arrives. Send it with the CLI or the client.

Terminal window
trigora send <execution-id> approved
trigora send <execution-id> approved --payload '{"reviewer":"ada"}'
trigora send <execution-id> approved --remote

This command targets trigora dev by default. Add --remote to target Trigora Cloud.

await trigora.sendEvent(executionId, "approved", { reviewer: "ada" });

The payload becomes the value waitForEvent returns. The event name must be a string literal in the Program. event("approved") is an optional typed helper. A plain string is enough.

While the Execution is suspended, its public wait record has this structure:

{ type: "event", event: "approved" }

Sending an event to an Execution that is not waiting on that name fails with event_mismatch. The Execution stays where it was. See waitForEvent.