Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

inngest

inngest486.5kApache-2.03.35.0TypeScript support: included

Official SDK for Inngest.com. Inngest is the reliability layer for modern applications. Inngest combines durable execution, events, and queues into a zero-infra platform with built-in observability.

inngest, task manager, workflow, workflows, orchestration, task orchestration, events, webhooks, task scheduler, scheduled jobs, cron jobs, queue, serverless event-driven systems, job scheduler, background jobs, step function, job processing, llm prompt chaining, durable execution, longrunning, long-running, task sequencing, durable workflow, reliability, reliability layer, parallel processing, flow control

readme

./packages/inngest/README.md

changelog

inngest

3.35.0

Minor Changes

  • #912 a641cc2 Thanks @jpwilliams! - Adds a fetch export from "inngest" to allow any library that accepts a Fetch API-compatible function to automatically turn any call into a durable step if used within the context of an Inngest Function.

    By default, if called outside of the context of an Inngest Function (or within an existing step), it will fall back to using the global fetch, or a fallback of the user's choice.

    // Basic use
    import { fetch } from "inngest";
    
    const api = new MyProductApi({ fetch });
    // With a fallback
    import { fetch } from "inngest";
    
    const api = new MyProductApi({
      fetch: fetch.config({
        fallback: myCustomFetchFallback,
      }),
    });
    // Remove the default fallback and error if called outside an Inngest Function
    import { fetch } from "inngest";
    
    const api = new MyProductApi({
      fetch: fetch.config({
        fallback: undefined,
      }),
    });

    It's also available within a function as step.fetch.

    inngest.createFunction(
      {
        id: "my-fn",
      },
      {
        event: "my-event",
      },
      async ({ step }) => {
        const api = new MyProductApi({ fetch: step.fetch });
      },
    );

3.34.5

Patch Changes

  • #944 54b860a Thanks @amh4r! - Use x-inngest-event-id-seed header instead of event idempotency ID

  • #937 c6e9131 Thanks @jpwilliams! - Normalize headers in "inngest/lambda" - mocked requests with non-lowercase headers are now handled

  • #945 4506581 Thanks @jpwilliams! - Bump resolveAfterPending() microtask shim count to 100, reducing parallel index warnings

3.34.4

Patch Changes

3.34.3

Patch Changes

3.34.2

Patch Changes

3.34.1

Patch Changes

  • #925 11fd15b Thanks @jpwilliams! - Export fastifyPlugin as a named export to resolve CJS<->ESM interop issues

3.34.0

Minor Changes

  • #919 ebeaaff Thanks @jpwilliams! - Add dependencyInjectionMiddleware(), allowing you to easily add data to function input

    import { dependencyInjectionMiddleware } from "inngest";
    
    const prisma = new Prisma();
    
    const inngest = new Inngest({
      id: "my-app",
      middleware: [dependencyInjectionMiddleware({ prisma })],
    });

Patch Changes

  • #922 3374187 Thanks @jpwilliams! - Error.cause can now be any unknown value, though we still attempt to recursively expand causes until we hit an unknown value

3.33.0

Minor Changes

  • #918 a305a15 Thanks @jpwilliams! - Add support for Temporal APIs.

    inngest.createFunction(
      {
        id: "my-fn",
      },
      {
        event: "test/hello.world",
      },
      async ({ event, step }) => {
        // sleep with a `Temporal.Duration`
        await step.sleep("😴", Temporal.Duration.from({ seconds: 10 }));
        await step.sleep("😴", Temporal.Duration.from({ minutes: 5 }));
        await step.sleep("😴", Temporal.Duration.from({ hours: 1 }));
    
        // sleepUntil using a `Temporal.Instant` or `Temporal.ZonedDateTime`
        await step.sleepUntil(
          "😴",
          Temporal.Instant.from("2025-03-19T12:00:00Z"),
        );
        await step.sleepUntil(
          "😴",
          Temporal.ZonedDateTime.from("2025-03-19T12:00[Europe/London]"),
        );
    
        // sleepUntil also works with relative time
        const now = Temporal.Instant.from(event.user.createdAtISO);
        await step.sleepUntil(
          "😴",
          now.add(Temporal.Duration.from({ minutes: 30 })),
        );
      },
    );

Patch Changes

3.32.9

Patch Changes

3.32.8

Patch Changes

  • #910 d184913 Thanks @jpwilliams! - Fix shouldOptimizeParallelism() error when attempting to serve functions using multiple versions of inngest

3.32.7

