Quickstart
The first useful Trigora program is ordinary TypeScript with a few durable operations.
import { effect, waitForEvent } from "@trigora/sdk";
export async function order(input: Order) { const payment = await effect("payment", () => charge(input) );
const approval = await waitForEvent("approved");
return fulfill(payment, approval);}The point is not the syntax. It is this loop:
- Start an execution of
order. - The payment effect commits.
- The program waits. No compute is held.
- Kill the runtime.
- Start it again. Recovery restores the execution at the wait — it does not charge again.
- Send
approved. The program continues and returns.
That is the product. If a future API cannot be taught in this loop, the API is wrong.
The intended client shape:
const run = await trigora.start(order, input);
// later, after restoreawait run.send("approved", { reviewer: "omar",});Next: Programs · Executions