Inngest Functions
Inngest functions enable developers to run reliable background logic, from background jobs to complex workflows. An Inngest Function is composed of 3 main parts that provide robust tools for retrying, scheduling, and coordinating complex sequences of operations:
Triggers
A list of Events, Cron schedules or webhook events that trigger Function runs.
Flow Control
Control how Function runs get distributed in time with Concurrency, Throttling and more.
Steps
Transform your Inngest Function into a workflow with retriable checkpoints.
inngest.createFunction({
id: "sync-systems",
// Easily add Throttling with Flow Control
throttle: { limit: 3, period: "1min"},
},
// A Function is triggered by events
{ event: "auto/sync.request" },
async ({ step }) => {
// step is retried if it throws an error
const data = await step.run("get-data", async () => {
return getDataFromExternalSource();
});
// Steps can reuse data from previous ones
await step.run("save-data", async () => {
return db.syncs.insertOne(data);
});
}
);
Using Inngest Functions
Start using Inngest Functions by using the pattern that fits your use case:
Background jobs
Run long-running tasks out of the critical path of a request.
Delayed Functions
Schedule Functions that run in the future.
Cron Functions
Build Inngest Functions as CRONs.
Workflows
Start creating worflows by leveraging Inngest Function Steps.
Learn more about Functions and Steps
Functions and Steps are powered by Inngest's Durable Execution Engine. Learn about its inner working by reading the following guides:
How Functions are executed
A deep dive into Inngest's Durable Execution Engine with a step-by-step workflow run example.
Thinking in Steps
Discover by example how steps enable more reliable and flexible functions with step-level error handling, conditional steps and waits.