Patch Changes

  • #889 5d5bd10 Thanks @jpwilliams! - Automatically set all AI models exports in step tooling based on @inngest/ai version

3.32.6

Patch Changes

  • #892 cb165d1 Thanks @jpwilliams! - Add APIs in preparation for realtime calls

  • #892 cb165d1 Thanks @jpwilliams! - Add executingStep as an ALS property, allowing async contexts to ascertain whether we are in or out of a step

3.32.5

Patch Changes

3.32.4

Patch Changes

3.32.3

Patch Changes

  • #877 b9a6e89 Thanks @jpwilliams! - getAsyncCtx() now correctly finds context when called within:
    • step.run() calls
    • Middleware hooks

3.32.2

Patch Changes

3.32.1

Patch Changes

3.32.0

Minor Changes

Patch Changes

3.31.13

Patch Changes

  • #865 b2ff76d Thanks @jpwilliams! - Ensure support for typescript@~5.8.0

    No notable changes have been made, though minor TypeScript versions often affect transpiled outputs.

3.31.12

Patch Changes

  • #864 e47965e Thanks @jpwilliams! - Fix event sending failing in some edge environments due to not finding global.crypto or globalThis.crypto when creating idempotency IDs

  • #856 cd63ce3 Thanks @BrunoScheufler! - - Connect: Prefer functions passed through apps but fall back to functions registered on the client

  • #858 ce0c5a8 Thanks @jpwilliams! - Optimize function memoization

3.31.11

Patch Changes

3.31.10

Patch Changes

3.31.9

Patch Changes

3.31.8

Patch Changes

3.31.7

Patch Changes

3.31.6

Patch Changes

3.31.5

Patch Changes

3.31.4

Patch Changes

3.31.3

Patch Changes

3.31.2

Patch Changes

3.31.1

Patch Changes

  • #817 446be1b Thanks @jpwilliams! - serve() and connect() now have looser typing for client and functions, resulting in easier use of multiple inngest packages in a single process

  • #823 f1d2385 Thanks @jpwilliams! - Allow wildcard event typing with .fromRecord()

    The following schema is now valid:

    export const schemas = new EventSchemas().fromRecord<{
      "app/blog.post.*":
        | {
            name: "app/blog.post.created";
            data: {
              postId: string;
              authorId: string;
              createdAt: string;
            };
          }
        | {
            name: "app/blog.post.published";
            data: {
              postId: string;
              authorId: string;
              publishedAt: string;
            };
          };
    }>();

    When creating a function, this allows you to appropriately type narrow the event to pull out the correct data:

    inngest.createFunction(
      { id: "my-fn" },
      { event: "app/blog.post.*" },
      async ({ event }) => {
        if (event.name === "app/blog.post.created") {
          console.log("Blog post created at:", event.data.createdAt);
        } else if (event.name === "app/blog.post.published") {
          console.log("Blog post published at:", event.data.publishedAt);
        }
      },
    );
  • #825 661ed7b Thanks @jpwilliams! - If no functions are provided to inngest.connect(), it will now use any functions that have been created with the client instead

  • Updated dependencies [fadd94a]:

3.31.0

Minor Changes

Patch Changes

3.30.0

Minor Changes

Patch Changes

3.29.3

Patch Changes

  • #798 f426ba6 Thanks @jpwilliams! - Fix named functions returning never[] for their parameters when passed to step.run()

    // This now works
    step.run("", function named() {});

3.29.2

Patch Changes

3.29.1

Patch Changes

3.29.0

Minor Changes

3.28.0

Minor Changes

  • #776 0dbcc87 Thanks @jpwilliams! - Add experimental getAsyncCtx(), allowing the retrieval of a run's input (event, step, runId, etc) from the relevant async chain.

    import { getAsyncCtx } from "inngest/experimental";
    
    const ctx = await getAsyncCtx();

Patch Changes

3.27.5

Patch Changes

3.27.4

Patch Changes

3.27.3

Patch Changes

3.27.2

Patch Changes

3.27.1

Patch Changes

3.27.0

Minor Changes

Patch Changes

  • #760 efc6c79 Thanks @jpwilliams! - Ensure support for typescript@~5.7.0

    No notable changes have been made, though minor TypeScript versions often affect transpiled outputs.

3.26.3

Patch Changes

3.26.2

Patch Changes

3.26.1

Patch Changes

3.26.0

Minor Changes

  • #747 871a958 Thanks @jacobheric! - Add step.ai.*() tooling, allowing users to leverage AI workflows within Inngest functions

3.25.1

Patch Changes

3.25.0

Minor Changes

3.24.0

Minor Changes

Patch Changes

3.23.1

Patch Changes

3.23.0

Minor Changes

Patch Changes

3.22.13

Patch Changes

  • #709 3041afe Thanks @jpwilliams! - Ensure support for TypeScript 5.6

    No changes to any runtime/user-facing code has been made, but TS upgrades often alter emitted files, so the package will be bumped for folks to take advantage of any performance/compatibility improvments there.

3.22.12

Patch Changes

3.22.11

Patch Changes

3.22.10

Patch Changes

  • #705 f229dea Thanks @goszczynskip! - Fix required type annotation typescript errors; inngest/types is now exported with a warning within the module covering its usage

3.22.9

Patch Changes

  • #688 58549f3 Thanks @jpwilliams! - Expose some internal execution logic to make way for a new @inngest/test package

3.22.8

Patch Changes

3.22.7

Patch Changes

  • #687 9f0bdc6 Thanks @MonsterDeveloper! - Add exports for JsonError type to fix a TypeScript error when using Inngest in projects with composite setting in tsconfig.

3.22.6

Patch Changes

3.22.5

Patch Changes

3.22.4

Patch Changes

3.22.3

Patch Changes

3.22.2

Patch Changes

  • #671 4f91d9c Thanks @jpwilliams! - Add de(serialization) of Error.cause, meaning nested errors can now be correctly used with StepError

3.22.1

Patch Changes

3.22.0

Minor Changes

3.21.2

Patch Changes

3.21.1

Patch Changes

  • #655 12df420 Thanks @jpwilliams! - Do not allow objectish [] for an event's data when providing schemas

    This helps solve an issue whereby types would be happy but sending an event fails at runtime.

3.21.0

Minor Changes

  • #651 a527cd3 Thanks @jpwilliams! - Add a new onFunctionRun.finished middleware hook, allowing you to hook into a run finishing successfully or failing

    new InngestMiddleware({
      name: "My Middleware",
      init() {
        return {
          onFunctionRun() {
            finished({ result }) {
              // ...
            },
          },
        };
      },
    });
  • #650 db9ed0e Thanks @jpwilliams! - Allow specifying an env when sending events via the client

    await inngest.send({ name: "my.event" }, { env: "my-custom-env" });

Patch Changes

3.20.0

Minor Changes

3.19.22

Patch Changes

  • #644 7eb27e4 Thanks @jpwilliams! - Loosen typing on match options and mark as deprecated to remove performance concerns in codebases with a very large number of event types; all match fields are now simply typed as string

  • #641 99f196a Thanks @jpwilliams! - Remove incorrect type showing internal events in step.waitForEvent()

3.19.21

Patch Changes

3.19.20

Patch Changes

  • #636 b0e6237 Thanks @goodoldneon! - Fix inferred dev mode resulting in contacting the production API when fetching large state

  • #634 ac402ef Thanks @jpwilliams! - Change an error when function configuration is invalid to a warning instead

3.19.19

Patch Changes

  • #631 ac6796c Thanks @jpwilliams! - Fix exception being thrown from debug when used with Nitro running on Cloudflare Pages

  • 191fe36 Thanks @jpwilliams! - Fix failure handlers incorrectly inheriting config options such as batchEvents and concurrency from their parent function

  • #630 d4de6d7 Thanks @stefanosala! - Fix missing config fields such as concurrency when validating

3.19.18

Patch Changes

  • #625 3ae2c9b Thanks @goodoldneon! - Clearly log invalid function configurations for users, circumventing non-exhaustive typing for extraneous properties in client and function config

  • #628 996c0c5 Thanks @goodoldneon! - Removed inspect message

3.19.17

Patch Changes

  • #623 cc96657 Thanks @jpwilliams! - Upgraded TypeScript to 5.5.

    No change in behaviour or downstream compatibility is expected, but emitted declaration files will still change, so the patch version will bump for all affected packages.

  • #626 6e41c90 Thanks @cohlar! - Export ScheduledTimerEventPayload for ESM

3.19.16

Patch Changes

  • #618 1f0cb29 Thanks @MonsterDeveloper! - Expose InngestFunction#createExecution() as a protected method to allow custom unit testing.

    Note that this is an internal API and can change at any time; first-party testing tools will be adde at a later date.

3.19.15

Patch Changes

  • #619 7542fc2 Thanks @jpwilliams! - "inngest/cloudflare" serve handler now supports both Cloudflare Pages Functions and Cloudflare Workers

