@lesto/workflows
v0.1.7
Published
Lesto's in-house resumable step memoization on a SQL database — completed steps replay on caller-driven re-invocation (not crash-safe durable execution; a run journal + resume driver is post-1.0).
Downloads
338
Readme
@lesto/workflows
Resumable step memoization on your SQL database.
Part of Lesto, the batteries-included, agent-native fullstack framework.
bun add @lesto/workflowsimport { Engine, installWorkflowSchema } from "@lesto/workflows";
installWorkflowSchema(db);
const engine = new Engine({ db });
engine.define("checkout", async (input, ctx) => {
const charge = await ctx.step("charge", () => chargeCard(input.card));
const receipt = await ctx.step("receipt", () => emailReceipt(charge));
return receipt;
});
// Re-invoking with the same runId REPLAYS completed steps instead of re-charging.
await engine.run("checkout", "order-42", { card: "tok_abc" });Boundary: this is step memoization, not crash-safe durable execution.
Resume is caller-driven — your app re-invokes run() with the same runId to
continue an interrupted run; there is no run journal or scheduler (deferred
post-1.0).
