Build multi-step serverless workflows with delays, conditional logic and coordinate between events. Ship complex functionality in a fraction of time.
1createStepFunction("Post-signup", "user/created",
2 function ({ event, tools }) {
3 // Send the user an email
4 tools.run("Send an email", async () => {
5 await sendEmail({
6 email: event.user.email,
7 template: "welcome",
8 });
9 });
10
11 // Wait for the user to create an order, by waiting and
12 // matching on another event
13 const order = tools.waitForEvent("order/created", {
14 match: ["data.user.id"],
15 timeout: "24h"
16 })
17
18 if (order === null) {
19 // User didn't create an order; send them a activation email
20 tools.run("Send activation", async () => {
21 // Some code here
22 })
23 }
24 }
25);
1const seenEvent = tools.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.
1tools.run("Do something", () => { ... })
2
3// Pause the function and resume in 2d
4tools.sleep("2d")
5
6tools.run("Do something later", () => { ... })
Add delays within your step function enabling you to build jobs that pause and resume over multiple days.
1const result = tools.run("Send customer outreach", () => { ... })
2
3if (result.requiresFollowUp) {
4 const result = tools.run("Add task to Linear", () => { ... })
5} else {
6 const result = tools.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.
We're testing step functions as a closed beta. If you want get early access and provide feedback to help shape the future of Inngest, get in touch with the team: