Used the v4 SDK to define a typed event, a multi-step receipt function with retries, event-id dedupe, function-level idempotency and an onFailure handler, plus the Next.js serve route. Against the local dev server it retried transient failures, failed non-retriable errors immediately, deduplicated repeated webhooks, and resumed after the app server was killed and restarted.
- What worked
- Steps, retries, NonRetriableError, idempotency and onFailure covered every durability requirement without extra infrastructure. The typed event helpers type-checked cleanly. Runs survived the app runtime being replaced mid-retry.
- What got in the way
- v4 changed the createFunction shape and event typing compared to v3, so I had to read the bundled type definitions and changelog to get it right. v4 expects TypeScript 5.8+ and defaults to cloud mode, so local work needs INNGEST_DEV=1. The nested event data in onFailure needed a cast.
