Introduction to Inngest

Inngest is an open source platform that adds superpowers to serverless functions.

Using our SDK, a single line of code adds retries, queues, sleeps, cron schedules, fan-out jobs, and reliable steps to serverless functions in your existing projects. It's deployable to any platform, without any infrastructure or configuration. And, everything is locally testable via our UI.

Learn how to get started:

A small but powerful example

Adding sleeps, retries, and reliable steps to a function:

import { Inngest } from "inngest";

type UserSignup = {
  name: "user/new.signup",
  data: {
    email: string;
    name: string;
  }
}

const inngest = new Inngest<{ "user/new.signup": UserSignup }>({ name: "My app" })

export default inngest.createStepFunction("Signup flow", "user/new.signup", ({ event, tools }) => {
  // If this step fails it will retry automatically.  It will only
  // run once if it succeeds ⚡
  const promo = tools.run("Generate promo code", async () => {
    const promoCode = await generatePromoCode();
    return promoCode.code;
  });

  // Again, if the email provider is down this will retry - but we will only
  // generate one promo code ⚡
  tools.run("Send a welcome promo", async () => {
    await sendEmail({ email: event.data, promo });
  });

  // You can sleep on any platform! 😴
  tools.sleep("1 day");

  // This runs exactly 1 day after the user signs up ⏰
  tools.run("Send drip campaign", async () => {
    await sendDripCampaign();
  });
})

In this example, you can reliably run serverless functions even if external APIs are down. You can also sleep or delay work without configuring queues. Plus, all events, jobs, and functions are strictly typed via TypeScript for maximum correctness. Here's how things look when you locally run:

SDK UI

Comparisons

Without Inngest, you would have to configure several jobs amongst several different queues, then handle retries yourself. There's also a chance that many promo codes are generated depending on the reliability of that API. With Inngest, you can push this function live and everything happens automatically.

Resources and help

If you have any questions we're always around in our Discord community or on GitHub.