inngest/inngest-skills/inngest-v3-v4-migration
Claude Code and agent skill by inngest/inngest-skills
- community
Checking that the SKILL.md file is still in the repository.
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.
Install
npx vskill@latest install inngest/inngest-skills/inngest-v3-v4-migrationSKILL.md
The same SKILL.md was published earlier as inngest/inngest-skills/inngest-v3-v4-migration.
Inngest v3 to v4 Migration
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.
When to Trigger
Use this skill for requests like:
- "Upgrade Inngest from v3 to v4"
- "Fix our Inngest v4 migration"
- "We're getting signing key required / cloud mode errors after upgrading"
- "
step.invokewith a string function ID stopped working" - "
@inngest/realtimebroke after installinginngest@4" - "Move from EventSchemas to eventType"
- "Make this existing Inngest repo v4-compatible"
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.
Migration Scan
Start by locating all Inngest surfaces:
Then classify the repo:
- No Inngest yet: use
inngest-setup, not this migration skill. - v3 only: migrate the SDK and all breaking changes together.
- mixed v3/v4: prioritize removing broken v3 APIs from v4 code.
- v4 mostly done: focus on missed runtime gotchas like local dev mode,
serverless maxRuntime, realtime package imports, and string step.invoke.
Before editing, record:
Upgrade Order
- Update package versions.
- Fix client construction and local/prod mode.
- Move serve options to the client.
- Move triggers into
createFunctionoptions. - Replace
EventSchemaswitheventType()/staticSchema(). - Rewrite
step.invoke()string IDs. - Migrate realtime from
@inngest/realtimeto v4 native APIs. - Update middleware and logging.
- Configure checkpointing/serverless runtime.
- Typecheck, run tests, and optionally sync with the dev server.
Package and Environment
Install the latest v4 SDK:
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:
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.
Client and Serve Options
In v4, options such as signingKey, signingKeyFallback, and baseUrl belong on new Inngest(...), not on serve(...).
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: falsestaysfalselogLevelis removed; pass aloggersuch asnew ConsoleLogger({ level })
createFunction Triggers
Triggers move into the first argument's options object.
Cron triggers move the same way:
If a function is invoked only via step.invoke, it may be triggerless.
EventSchemas to eventType/staticSchema
Replace centralized EventSchemas with event-specific definitions.
Use event types consistently:
Important: staticSchema expects a type, not an interface. Convert interfaces to type aliases when needed.
step.invoke
v4 no longer accepts raw string function IDs. Use an imported function reference or referenceFunction().
If the target function is in the same codebase, prefer passing the imported function itself:
Realtime Migration
v3 realtime used @inngest/realtime and middleware-injected publish. v4 realtime is native.
Replace:
@inngest/realtimepackagerealtimeMiddleware()- handler args such as
{ publish } - v3 React hooks such as
useInngestSubscription()
With:
- channel definitions from
inngest/realtime step.realtime.publishbetween stepsinngest.realtime.publishinside an existingstep.run- subscription helpers/hooks from current v4 APIs
Use 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.
Parallelism and Checkpointing
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:
On Vercel or similar frameworks, also set the route handler's max duration where the platform supports it.
Connect Changes
If the repo uses Connect:
rewriteGatewayEndpointis replaced bygatewayUrl.- Connect may use worker-thread isolation. If integration issues appear, check
isolateExecution: false or INNGEST_CONNECT_ISOLATE_EXECUTION=false.
- Keep target URLs and signing/event keys in env vars.
Verification
Run checks in increasing confidence:
- Package manager install/update.
- Typecheck.
- Unit/integration tests around migrated functions.
- Start the app with
INNGEST_DEV=1. - Run
npx inngest-cli@latest devand confirm function discovery. - Send one representative event and inspect the run.
If local dev-server verification is not possible, state exactly which static checks passed and what runtime verification remains.
Common Failure Messages
- "A signing key is required to run in Cloud mode": set
INNGEST_DEV=1for
local 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 with
imported function references or referenceFunction().
- Type errors around schemas: replace
EventSchemaswitheventType()and
staticSchema().
- Unexpected `Promise.race` behavior: use
group.parallel()for first-winner
step races or disable optimized parallelism only when necessary.
Anti-Patterns
- Mixing v3 realtime middleware with
inngest@4. - Passing
signingKey,baseUrl, orsigningKeyFallbacktoserve(). - Moving event trigger syntax but forgetting cron/invoke-triggered functions.
- Replacing
EventSchemaswith untyped string events everywhere. - Hardcoding
isDev: truein production-bound source. - Leaving string IDs in
step.invoke. - Skipping typecheck after mechanical migration.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/inngest-v3-v4-migration/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/inngest/inngest-skills/inngest-v3-v4-migration)