Build multi-step serverless workflows with delays, conditional logic and coordinate between events. Ship complex functionality in a fraction of time.
1inngest.createFunction(
2 { name: "Post-signup" },
3 { event: "user/created" },
4 async ({ event, step }) => {
5 // Send the user an email
6 await step.run("Send an email", async () => {
7 await sendEmail({
8 email: event.user.email,
9 template: "welcome",
10 });
11 });
12
13 // Wait for the user to create an order, by waiting and
14 // matching on another event
15 const order = await step.waitForEvent("order/created", {
16 match: ["data.user.id"],
17 timeout: "24h"
18 })
19
20 if (order === null) {
21 // User didn't create an order; send them a activation email
22 await step.run("Send activation", async () => {
23 // Some code here
24 })
25 }
26 }
27);
1const seenEvent = await step.waitForEvent("app/user.seen", {
2 match: ["data.email"],
3 timeout: "2d",
4});
Create dynamic workflows based on multiple events without having to keep state and poll for updates.
1await step.run("Do something", () => { ... })
2
3// Pause the function and resume in 2d
4await step.sleep("2d")
5
6await step.run("Do something later", () => { ... })
Add delays within your step function enabling you to build jobs that pause and resume over multiple days.
1const result = await step.run("Send customer outreach", () => { ... })
2
3if (result.requiresFollowUp) {
4 const result = await step.run("Add task to Linear", () => { ... })
5} else {
6 const result = await step.run("Mark task complete", () => { ... })
7}
Use the result of steps to determine if or what step should run next.
Build cross-channel onboarding, drip, re-activation campaigns to your team's custom needs.
Use events from Zendesk, Retool, Intercom to build automate tedious steps for your team.
Enrich, process, and forward event data into any destination imaginable.