v0.8.0
v0.8.0: Steps
This release of the SDK adds step functions to your serverless event-driven code. Using the new tools, you can create steps, sleep, and coordinate between events in your regular serverless functions hosted on any platform. For example:
import { createStepFunction } from "inngest";
const logic = createStepFunction("My complex logic", "user/created", ({ event, tools }) => {
const to = event.user.email;
tools.run("Send welcome email", () => {
// This step will run and retry independently of the rest of the code if it errors.
email({ to, type: "welcome" });
});
tools.sleep("24h");
tools.run("Send followup email", () => {
email({ to, type: "followup" });
});
});