Inngest

From InugamiDev/ultrathink-oss · View interactive version

Inngest is an AI agent skill from the GitHub repository InugamiDev/ultrathink-oss. > Durable workflow engine — event-driven background jobs, retries, scheduling, and step functions.

How to use this skill

Skill file

Inngest

Durable workflow engine — event-driven background jobs, retries, scheduling, and step functions.

When to Use

Core Patterns

Basic Function

import { Inngest } from "inngest";

export const inngest = new Inngest({ id: "my-app" });

export const syncUser = inngest.createFunction(
  { id: "sync-user", retries: 3 },
  { event: "user/created" },
  async ({ event, step }) => {
    const profile = await step.run("fetch-profile", () =>
      fetchProfile(event.data.userId)
    );
    await step.run("sync-to-crm", () => syncToCRM(profile));
    return { synced: true };
  }
);

Step Primitives

inngest.createFunction(
  { id: "onboarding-flow" },
  { event: "user/signup" },
  async ({ event, step }) => {
    await step.run("send-welcome", () => sendEmail(event.data.email));
    await step.sleep("wait-1d", "1 day");
    const opened = await step.waitForEvent("wait-for-open", {
      event: "email/opened",
      match: "data.userId",
      timeout: "3 days",
    });
    if (!opened) await step.run("send-nudge", () => sendNudge(event.data.email));
  }
);

Cron & Throttling

// Cron schedule
inngest.createFunction(
  { id: "daily-report" },
  { cron: "0 9 * * *" },
  async ({ step }) => { await step.run("generate", () => buildReport()); }
);

// Throttle: max 10 per user per hour
inngest.createFunction(
  { id: "send-notification", throttle: { key: "event.data.userId", count: 10, period: "1h" } },
  { event: "notify/send" },
  async ({ event }) => { /* ... */ }
);

Framework Serve (Next.js)

import { serve } from "inngest/next";
import { inngest } from "@/lib/inngest";
import { syncUser, onboardingFlow } from "@/inngest/functions";

export const { GET, POST, PUT } = serve({ client: inngest, functions: [syncUser, onboardingFlow] });
// Mount at app/api/inngest/route.ts

Key Features

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.