---
title: Workflow SDK vs Inngest
description: How the Workflow SDK compares to Inngest, event-driven durable functions that run on your own infrastructure over HTTP, with a concept-mapping migration guide.
docs_index: /llms.txt
lastUpdated: 2026-11-23
type: conceptual
summary: Inngest is an event-driven durable-functions platform that invokes your code over HTTP and memoizes step results. The Workflow SDK co-locates orchestration and execution and replays from an event log.
prerequisites:
  - /docs/foundations/workflows-and-steps
related:
  - /docs/foundations/hooks
  - /docs/foundations/idempotency
  - /docs/foundations/streaming
  - /docs/ai
---

> For an index of all documentation, see [/llms.txt](/llms.txt).

[Inngest](https://www.inngest.com) is a durable-functions platform with an **event-driven** core: functions trigger on events or cron, and Inngest invokes your code (running on your own infrastructure) one step at a time over HTTP, memoizing each step's result. It overlaps heavily with the Workflow SDK, with a different execution topology and a strong AI/agent story on both sides.

> **Choose the Workflow SDK** when you want orchestration and execution co-located (no per-step HTTP round trips), deployment-pinned versioning, and a supported open-source self-hosting path. **Choose Inngest** when an event-bus model fits your architecture and you want built-in flow controls for concurrency, throttling, debounce, batching, and priority.

## At a glance

|                          | Workflow SDK                                                                                                                                                              | Inngest                                                                                                                                                                                                                                                   |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Category**             | Open-source durable-functions SDK                                                                                                                                         | Durable functions on an event-driven platform                                                                                                                                                                                                             |
| **Durability model**     | Event log + deterministic replay                                                                                                                                          | **Step-result memoization** (each `step.run` runs once; completed steps are skipped), not whole-function replay                                                                                                                                           |
| **Trigger model**        | Direct `start(workflow, [args])` (import the function)                                                                                                                    | Event bus (`inngest.send`) + cron; loosely coupled publishers/consumers                                                                                                                                                                                   |
| **Where execution runs** | Orchestration + execution co-located on your platform                                                                                                                     | **Your code runs on your infrastructure**; Inngest invokes it per step over HTTP (Serve) or a persistent worker connection (Connect, in public beta)                                                                                                      |
| **Languages**            | TypeScript / JavaScript (Python beta)                                                                                                                                     | TypeScript; Python and Go (production, pre-1.0)                                                                                                                                                                                                           |
| **Versioning**           | Runs pinned to immutable deployment                                                                                                                                       | Tracked by step-ID hashes: hot-edit functions, but editing a step's logic under the **same ID** reuses the old memoized result for in-flight runs; rename the ID or route a new function by timestamp for rewrites                                        |
| **Duplicate starts**     | `start(workflow, args, { experimental_hook: { token } })` admits one run per token, with an optional retention after the run ends                                         | `idempotency` key (24-hour window) or `singleton`                                                                                                                                                                                                         |
| **Rate limiting**        | [`experimental_rateLimit()`](/docs/foundations/rate-limits) paces any call inside a run, on a key every run shares: a run waits for its slot, or gives up after `maxWait` | `throttle` (queues run starts) and `rateLimit` (drops run starts) on the function, applied before a run starts                                                                                                                                            |
| **Searching runs**       | String [attributes](/docs/observability/attributes) set with `setAttributes()` or at `start()`, filterable by `key=value`                                                 | Search by event payload in the Inngest dashboard                                                                                                                                                                                                          |
| **AI & streaming**       | `WorkflowAgent` in the AI SDK; native resumable streaming                                                                                                                 | Native AI SDK via `step.ai.wrap`; **AgentKit** multi-agent framework and durable **Realtime** (`step.realtime.publish`) + `useAgent` hook, both Developer Preview                                                                                         |
| **Security**             | Zero-config per-run end-to-end (E2E) encryption by default; platform security is per World (the Vercel World inherits Vercel's security posture)                          | Runs on your infrastructure; signed requests; first-party E2E encryption middleware (TypeScript and Python); SOC 2 Type II, HIPAA add-on                                                                                                                  |
| **Portability**          | Apache-2.0; World abstraction; **self-host supported**                                                                                                                    | Engine open source (Server Side Public License); self-host via single Go binary + Postgres, but **self-hosting is community/best-effort**: no support service-level agreement, and the `inngest start` binary is Beta (the hosted service is the default) |
| **Pricing**              | SDK free; pay your platform                                                                                                                                               | Per-execution: billed for the run **plus each step plus retries**; Pro from $99/mo, then \~$50 per 1M executions                                                                                                                                          |
| **Limits**               | 50 MB payload; 2 GB/run; 10,000 steps ([Vercel World limits](https://vercel.com/docs/workflows/pricing))                                                                  | 1,000 steps/function; 4 MiB step payload; 32 MiB run state; runs up to 366 days                                                                                                                                                                           |

**What the limits mean in practice**: Inngest's caps are restrictive for real long-running AI workloads. An agent loop spends steps on every model and tool call, so it can consume 1,000 steps per function; a single large language model response can approach the 4 MiB step-payload cap; and an accumulated conversation or context can outgrow 32 MiB of run state. The [Vercel World limits](https://vercel.com/docs/workflows/pricing) are 50 MB per payload and 2 GB of state per run.

## Topology: co-located vs. invoked-over-HTTP

Inngest's engine lives outside your code and calls your functions step-by-step over HTTP (or a Connect worker). That keeps your code on your own infrastructure for portability and data locality, but adds a network round trip per step. This overhead matters for workflows with many small sequential steps. The Workflow SDK co-locates orchestration and execution on one platform, so steps don't require a per-step HTTP request.

Since v5, one invocation also runs as many steps as it can in a single pass, several of them in parallel, and only hands back to the queue for a wait, a hook, or when the function nears its time limit. A chain of small steps therefore costs a few invocations rather than one per step. See [Performance](/docs/performance) for the benchmarks.

Triggering also differs. Inngest is event-driven (publishers `send` events; functions subscribe), which supports loosely coupled fan-out. The Workflow SDK's `start()` imports the workflow function directly, providing tighter coupling and stronger type safety. For event-bus-style fan-out, wrap `start()` in a shared publisher. A run can also call `start()` itself to spawn a child run, without wrapping it in a step.

## Versioning

Inngest doesn't use version numbers; it keys state by **step-ID hash**, so you can edit functions while runs are in flight. The catch: if you change the logic *inside* a step but keep the same ID, in-flight runs that already completed that step silently reuse the **old** memoized result: only new runs see the change. To force re-execution you rename the step ID, and for incompatible rewrites the recommended pattern is a new function with timestamp-based event routing.

The Workflow SDK pins each run to its immutable deployment, so in-flight runs always finish on the exact code they started with, and upgrades are explicit: no per-step-ID reasoning required.

## AI agents

Inngest offers `step.ai.wrap()` (wrap Vercel AI SDK calls as durable steps), **AgentKit** (a multi-agent framework with Model Context Protocol (MCP) tools), and durable **Realtime** streaming with a `useAgent` React hook, though AgentKit and Realtime are both Developer Preview. The Workflow SDK offers `WorkflowAgent` directly inside the AI SDK and native [resumable streaming](/docs/ai/resumable-streams). AgentKit fits event-driven applications that need an integrated agent framework. The Workflow SDK fits applications that need the agent loop to be a durable workflow with streaming built into the runtime.

## Migrating from Inngest

### Run the codemod

The `workflow` CLI includes a codemod that does the mechanical part of a migration. Run it from your project root, on a clean working tree so its changes are easy to review:

```bash
npx workflow migrate inngest
```

It reads the project's `tsconfig.json` to find the files to migrate, and uses the project's own TypeScript. Pass paths to limit it (`npx workflow migrate inngest src/inngest`), `--dry-run` to see what would change without writing anything, and `--report <file>` to write a Markdown report. See [`workflow migrate`](/docs/configuration/cli-and-web-ui#migrate-from-inngest) for every flag.

The main job is lifting each `step.run()` closure into a named `"use step"` function. A closure can read anything in scope, but a step function only gets its arguments, because they are recorded in the event log. So the codemod finds every variable the closure reads from the handler (the event, earlier step results, loop variables), makes each one a parameter of the new step function, and passes it at the call site. It lists the captured variables of every step it lifts, so you can check that each one is [serializable](/docs/foundations/serialization). Variables declared at module scope, such as imports and constants, stay visible to a module-level step and are not passed.

```typescript title="inngest/functions.ts (before)"
import { inngest } from './client';
import { userActive, userSignup } from './events';
import { db, email } from './services';

export const onboardUser = inngest.createFunction(
  { id: 'onboard-user', retries: 5, triggers: [userSignup] },
  async ({ event, step }) => {
    const user = await step.run('create-user', () =>
      db.users.create({ id: event.data.userId, email: event.data.email })
    );

    await step.sleep('wait-a-day', '1d');

    const activity = await step.waitForEvent('wait-for-activity', {
      event: userActive,
      timeout: '7d',
      match: 'data.userId',
    });

    await step.run('send-follow-up', () =>
      email.send(user.email, activity ? 'tips' : 'nudge')
    );
  }
);
```

```typescript title="inngest/functions.ts (after, formatted)"
import { createHook, type Hook, sleep } from 'workflow';

export async function onboardUser(event: {
  data: { userId: string; email: string };
}) {
  'use workflow';
  const user = await createUser(event); // [!code highlight]

  await sleep('1d');

  // TODO(workflow-migrate): Only one run at a time can own this hook token. Inngest resumed every run waiting for a matching "app/user.active"; if two onboardUser runs can wait for the same key at once, add something unique to the token (for example the run ID) and resume each run where the event is sent. Otherwise, delete this comment.
  const activity = await waitForHook(
    createHook({ token: `app/user.active:onboardUser:${event.data.userId}` }), // [!code highlight]
    sleep('7d')
  );

  await sendFollowUp(user, activity); // [!code highlight]
}

async function createUser(event: { data: { userId: string; email: string } }) {
  'use step';
  return db.users.create({ id: event.data.userId, email: event.data.email });
}
createUser.maxRetries = 5;

async function sendFollowUp(
  user: { id: string; email: string },
  activity: any
) {
  'use step';
  return email.send(user.email, activity ? 'tips' : 'nudge');
}
sendFollowUp.maxRetries = 5;

/** Resolves with the hook's payload, or with null once `timeout` resolves. */
async function waitForHook<T>(
  hook: Hook<T>,
  timeout?: Promise<void>
): Promise<T | null> {
  try {
    return await (timeout
      ? Promise.race([hook, timeout.then(() => null)])
      : hook);
  } finally {
    hook.dispose();
  }
}
```

The run above prints each step it lifted with the variables it captured:

```bash
inngest/functions.ts
  onboardUser (was onboard-user)
    step create-user -> createUser() captures event
    step send-follow-up -> sendFollowUp() captures user, activity
    hook app/user.active -> token `app/user.active:onboardUser:${event.data.userId}`
```

Beyond `step.run()`, the codemod:

- Turns each `createFunction()` into an exported `"use workflow"` function that takes the triggering event as its argument, so `event.data` keeps working. With typed events, it types the parameter, and it types each captured parameter from its call site.
- Rewrites `step.sleep()`, `step.sleepUntil()`, `step.fetch()`, `step.invoke()` and `step.ai.wrap()`. A `step.ai.wrap()` step evaluates its inputs itself, so the model object is never passed as an argument, and returns only the fields you destructure from the result.
- Turns `step.waitForEvent()` and `step.waitForSignal()` into a hook raced against `sleep()`, through a small `waitForHook()` helper it adds to the file. The helper disposes the hook when the wait ends, so a later wait in the same run can use the same token, as Inngest allowed. A `waitForEvent()` token is built from the event name, the workflow name, and the value `match` compared (or an `if` expression that compares one field), so the code that sent the event can build the same token for `resumeHook()`.
- Turns `retries` into `maxRetries` on every step, `NonRetriableError` into `FatalError`, `RetryAfterError` into `RetryableError`, `runId` into `getWorkflowMetadata().workflowRunId`, `attempt` into `getStepMetadata().attempt - 1`, and `logger` into `console`. It follows `const` references, so `retries: MAX_RETRIES` and a config object declared elsewhere in the file are read too.
- Imports the Workflow APIs it uses under an alias when the file already has a binding with that name, and removes imports that nothing uses any more, such as the Inngest client and the error classes.

It never guesses. Code it cannot migrate without changing behavior is left in place under a `// TODO(workflow-migrate): ...` comment that says what to do. That covers a closure that assigns to a variable outside it (the write would be lost once the value is passed by value), a closure that calls a function declared in the handler, `step.sendEvent()`, flow-control options, cron triggers, function options it cannot read, and global `fetch()` calls outside a step. Every migrated `waitForEvent()` also gets one, because of [one owner per token](#one-owner-per-token).

The report lists every `inngest.send()` and `serve()` call in the project with its replacement, and has an **Event routing** table: for each event name, the workflows it starts and the hook tokens it resumes. That table is what you need to rewrite an app that forwards events generically, such as `inngest.send({ name: req.body.name, data: req.body.data })`.

### What the codemod converts

| Inngest                                                                               | Converted automatically                                                                                    | Left as a TODO                                                                                                                                                                                                                 |
| ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `createFunction()`                                                                    | Module-level function, assigned to a `const` or `export default`                                           | Created inside another function, or not assigned                                                                                                                                                                               |
| Function options                                                                      | `id`, `triggers`, `retries`, also through `const` references                                               | `concurrency`, `throttle`, `rateLimit`, `debounce`, `batchEvents`, `priority`, `timeouts`, `cancelOn`, `idempotency`, `singleton`, `middleware`, cron triggers; options it cannot read; `onFailure` (kept as a named function) |
| `step.run()`                                                                          | Closures and function references, with captured variables, inputs, and parameter defaults or computed keys | Closures that assign to a captured variable, call a function declared in the handler, use `this`, or call another step                                                                                                         |
| `step.sleep()` / `step.sleepUntil()` / `step.fetch()` / `step.invoke()`               | Yes                                                                                                        | `step.invoke()` given a function by reference                                                                                                                                                                                  |
| `step.waitForEvent()`                                                                 | `match`, or an `if` that compares one field                                                                | Any other `if`, a wait with neither, and the [one owner per token](#one-owner-per-token) check                                                                                                                                 |
| `step.waitForSignal()`                                                                | Yes, keeping the `{ signal, data }` result, and a replaced wait timing out with `null`                     | None                                                                                                                                                                                                                           |
| `step.ai.wrap()`                                                                      | Yes                                                                                                        | Inputs that `await`                                                                                                                                                                                                            |
| `step.sendEvent()`, `step.sendSignal()`, `step.ai.infer()`, `step.realtime.publish()` | None                                                                                                       | All                                                                                                                                                                                                                            |
| Handler context                                                                       | `event`, `runId`, `attempt`, `logger`                                                                      | `events` (batches), middleware context                                                                                                                                                                                         |

> For what the codemod leaves to you, install the migration skill and ask your agent to finish the migration:
>
> ```bash
> npx skills add https://github.com/vercel/workflow --skill migrating-to-workflow-sdk
> ```

### Concept mapping

| Inngest                                             | Workflow SDK                                                                                                                                          | Note                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `inngest.createFunction()`                          | `"use workflow"` function started with `start()`                                                                                                      | No factory or event binding.                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `step.run()`                                        | `"use step"` function                                                                                                                                 | Named async function with Node.js access. Variables the closure captured become arguments.                                                                                                                                                                                                                                                                                                                                                                |
| `step.sleep()` / `step.sleepUntil()`                | `sleep('5m')` / `sleep(date)`                                                                                                                         | Import from `workflow`.                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `step.waitForEvent()`                               | `createHook()` raced against `sleep()`, disposed when the wait ends                                                                                   | The token encodes what `match` compared; `resumeHook(token, event)` replaces sending the event, once for each workflow waiting for it. One run owns a token at a time: see [One owner per token](#one-owner-per-token). Use [`createWebhook()`](/docs/api-reference/workflow/create-webhook) when the sender needs a URL to call.                                                                                                                         |
| `step.waitForSignal()` / `inngest.sendSignal()`     | `createHook({ token: signal })` / `resumeHook(signal, { signal, data })`                                                                              | Resume with the `{ signal, data }` envelope, so code that reads `result.data` keeps working. `onConflict: 'replace'` maps to [`experimental_force: true`](/docs/api-reference/workflow/create-hook#take-over-a-token-another-run-holds). The replaced run's `await hook` rejects with `HookForceClaimedError`; where Inngest left that wait pending until its timeout and then returned `null`, the codemod's helper catches the error and does the same. |
| `step.invoke()`                                     | [`start()`](/docs/foundations/starting-workflows) called in the workflow, then `await run.returnValue`                                                | Spawns a child run; the parent waits without polling.                                                                                                                                                                                                                                                                                                                                                                                                     |
| `inngest.send()` / event triggers                   | `start()` from your app boundary                                                                                                                      | Start workflows directly.                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `idempotency`                                       | [`start(workflow, args, { experimental_hook: { token, experimental_minRetention: '24h' } })`](/docs/foundations/idempotency#start-a-run-once-per-key) | A duplicate start throws `HookConflictError` naming the run that owns the token, for 24 hours from the first start, as Inngest's idempotency window does.                                                                                                                                                                                                                                                                                                 |
| `singleton: { mode: 'skip' }`                       | `start(workflow, args, { experimental_hook: { token } })` without a retention                                                                         | Only overlapping runs are refused: the token is released when the run ends, so the next start is admitted. Catch `HookConflictError` to skip.                                                                                                                                                                                                                                                                                                             |
| `singleton: { mode: 'cancel' }`                     | On `HookConflictError`, `await getRun(error.conflictingRunId).cancel()`, then start again                                                             | The newest run replaces the running one. Don't set a retention: a retained token stays refused after the cancel.                                                                                                                                                                                                                                                                                                                                          |
| `cancelOn` / cancel from the dashboard              | [`run.cancel()`](/docs/foundations/cancellation), or an `AbortController` whose signal is passed into steps                                           | `run.cancel({ cancelReason })` records why. `workflow cancel --status running --workflowName <id>` cancels in bulk.                                                                                                                                                                                                                                                                                                                                       |
| `retries` / `RetryAfterError` / `NonRetriableError` | `stepFn.maxRetries`, `RetryableError`, `FatalError`                                                                                                   | Retries live at the step boundary. For custom backoff via `retryAfter`, see [Errors & Retrying](/docs/foundations/errors-and-retries#customize-retry-behavior).                                                                                                                                                                                                                                                                                           |
| `step.fetch()`                                      | [`fetch`](/docs/api-reference/workflow/fetch) from `workflow`                                                                                         | A step that makes the request.                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `step.ai.wrap()`                                    | A `"use step"` function that calls the model                                                                                                          | Or [`WorkflowAgent`](/docs/ai) for an agent loop.                                                                                                                                                                                                                                                                                                                                                                                                         |
| `runId` / `attempt`                                 | `getWorkflowMetadata().workflowRunId` / `getStepMetadata().attempt - 1`                                                                               | `getStepMetadata().attempt` counts from 1, where Inngest counted from 0, and it is only available inside a step.                                                                                                                                                                                                                                                                                                                                          |
| `step.realtime.publish()` / Realtime                | `getWritable()` / named streams                                                                                                                       | Clients read from the stream.                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Event payload search                                | [`setAttributes()`](/docs/api-reference/workflow/set-attributes) or `start({ attributes })`                                                           | Filter runs by `key=value` in the CLI, the web UI, and Vercel Observability.                                                                                                                                                                                                                                                                                                                                                                              |

### What behaves differently

- **Step results keep their types.** Inngest serializes step results as JSON, so a `Date` came back as a string and a step that returned nothing came back as `null`. The Workflow SDK keeps `Date`, `Map`, `Set`, `URL`, typed arrays and the other [serializable types](/docs/foundations/serialization), and a step that returns nothing returns `undefined`. Code that parsed a string back into a `Date` keeps working; code that used the string directly needs a change.
- **Code outside steps runs in a sandbox.** An Inngest handler could call `fetch()` or a database outside `step.run()`, and the call ran again on every request. A workflow function runs deterministically, without Node.js APIs or I/O, so move that code into a step.
- **Step arguments are copies.** A step that changed a captured object in Inngest only changed it in the invocation that ran the step, and a memoized step does not run again. The same change is invisible to the workflow here, so return the new value instead.
- **The event shape is yours.** The workflow receives what you pass to `start()`. Fields Inngest filled in, such as `event.id` and `event.ts`, are only there if you pass them; use `getWorkflowMetadata()` for the run ID and start time.

### One owner per token

Inngest delivers an event to every run waiting for it. A hook token has one owner at a time: while a run holds it, another `createHook()` with the same token rejects with [`HookConflictError`](/docs/api-reference/workflow-errors/hook-conflict-error). Three cases follow:

- **Two workflows waiting for the same event.** The codemod puts the workflow name in the token (`app/user.active:onboardUser:${userId}`), so each has its own. Where the event is sent, resume each of them; the report's Event routing table lists the tokens.
- **The same run waiting again.** The generated `waitForHook()` helper disposes the hook when the wait ends, so the next wait can create it again.
- **Two runs of the same workflow waiting for the same key at once.** This one needs a decision. Add something unique to the token, such as the run ID or the ID of the record the run handles, and resume each run from the sender. If only one run can wait per key, delete the TODO.

### Verify the migration

Before you switch traffic, run the same inputs through both versions and compare what each run returns:

1. Keep a copy of the Inngest app and run it against the Inngest dev server (`npx inngest-cli dev`).
2. Build the migrated app and run it locally against the [Local World](/worlds/local).
3. Give both apps the same entry points: one that sends an event, one that sends a signal, and one that reads a run's result. On the Inngest side, these call `inngest.send()`, `inngest.sendSignal()` and the dev server's API. On the Workflow side, they call `start()` and `resumeHook()` as the Event routing table says, and `getRun()`.
4. For every function, send the events that drive each path (success, the fatal error, retries, a wait that is resumed, a wait that times out) and compare the outputs and final statuses.

Also typecheck and build the migrated app: the codemod's annotations are checked against your project, but your own types only meet the new code once you build.

### Cut over

Runs started on Inngest keep running on Inngest. Move new work to the Workflow SDK, and keep the Inngest app deployed until its in-flight runs, sleeps and waits have drained:

1. Deploy the migrated app next to the Inngest one, with the Inngest `serve()` route still in place.
2. Point new events at `start()`. Senders that resume waits need both paths for a while: send the Inngest event for runs that started there, and call `resumeHook()` for runs that started on the Workflow SDK.
3. Keep business-level idempotency across both: a duplicate request should not start a Workflow run for work an Inngest run already does. `start({ experimental_hook: { token } })` with the same business key you used for Inngest `idempotency` covers the Workflow side.
4. Once no Inngest runs are left, delete the `serve()` route, the client and the `inngest` dependency. Keep protecting the endpoints that start or resume runs the way you protected the ones that sent events, and point dashboards and alerts at the Workflow SDK's [observability](/docs/observability).

### Flow control, schedules and failure handling

Inngest configures these on the function, and its event bus applies them before a run starts. The Workflow SDK has no event bus between the sender and the run, so you build each one where it belongs. A [start token](/docs/foundations/idempotency#run-idempotency) on `start()` keeps duplicate or excess work from ever becoming a run, and [`experimental_rateLimit()`](/docs/foundations/rate-limits) paces the work inside runs. A hook, a `sleep()` or a step handles the rest:

| Inngest                                                                | With the Workflow SDK                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `rateLimit: { key, limit, period }`                                    | [`experimental_rateLimit()`](/docs/foundations/rate-limits) with a short `maxWait` at the top of the workflow, returning when it rejects; or, to start no run at all, a start token per key retained for the period. See [Rate limit](#rate-limit).                                                                                                                                                                                                                                          |
| `debounce: { key, period }`                                            | One run per key and window that waits out the window, then reads the current state in a step. See [Debounce](#debounce).                                                                                                                                                                                                                                                                                                                                                                     |
| `batchEvents: { maxSize, timeout, key }`                               | The same shape as debounce: store each event where a step can read it, such as a table keyed by the batch key, start one run per window, and read the whole batch in a step once the window ends.                                                                                                                                                                                                                                                                                            |
| `concurrency: { key, limit: 1 }` where overlapping runs can be dropped | The `singleton: { mode: 'skip' }` row in [Concept mapping](#concept-mapping): a start token with no retention.                                                                                                                                                                                                                                                                                                                                                                               |
| `concurrency` where runs wait their turn                               | Native per-key locks are in development (see the [concurrency controls discussion](https://github.com/vercel/workflow/discussions/301)). Until they ship, keep the lock you use today inside the steps that need it, and make those steps safe to repeat.                                                                                                                                                                                                                                    |
| `throttle: { key, limit, period, burst }`                              | [`experimental_rateLimit()`](/docs/foundations/rate-limits) at the top of the workflow, or in front of the step the limit protects. Each run waits for its slot, as a throttled run waits in Inngest's queue. See [Throttle](#throttle).                                                                                                                                                                                                                                                     |
| `priority`                                                             | No equivalent. Runs start in the order `start()` is called.                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Cron triggers                                                          | [Vercel Schedules](https://vercel.com/docs/schedules/workflows). A schedule publishes to a queue topic, and its consumer calls `start()` with the occurrence's `executionId` in the start token, retained for longer than redeliveries can arrive (for example `experimental_minRetention: '7 days'`), so a redelivered occurrence never starts a second run, even after the first has finished. Schedules take an IANA `timezone` and also run in Preview branches and custom environments. |
| Several functions triggered by one event                               | One `start()` per target workflow where the event is sent, each with its own start token, such as `` `${targetName}:${event.id}` ``, retained with `experimental_minRetention: '24h'`. A retried send within 24 hours then never starts a target twice, even one that has already finished, as with Inngest's 24-hour deduplication of events by `id`. Without the retention, the token is released when the target's run ends.                                                              |
| `onFailure`                                                            | [`registerLifecycleHooks({ onRunFailed })`](/docs/api-reference/workflow-api/register-lifecycle-hooks) reports failed runs from one place, for example to Slack or Sentry. It is best-effort. Where a workflow must compensate, also wrap its body in `try`/`catch`, call a cleanup step in `catch`, then rethrow.                                                                                                                                                                           |

#### Throttle

Inngest's `throttle` holds runs over the limit in a queue and starts them as capacity frees up. Call [`experimental_rateLimit()`](/docs/foundations/rate-limits) before the work the limit protects for the same effect. Every run starts, and each one waits for its slot on the key, suspended like a `sleep()`:

```typescript lineNumbers
import { experimental_rateLimit } from "workflow";

// Inngest: throttle: { key: "event.data.accountId", limit: 10, period: "1m" }
export async function syncAccount(accountId: string) {
  "use workflow";
  await experimental_rateLimit({ key: `crm:${accountId}`, limit: 10, period: "1m" }); // [!code highlight]
  await pushToCrm(accountId);
}
```

Unlike `throttle`, which limits run starts, `experimental_rateLimit()` can sit in front of any call in a run, so a workflow that calls an API in a loop stays under its limit on every call. Inngest's `burst: n` adds `n` starts on top of `limit`, while `experimental_rateLimit()`'s `burst` counts how many calls an idle key admits at once, so Inngest's `burst: n` is `burst: n + 1`. To give up on a call that would wait too long, as a start timeout does for a throttled run, set `maxWait`.

#### Rate limit

Inngest's `rateLimit` drops events once the limit for a key is reached in the period, using GCRA. There are two ways to do the same, which differ in where the excess is dropped.

**Inside the run, with `experimental_rateLimit()`.** Call it first thing in the workflow with a short `maxWait`, and return when it rejects with `RateLimitMaxWaitError`. It takes any `limit`, `period` and `burst`, makes the same GCRA decision as Inngest, and can guard any call in the run, not only its start:

```typescript lineNumbers
import { experimental_rateLimit } from "workflow";
import { RateLimitMaxWaitError } from "workflow/errors";

// Inngest: rateLimit: { key: "event.data.accountId", limit: 10, period: "1m" }
export async function syncAccount(accountId: string) {
  "use workflow";
  try {
    await experimental_rateLimit({ key: `sync:${accountId}`, limit: 10, period: "1m", maxWait: "1s" }); // [!code highlight]
  } catch (error) {
    if (RateLimitMaxWaitError.is(error)) return { skipped: true }; // rate-limited
    throw error;
  }
  await pushToCrm(accountId);
  return { skipped: false };
}
```

Every dropped event still starts a run, which records its creation, its start, the refused call and its completion before it ends. That is fine for occasional excess, but a sender that is rate-limited most of the time creates a run for every event it sends.

**Before the run, with a start token.** A start token retained for the period drops the excess at `start()`, so a dropped event never becomes a run. It covers `limit: 1` directly. The token stays taken until the period has passed since the accepted start, and for as long as that run is still running:

```typescript lineNumbers
import { start } from "workflow/api";
import { HookConflictError } from "workflow/errors";

// Inngest: rateLimit: { key: "event.data.accountId", limit: 1, period: "1m" }
export async function requestSync(accountId: string) {
  try {
    await start(syncAccount, [accountId], {
      experimental_hook: {
        token: `sync-account:${accountId}`,
        experimental_minRetention: "1m", // [!code highlight]
      },
    });
    return { started: true };
  } catch (error) {
    if (HookConflictError.is(error)) return { started: false }; // rate-limited
    throw error;
  }
}
```

To limit by fixed windows instead, put the window number in the token, as in `` `sync-account:${accountId}:${Math.floor(Date.now() / 60_000)}` ``. For `limit: n`, try `n` tokens per window (`:0` to `:n-1`) and skip when all of them are taken. To pace the excess runs instead of dropping them, see [Throttle](#throttle).

#### Debounce

Inngest's `debounce` runs once, with the last event, after events for a key stop arriving for the period. When the run can read the current state itself, one run per key and window gives the same result with the fewest runs and events. The first event in a window starts the run, and every later event in that window is refused at `start()`, so it never becomes a run:

```typescript title="lib/pack-changed.ts" lineNumbers
import { start } from "workflow/api";
import { HookConflictError } from "workflow/errors";
import { refreshPack } from "@/workflows/refresh-pack";

const WINDOW_MS = 3 * 60_000; // Inngest: debounce: { key: "event.data.packId", period: "3m" }

// Call after writing the change to the database.
export async function packChanged(packId: string) {
  const windowEnd = (Math.floor(Date.now() / WINDOW_MS) + 1) * WINDOW_MS;
  try {
    await start(refreshPack, [packId, windowEnd], {
      experimental_hook: { token: `refresh-pack:${packId}:${windowEnd}` }, // [!code highlight]
    });
  } catch (error) {
    if (!HookConflictError.is(error)) throw error; // this window already has a run
  }
}
```

```typescript title="workflows/refresh-pack.ts" lineNumbers
import { sleep } from "workflow";

export async function refreshPack(packId: string, windowEnd: number) {
  "use workflow";

  await sleep(new Date(windowEnd + 10_000)); // the window, plus a margin for late starts
  await refreshFromDatabase(packId);
}

async function refreshFromDatabase(packId: string) {
  "use step";
  await loadAndPublishPack(packId); // reads the pack's current state
}
```

An event that is refused wrote its change before it picked its window, so before that window ended. The run reads the database only after the window and the margin, so it sees every change in its window. If the run has already finished, the token is free again and the late event starts a new run, which reads the change too. The difference from Inngest is the timing: a key that keeps receiving events runs once per window instead of waiting for a quiet period, so set the window to the longest delay you can accept.

When the run needs the events themselves rather than the current state, store each event before calling `start()`, as for `batchEvents`, and read the window's events in the step.

***

*Compiled from public documentation. Inngest tier names and pricing vary across sources; verify against [inngest.com/pricing](https://www.inngest.com/pricing). Not based on head-to-head benchmarks.*

---

For a semantic overview of all documentation, see [/sitemap.md](/sitemap.md)

For an index of all available documentation, see [/llms.txt](/llms.txt)

For agent-facing discovery, including API and MCP surfaces, see [/agents.md](/agents.md)