3.19.14

Patch Changes

  • #611 f36c442 Thanks @jpwilliams! - Add support for global Netlify.env objects when accessing environment variables

  • #614 7970faa Thanks @goodoldneon! - Fix attempting to register without a path when using a URL from INNGEST_DEV

  • #615 baa9e5e Thanks @jpwilliams! - Add maximum recursion depth for object path typing for step.waitForEvent()'s match and cancelOn

3.19.13

Patch Changes

3.19.12

Patch Changes

  • #604 8b41f6b Thanks @jpwilliams! - Give all serve()-related peer dependencies a wider range and make them optional, silencing warnings when installing inngest

3.19.11

Patch Changes

  • #597 cf22183 Thanks @jpwilliams! - Fix serve handler's fetch implementation incorrectly being marked as custom if no custom fetch is given to new Inngest()

  • #597 cf22183 Thanks @jpwilliams! - Reduce incorrect occurences of the following log when a call with fetch fails

    A request failed when using a custom fetch implementation; this may be a misconfiguration. Make sure that your fetch client is correctly bound to the global scope.

3.19.10

Patch Changes

3.19.9

Patch Changes

  • #595 dd7f5ac Thanks @jpwilliams! - Set explicit return types for "inngest/fastify" for JSR publishing

  • 519d66b Thanks @jpwilliams! - Allowed secure introspection of the Inngest endpoint for improved debugging and observability

  • #594 41b02b2 Thanks @jpwilliams! - Fix typing for "inngest/lambda" handler being incorrect Proxy type

3.19.8

Patch Changes

3.19.7

Patch Changes

3.19.6

Patch Changes

3.19.5

Patch Changes

  • #576 f1be005 Thanks @jpwilliams! - Fix function-level middleware typing being missing; only client-level was providing types

3.19.4

Patch Changes

3.19.3

Patch Changes

3.19.2

Patch Changes

  • #569 f79e3e2 Thanks @goodoldneon! - Omit id when specifying an event for step.invoke(); idempotency IDs are not used here

3.19.1

Patch Changes

  • #561 405733f Thanks @jpwilliams! - Optimize memoization of steps, providing a performance improvement of up 48x for very high step counts

3.19.0

Minor Changes

3.18.1

Patch Changes

  • #520 0703740 Thanks @jpwilliams! - Add selective header forwarding when sending events, allowing context propagation when tracing fanouts 👀

  • #549 f759de1 Thanks @maktouch! - Add step name or ID when there’s a NESTING_STEPS error

3.18.0

Minor Changes

3.17.0

Minor Changes

3.16.2

Patch Changes

  • #538 d9d57c4 Thanks @jpwilliams! - Fix { name: string; } objects being filtered out of step.run() responses when nullable or a union

  • #536 73e04a5 Thanks @jpwilliams! - Do not swallow JSON parsing errors when syncing

  • #535 09ef143 Thanks @jpwilliams! - Fix sending events sometimes returning generic errors when we can be more specific

3.16.1

Patch Changes

  • #518 bc494da Thanks @jpwilliams! - INN-2861 No longer execute step.sendEvent() inline

    To send an event in a function without making it a step function, use inngest.send() instead.

  • #519 775fee7 Thanks @jpwilliams! - When timing out during parallel recovery, will now prefer logging the step's name instead of its internal hashed ID

  • #517 f8a8f7b Thanks @wtachau! - Fix RetryAfterError comments; it accepts milliseconds as a number, not seconds

  • #521 9aa3979 Thanks @jpwilliams! - INN-2880 Add warning if fetch fails and is a custom implementation

3.16.0

Minor Changes

3.15.5

Patch Changes

3.15.4

Patch Changes

3.15.3

Patch Changes

3.15.2

Patch Changes

  • #503 f6088e0 Thanks @jpwilliams! - Fix onSendEvent.transformInput() middleware hooks not running for step.invoke() payloads

3.15.1

Patch Changes

3.15.0

Minor Changes

  • #488 3d2429d Thanks @jpwilliams! - INN-2754 Add support for INNGEST_DEV and the isDev option, allowing a devleoper to explicitly set either Cloud or Dev mode

Patch Changes

3.14.2

Patch Changes

3.14.1

Patch Changes

  • #493 adaa948 Thanks @goodoldneon! - Fix registration reusing deployment IDs when reusing connections in serverless or serverful

3.14.0

Minor Changes

Patch Changes

3.13.0

Minor Changes

Patch Changes

3.12.0

Minor Changes

  • #411 3b35c1c Thanks @jpwilliams! - Add handling of per-step errors and returning step names during error cases to better display issues in the UI

Patch Changes

3.11.0

Minor Changes

Patch Changes

3.10.0

Minor Changes

  • #449 a452cf1 Thanks @jpwilliams! - Add referenceFunction(), allowing easier, typed invocation of functions across apps and languages

  • #459 eec41d2 Thanks @jpwilliams! - Add new Inngest.Any and InngestFunction.Any type helpers

Patch Changes

  • #460 a225206 Thanks @MonsterDeveloper! - Add exports for FinishedEventPayload and Context types to fix a TypeScript error when using Inngest in projects with composite setting in tsconfig.

3.9.0

Minor Changes

  • #453 be6eb2a Thanks @jpwilliams! - Pass reqArgs to onFunctionRun middleware hook to be able to use request values within an Inngest function

3.8.0

Minor Changes

3.7.4

Patch Changes

  • #434 cb953ee Thanks @jpwilliams! - Fix bad wildcard export inngest/components/* for ESM/CJS compatibility

  • #440 0fc642d Thanks @jpwilliams! - Fix an issue where Sentry's wrapping of inngest/express caused Sentry to throw a runtime error during instantiation

3.7.3

Patch Changes

3.7.2

Patch Changes

  • #426 49a58d1 Thanks @jpwilliams! - Fix internal inngest/* events not being present when using new EventSchemas()

  • #427 5cf349c Thanks @jpwilliams! - Fix EventPayload.id missing from typing when attempting to send events with inngest.send() or step.sendEvent()

3.7.1

Patch Changes

  • #421 471d11f Thanks @jpwilliams! - Fix serverless use of inngest/next with next@>=13.0.0 <13.5.0 failing to return a response, as well as next@>=13.5.0 logging the same error

3.7.0

Minor Changes

  • #368 e7e845e Thanks @jpwilliams! - Add step.invoke(), providing the ability to directly invoke a function as a step

Patch Changes

3.6.2

Patch Changes

  • #409 b56a33e Thanks @jpwilliams! - Support Remix env vars on Cloudflare Pages via context.env

  • #400 428a591 Thanks @jpwilliams! - Fix Next.js 13 host being stubborn when relying on req.url for hosts such as host.docker.internal

  • #408 4066217 Thanks @jpwilliams! - Forward X-Inngest-Server-Kind headers to assist in preventing some issues with registration handshakes

  • #406 be5544b Thanks @jpwilliams! - Fix correctness issues in generated *.d.ts files, causing errors for some versions/configurations of TypeScript with skipLibCheck: false

3.6.1

Patch Changes

3.6.0

Minor Changes

3.5.0

Minor Changes

3.4.4

Patch Changes

3.4.3

Patch Changes

  • #385 cdf02a3 Thanks @MonsterDeveloper! - Add exports for InngestFunction, FunctionTrigger, and Handler types to fix a TypeScript error when using Inngest in projects with composite setting in tsconfig.

3.4.2

Patch Changes

3.4.1

Patch Changes

  • #371 d45bfbd Thanks @jpwilliams! - Remove JsonifyObject<> wrapper from step output - it's now clearer to see the actual type of a step's result

  • #375 e19f9b4 Thanks @jpwilliams! - Fix failing to parse BigInt during step/function result serialization; it is now correctly typed and returned as never

  • #374 dcafc2b Thanks @jpwilliams! - Fixed an issue where an error log wasn't shown if execution result parsing failed, such as in the case of serialization failures

3.4.0

Minor Changes

Patch Changes

3.3.0

Minor Changes

3.2.1

Patch Changes

  • #360 260dd75 Thanks @jpwilliams! - Inngest errors now appear more succintly in UIs, free of ANSI codes and verbose information

3.2.0

Minor Changes

Patch Changes

  • #357 9140b66 Thanks @jpwilliams! - Stop "Failed to send event" errors occuring in local development when missing an event key

  • #359 7f70546 Thanks @goodoldneon! - Internally, steps now return a displayName to be used within Inngest's UIs

3.1.1

Patch Changes

3.1.0

Minor Changes

Patch Changes

3.0.2

Patch Changes

3.0.1

Patch Changes

3.0.0

