Skip to main content

Overview

The Inngest integration provides Effect-first wrappers for Inngest background functions. Create durable, type-safe background jobs with Effect’s structured concurrency and service management.

Installation

Exports

createInngest

Create an Effect-based Inngest client wrapper.

Signature

Parameters

Effect.Effect<Inngest, E, R>
required
An Effect that yields an Inngest client instance.
string
Optional custom tag identifier for the Inngest client. Defaults to '@ff-effect/Inngest'.

Returns

Context.Tag
Context tag for accessing the Inngest client.
Layer
Layer that provides the Inngest client to Effects.
function
Create an Inngest function with an Effect-based handler.
function
Send events to Inngest.
function
Create a fetch-compatible handler for serving Inngest functions.
function
Create an Effect HttpApp handler for serving Inngest functions.

Basic Usage

Setup

Simple Function

Event Handling

Sending Events

Type-Safe Events

Steps

Use the step API for durable execution with automatic retries.

step.run

Execute an Effect as a step:

step.sleep

Sleep for a duration (uses Effect’s Duration):

step.sleepUntil

Sleep until a specific time:

step.sendEvent

Send events from within a function:

step.invoke

Invoke another function and wait for its result:

step.waitForEvent

Wait for an event before continuing:

Cron Schedules

Use Effect’s Cron for type-safe cron schedules:

Using Services

Inngest functions can access Effect services:

Serving Functions

Fetch Handler (Bun, Deno, etc.)

Effect HttpApp Handler

Error Handling

InngestError

Step Errors

Step errors are automatically retried by Inngest:

Complete Example

See Also