Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when upgrading an existing TypeScript codebase from Inngest SDK v3 to v4, or when fixing mixed v3/v4 API usage. Covers detecting current SDK usage, moving triggers into createFunction options, replacing EventSchemas with eventType/staticSchema, moving serve options to the client, updating realtime imports, rewriting step.invoke string IDs, checkpointing/serverless runtime settings, Connect option changes, and verification.
.claude/skills/asymmetric-al-inngest-v3-v4-migration/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | 82% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 57% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 71% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 107% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 108% | 0% |
Use this skill when the user asks to upgrade Inngest, fix v3/v4 errors, migrate realtime, or clean up a codebase that has mixed SDK patterns.
Primary reference: https://www.inngest.com/docs/reference/typescript/v4/migrations/v3-to-v4
This skill is agent-first: detect actual usage first, make mechanical API changes in a controlled order, then typecheck and run focused tests.
Use this skill for requests like:
step.invoke with a string function ID stopped working"@inngest/realtime broke after installing inngest@4"If the user asks for a broad codebase reliability audit first, use inngest-brownfield-audit to choose scope, then return here for the v4 changes.
Start by locating all Inngest surfaces:
bashrg -n '"inngest"|"@inngest/realtime"|"@inngest/agent-kit"' package.json **/package.json rg -n 'new Inngest|EventSchemas|eventType|staticSchema|createFunction\\(|serve\\(|connect\\(|step\\.invoke|referenceFunction|@inngest/realtime|realtimeMiddleware|useInngestSubscription|serveHost|rewriteGatewayEndpoint|logLevel|streaming:|signingKey|signingKeyFallback|baseUrl|INNGEST_DEV|INNGEST_SIGNING_KEY' .
Then classify the repo:
inngest-setup, not this migration skill.serverless maxRuntime, realtime package imports, and string step.invoke.
Before editing, record:
textInngest migration scan: - Current package versions: - Client files: - Serve/connect entrypoints: - Functions using old trigger syntax: - EventSchemas usage: - Realtime v3 package usage: - step.invoke string IDs: - Serverless runtime constraints: - Tests/checks available:
createFunction options.EventSchemas with eventType() / staticSchema().step.invoke() string IDs.@inngest/realtime to v4 native APIs.Install the latest v4 SDK:
bashnpm install inngest@latest # or pnpm add inngest@latest # or yarn add inngest@latest
If the repo uses v3 realtime, remove @inngest/realtime; v4 realtime lives in the inngest package and subpaths such as inngest/realtime, inngest/react, and native step.realtime / inngest.realtime.
v4 defaults to Cloud mode. For local development, use an env var:
bashINNGEST_DEV=1 npm run dev
Do not hardcode isDev: true in source unless the repo's existing environment pattern clearly scopes it to local-only code. Production should use INNGEST_SIGNING_KEY.
In v4, options such as signingKey, signingKeyFallback, and baseUrl belong on new Inngest(...), not on serve(...).
typescript// Old v3 app.use( "/api/inngest", serve({ client: inngest, functions, signingKey: process.env.INNGEST_SIGNING_KEY, baseUrl: process.env.INNGEST_BASE_URL, }), ); // New v4 export const inngest = new Inngest({ id: "my-app", signingKey: process.env.INNGEST_SIGNING_KEY, baseUrl: process.env.INNGEST_BASE_URL, }); app.use("/api/inngest", serve({ client: inngest, functions }));
If the repo already relies on supported environment variables and does not pass serve options explicitly, no code change may be required for those keys.
Other renames:
serveHost -> serveOriginstreaming: "force" -> streaming: truestreaming: "allow" -> streaming: truestreaming: false stays falselogLevel is removed; pass a logger such as new ConsoleLogger({ level })Triggers move into the first argument's options object.
typescript// Old v3 inngest.createFunction( { id: "send-welcome" }, { event: "user/created" }, async ({ event, step }) => {}, ); // New v4 inngest.createFunction( { id: "send-welcome", triggers: [{ event: "user/created" }] }, async ({ event, step }) => {}, );
Cron triggers move the same way:
typescriptinngest.createFunction( { id: "nightly-sync", triggers: [{ cron: "0 2 * * *" }] }, async ({ step }) => {}, );
If a function is invoked only via step.invoke, it may be triggerless.
Replace centralized EventSchemas with event-specific definitions.
typescriptimport { Inngest, eventType, staticSchema } from "inngest"; import { z } from "zod"; export const userCreated = eventType("user/created", { schema: z.object({ userId: z.string(), email: z.string().email(), }), }); type InvoicePaid = { invoiceId: string; customerId: string; }; export const invoicePaid = eventType("billing/invoice.paid", { schema: staticSchema<InvoicePaid>(), });
Use event types consistently:
typescriptawait inngest.send(userCreated.create({ userId, email })); inngest.createFunction( { id: "on-user-created", triggers: [userCreated] }, async ({ event }) => {}, ); await step.waitForEvent("wait-for-invoice", { event: invoicePaid, timeout: "7d", });
Important: staticSchema expects a type, not an interface. Convert interfaces to type aliases when needed.
v4 no longer accepts raw string function IDs. Use an imported function reference or referenceFunction().
typescriptimport { referenceFunction } from "inngest"; await step.invoke("run-report", { function: referenceFunction({ appId: "analytics-app", functionId: "generate-report", }), data: { reportId }, });
If the target function is in the same codebase, prefer passing the imported function itself:
typescriptawait step.invoke("run-report", { function: generateReport, data: { reportId }, });
v3 realtime used @inngest/realtime and middleware-injected publish. v4 realtime is native.
Replace:
@inngest/realtime packagerealtimeMiddleware(){ publish }useInngestSubscription()With:
inngest/realtimestep.realtime.publish between stepsinngest.realtime.publish inside an existing step.runUse inngest-realtime for detailed patterns. Do not call step.realtime.publish from inside step.run; use inngest.realtime.publish there to avoid step-in-step behavior.
v4 enables optimized parallelism and checkpointing by default.
Watch for Promise.race over steps. With optimized parallelism, Promise.race waits for all step promises to settle. If the repo relies on first-winner behavior, use group.parallel().
For serverless platforms, configure checkpointing maxRuntime slightly below the platform limit:
typescriptexport const inngest = new Inngest({ id: "my-app", checkpointing: { maxRuntime: "50s", }, });
On Vercel or similar frameworks, also set the route handler's max duration where the platform supports it.
If the repo uses Connect:
rewriteGatewayEndpoint is replaced by gatewayUrl.isolateExecution: false or INNGEST_CONNECT_ISOLATE_EXECUTION=false.
Run checks in increasing confidence:
INNGEST_DEV=1.npx inngest-cli@latest dev and confirm function discovery.If local dev-server verification is not possible, state exactly which static checks passed and what runtime verification remains.
INNGEST_DEV=1 forlocal development or configure INNGEST_SIGNING_KEY for production.
Cls is not a constructor on /api/inngest: likely v3@inngest/realtime middleware in a v4 app. Remove the package and migrate to native realtime.
step.invoke fails with string function ID: replace strings withimported function references or referenceFunction().
EventSchemas with eventType() andstaticSchema().
Promise.race behavior: use group.parallel() for first-winnerstep races or disable optimized parallelism only when necessary.
inngest@4.signingKey, baseUrl, or signingKeyFallback to serve().EventSchemas with untyped string events everywhere.isDev: true in production-bound source.step.invoke.These upstream Inngest instructions are vendored for agent tooling and integration work in this monorepo.
Use this skill when inngest-v3-v4-migration matches the current Inngest task. If the right skill is unclear, start with docs/ai/skills/inngest/SKILL.md.
integration.
inngest-brownfield-audit before changing existing app workflows orfragile background work.
AGENTS.md, reporulebooks, framework docs, and runtime evidence.
INNGEST_* envrequirements out of agent-tooling-only changes.
or dependencies.
workflow behavior.
port.
docs/ai/skills/inngest/references/upstream.md.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 3,958 | 4,702 | +19% | 1 | 1 | 0% | 672 | 3,202 | +376% | 0 | 0 | — |
case-02 | fail→fail | 18,726 | 5,119 | -73% | 1 | 1 | 0% | 3,434 | 3,163 | -8% | 0 | 0 | — |
case-03 | fail→fail | 13,153 | 5,877 | -55% | 1 | 1 | 0% | 2,501 | 3,250 | +30% | 0 | 0 | — |
case-04 | pass→pass | 11,108 | 7,081 | -36% | 1 | 1 | 0% | 2,284 | 4,341 | +90% | 0 | 0 | — |
case-05 | pass→pass | 17,056 | 6,849 | -60% | 1 | 1 | 0% | 2,630 | 4,024 | +53% | 0 | 0 | — |
case-06 | pass→pass | 19,733 | 11,673 | -41% | 1 | 1 | 0% | 3,651 | 5,182 | +42% | 0 | 0 | — |
case-07 | fail→pass | 11,929 | 5,607 | -53% | 1 | 1 | 0% | 2,242 | 4,087 | +82% | 0 | 0 | — |
case-08 | pass→pass | 6,520 | 5,131 | -21% | 1 | 1 | 0% | 1,171 | 3,971 | +239% | 0 | 0 | — |
case-09 | fail→pass | 16,154 | 7,141 | -56% | 1 | 1 | 0% | 2,812 | 4,418 | +57% | 0 | 0 | — |
case-10 | pass→pass | 15,849 | 3,308 | -79% | 1 | 1 | 0% | 2,505 | 3,485 | +39% | 0 | 0 | — |
case-11 | pass→pass | 10,164 | 4,719 | -54% | 1 | 1 | 0% | 1,718 | 3,810 | +122% | 0 | 0 | — |
case-12 | fail→pass | 14,246 | 8,209 | -42% | 1 | 1 | 0% | 2,676 | 4,565 | +71% | 0 | 0 | — |
case-13 | fail→pass | 11,648 | 5,932 | -49% | 1 | 1 | 0% | 1,998 | 4,141 | +107% | 0 | 0 | — |
case-14 | fail→pass | 9,307 | 2,967 | -68% | 1 | 1 | 0% | 1,660 | 3,451 | +108% | 0 | 0 | — |
case-15 | fail→pass | 15,315 | 3,362 | -78% | 1 | 1 | 0% | 2,299 | 3,544 | +54% | 0 | 0 | — |
case-16 | pass→pass | 10,332 | 3,213 | -69% | 1 | 1 | 0% | 1,623 | 3,537 | +118% | 0 | 0 | — |
case-17 | pass→pass | 10,864 | 5,401 | -50% | 1 | 1 | 0% | 1,907 | 3,942 | +107% | 0 | 0 | — |
case-18 | fail→pass | 16,766 | 5,156 | -69% | 1 | 1 | 0% | 2,621 | 3,864 | +47% | 0 | 0 | — |
case-19 | fail→pass | 18,664 | 5,814 | -69% | 1 | 1 | 0% | 3,356 | 3,991 | +19% | 0 | 0 | — |
case-20 | fail→pass | 10,676 | 2,345 | -78% | 1 | 1 | 0% | 1,637 | 3,321 | +103% | 0 | 0 | — |
case-21 | fail→pass | 16,863 | 6,031 | -64% | 1 | 1 | 0% | 2,908 | 4,186 | +44% | 0 | 0 | — |
case-22 | fail→pass | 14,837 | 3,458 | -77% | 1 | 1 | 0% | 2,667 | 3,609 | +35% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 19 counted toward the lift figure. The other 3 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +50 percentage points is the difference between those two pass rates over the 19 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.