Major Changes

  • #294 f2f4856 Thanks @jpwilliams! - Clients and functions now require IDs

    When instantiating a client using new Inngest() or creating a function via inngest.createFunction(), it's now required to pass an id instead of a name.

    Previously only name was required, but this implied that the value was safe to change. Internally, we used this name to produce an ID which was used during deployments and executions.

    See the v3 migration guide.

  • #294 f2f4856 Thanks @jpwilliams! - Refactored available environment variables and configuration

    The arrangement of environment variables available has shifted a lot over the course of v2, so in v3 we've streamlined what's available and how they're used.

    See the v3 migration guide.

  • #294 f2f4856 Thanks @jpwilliams! - In v2, providing a fns option when creating a function -- an object of functions -- would wrap those passed functions in step.run(), meaning you can run code inside your function without the step.run() boilerplate.

    This wasn't a very well advertised feature and had some drawbacks, so we're instead replacing it with some optional middleware.

    See the v3 migration guide.

  • #294 f2f4856 Thanks @jpwilliams! - Serving functions could become a bit unwieldy with the format we had, so we've slightly altered how you serve your functions to ensure proper discoverability of options and aid in readability when revisiting the code.

    See the v3 migration guide.

  • #294 f2f4856 Thanks @jpwilliams! - Shorthand function creation removed

    inngest.createFunction() can no longer take a string as the first or second arguments; an object is now required to aid in the discoverability of options and configuration.

    See the v3 migration guide.

  • #294 f2f4856 Thanks @jpwilliams! - All steps require IDs

    When using any step.* tool, an ID is now required to ensure that determinism across changes to a function is easier to reason about for the user and the underlying engine.

    The addition of these IDs allows you to deploy hotfixes and logic changes to long-running functions without fear of errors, failures, or panics. Beforehand, any changes to a function resulted in an irrecoverable error if step definitions changed. With this, changes to a function are smartly applied by default.

    See the v3 migration guide.

Patch Changes

  • #333 67bda66 Thanks @goodoldneon! - (Internal) Fix missing name on NonRetriableError, ensuring it's correctly (de)serialized

2.7.2

Patch Changes

  • #323 3b2efa6 Thanks @jpwilliams! - Better error handling for .sendEvent() errors from Inngest API, ensuring easier debugging when failing to send events - partial of #256

2.7.1

Patch Changes

  • #325 b8858c9 Thanks @jpwilliams! - Hotfix: Ensure ProxyLogger (and some other used classes/types) is correctly exported from "inngest"

2.7.0

Minor Changes

Patch Changes

2.6.1

Patch Changes

2.6.0

Minor Changes

  • #202 21053ed Thanks @djfarrelly! - Add support for Fastify, either via a custom .route() or using a Fastify plugin

    import Fastify from "fastify";
    import inngestFastify, { serve } from "inngest/fastify";
    import { functions, inngest } from "./inngest";
    
    const fastify = Fastify({
      logger: true,
    });
    
    // The lead maintainer of Fastify recommends using this as a plugin:
    fastify.register(inngestFastify, {
      client: inngest,
      functions,
      options: {},
    });
    
    // We do also export `serve()` if you want to use it directly, though.
    fastify.route({
      method: ["GET", "POST", "PUT"],
      handler: serve(inngest, functions),
      url: "/api/inngest",
    });
    
    fastify.listen({ port: 3000 }, function (err, address) {
      if (err) {
        fastify.log.error(err);
        process.exit(1);
      }
    });
  • #298 4984aa8 Thanks [@z.object({](https://github.com/z.object({), [@z.object({](https://github.com/z.object({)! - Add the ability to provide Zod schemas using z.object() instead of requiring a record format

    // Previously we supported this
    new EventSchemas().fromZod({
      "test.event": {
        data: z.object({ a: z.string() }),
     b: z.number() }),
      },
    });
    
    // Now we ALSO support this
    new EventSchemas().fromZod([
      z.object({
        name: z.literal("test.event"),
        data: z.object({ a: z.string() }),
     b: z.number() }),
      }),
    ]);

    This should help if you wish to declare your events piece-by-piece instead of in a single object.

    const firstEvent = z.object({
      name: z.literal("app/user.created"),
      data: z.object({ id: z.string() }),
    });
    
    const secondEvent = z.object({
      name: z.literal("shop/product.deleted"),
      data: z.object({ id: z.string() }),
    });
    
    new EventSchemas().fromZod([firstEvent, secondEvent]);

    You can use the exported LiteralZodEventSchema type to provide some autocomplete when writing your events, too.

    const ShopProductOrdered = z.object({
      name: z.literal("shop/product.ordered"),
      data: z.object({ productId: z.string() }),
    }) satisfies LiteralZodEventSchema;

2.5.2

Patch Changes

  • #305 10220af Thanks @jpwilliams! - Always attempt accessing the dev server if the INNGEST_DEVSERVER_URL environment variable is specified

    This helps some situations where a user may want to run integration tests against a deployed or otherwise production build, using the Inngest Dev Server to do so.

2.5.1

Patch Changes

  • #302 5b2bfac Thanks @jpwilliams! - Remove preinstall script from inngest package causing errors when consuming the package

2.5.0

Minor Changes

  • #289 b04d904 Thanks @jpwilliams! - Add attempt number to SDK function context

    inngest.createFunction(
      { name: "Example Function" },
      { event: "app/user.created" },
      async ({ attempt }) => {
        // ...
      },
    );

Patch Changes

2.4.1

Patch Changes

  • f2ffc8b: Fix cross-fetch import issue in testing environemtnst. API package also uses custom fetch passed via arguments.
  • acfa07c: Throw error when using inngest/express and not using a body parser
  • b535e1e: Ensure users are not allowed to configure batching with cancellation or rate limiting, as these features do not yet function together
  • c271eb1: Add x-inngest-no-retry: true header when non-retriable for internal executor changes
  • 2a93f0b: Fix onFailure functions missing types applied by middleware

2.4.0

Minor Changes

  • 6cb6719: Allow filtering of events within triggers

Patch Changes

  • 55c889c: Expose raw error message if status is unknown

2.3.0

Minor Changes

  • 7792a62: Add support for streaming to inngest/remix

2.2.1

Patch Changes

  • 1120e29: Genercize mixed async error; the same symptom can be caused by a few different errors

2.2.0

Minor Changes

  • d0a8976: Add support for batching events.

    Introduces a new configuration to function configurations.

    batchEvents?: { maxSize: 100, timeout: "5s" }

    This will take Inngest start execution when one of the following conditions are met.

    1. The batch is full
    2. Time is up

    When the SDK gets invoked, the list of events will be available via a newly exported field events.

    createFunction(
      { name: "my func", batchEvents: { maxSize: 100, timeout: "5s" } },
      { event: "my/event" },
      async ({ event, events, step }) => {
        // events is accessible with the list of events
        // event will still be a single event object, which will be the
        // 1st event of the list.
    
        const result = step.run("do something with events", () => {
          return events.map(() => doSomething());
        });
    
        return { success: true, result };
      },
    );

Patch Changes

  • 591f73d: Set ts field on sent events if undefined
  • 1cbf65e: Alter registration response to include modified for deployment deduplication

2.1.0

Minor Changes

  • b74477f: Add optional id property to all step tooling, allowing users to override state recovery

2.0.2

Patch Changes

  • 023d761: Harden error serialization to ensure uncaught exceptions don't slip through during function runs

2.0.1

Patch Changes

  • 3ef0b36: Add better visibility into serve handlers issues
  • 4226b85: Fix middleware transformOutput hook not running if an asynchronous, non-step function's body threw
  • cc3929d: Fix a very rare bug in which step.sleep() hashing could produce different IDs across different executions

2.0.0

Major Changes

  • 4f29f5c: Removed tools parameter (breaking). This was marked as @deprecated in v1, but is being fully removed in v2. Use step instead. See the v2 migration guide.
  • 4f29f5c: Renamed throttle to rateLimit. See the v2 migration guide.
  • 4f29f5c: Added the ability to provide middleware when defining Inngest clients and functions, hooking into a client's lifecycle to add custom functionality like error monitoring, data transformations, and more. See Advanced: Middleware - Inngest Documentation.
  • 4f29f5c: Removed ability to serve() without a client (breaking). See the v2 migration guide.
  • 4f29f5c: Better event schema definitions (breaking), providing an extensible metho of creating and maintaining event payloads with a variety of native tools and third-party libraries. See Defining Event Payload Types - Inngest Documentation.
  • 4f29f5c: Removed some overloads of inngest.send() to provide a better TS experience when sending events (breaking). See the v2 migration guide.

Minor Changes

  • 4f29f5c: Added a logger to Inngest functions in addition to allowing users to provide a custom logger to reliably push logs to external services and handle flushing on serverless environments. See Logging in Inngest - Inngest Documentation.
  • 4f29f5c: Add GetEvents<> export which can be used to pull final event types from an Inngest client. See Defining Event Payload Types.
  • 4f29f5c: Add ability to provide concurrency: { limit: number } in function config, ready for more config options.

Patch Changes

  • b62cd6d: Update landing page vite dependency to v3.2.7

1.9.4

Patch Changes

  • 7d025d6: Fix NonRetriableError not working when thrown from within a step

1.9.3

Patch Changes

  • 64c397e: Handle circular JSON errors while stringifying across the SDK

1.9.2

Patch Changes

  • 71b1a17: Fix Vercel platform check to support local dev while using vercel env pull

1.9.1

Patch Changes

  • 49ddbb5: Add platform deploy checks

1.9.0

Minor Changes

  • 48d94a2: Allow user provided logger to be used within functions (experimental)

1.8.5

Patch Changes

  • 34f9ee8: INN-1253 Show actionable error when steps are nested

1.8.4

Patch Changes

  • aaac9e5: When recommending event key fixes, recommend setting env vars first

1.8.3

Patch Changes

  • c09261b: INN-1348 Throw an actionable error when we detect mixed async logic
  • 98c15b3: INN-1347 Fix deadlock when an async function finds a step

1.8.2

Patch Changes

  • 5462bdd: Ensure Inngest client's env object is used within serve()
  • 0b0c0ad: Add consistent type imports for slightly better tree-shaking

1.8.1

Patch Changes

  • 5573be3: INN-1270 Create an internal handler to enforce more actionable user-facing errors

1.8.0

Minor Changes

  • 65966f5: INN-1087 Add edge streaming support to "inngest/next" serve handler

Patch Changes

  • 164fd5c: INN-1266 Fix bad link for fetching Inngest signing key on landing page

1.7.1

Patch Changes

  • 34b6d39: INN-1240 Add queueMicrotask() fallback for restrictive environments

1.7.0

Minor Changes

  • c999896: INN-1029 Add env option to Inngest client to explicitly push to a particular Inngest env

Patch Changes

  • 131727a: Adjust README to have a slightly clearer intro
  • c999896: INN-1186 Send x-inngest-platform and x-inngest-framework headers during registration
  • 0728308: Expose run ID to function executions for user-managed logging and tracing
  • 3ac579f: Warn users when some functions appear undefined when serving
  • eb1ea34: Allow signing keys with multiple prefixes, as required for branch environment support

1.6.1

Patch Changes

  • a840e67: INN-1126 Execute a step early if it's the only pending item during a discovery

    This reduces the number of "Function steps" used for simple step functions.

1.6.0

Minor Changes

  • c7d1bee: Add onFailure handler to createFunction options, allowing you to specify a new function to run when the initial handler fails

1.5.4

Patch Changes

  • 071fe89: INN-1054 Ensure serve handlers return any instead of unknown so that they don't needlessly conflict with user types

1.5.3

Patch Changes

  • 906aca5: INN-1009 Show warnings when using the package with TS versions <4.7.2 and Node versions <14

    This includes tests to assert we appropriately support these versions now and in the future.

  • ca7d79e: Detect env vars from Node and Deno in serve handlers (INN-1012)

1.5.2

Patch Changes

  • 2d6e0b5: Fix infinite type instantiation using a looping type in serve handlers (thanks for the report, @grempe)

1.5.1

Patch Changes

  • 0836145: Refactor InngestCommHandler to better detect env and reduce duplication (INN-997)

1.5.0

Minor Changes

  • ac81320: Add "inngest/lambda" serve handler for AWS Lambda environments
  • f73a346: Add "inngest/edge" serve handler for use in v8 edge runtimes

1.4.1

Patch Changes

  • 43162d3: The "Connected to inngest dev" pill at the top of the SDK's landing page now links to the connected dev server.

    Thanks, @khill-fbmc!

    image

  • 56b8e9a: Removes many any types from the internal and public APIs.

    Affects the public API, so will therefore be a package bump, but shouldn't affect any expected areas of use.

  • a45601e: Update dependency typescript to v5

    Including a bump for this as it does seem to fix some complex inference for future features.

1.4.0

Minor Changes

  • ebb8740: Add ability to control the concurrency of a specific function via the concurrency option when creating an Inngest function
  • e61cf0f: Add cancelOn option when creating a function, allowing you cancel execution of a function based on incoming events.

1.3.5

Patch Changes

  • a4f8ae8: Fixes a typing bug where both event and cron could be specified as a trigger at the same time.

    Multiple event triggers will be coming in a later update, but not in this format.

  • d6a8329: Ensure signatures are not validated during development

  • 950a2bc: Ensure inngest.send() and step.sendEvent() can be given an empty array without error