Report this

What is the reason for this report?

How to handle background jobs and events easily with Inngest

Published on October 24, 2025
How to handle background jobs and events easily with Inngest

Introduction

Modern web applications need background jobs to maintain smooth user experiences—sending welcome emails, running reports, processing files, and triggering alerts. Traditionally, this required setting up job queues and worker servers, adding infrastructure complexity and monitoring overhead.

Inngest eliminates this complexity by allowing you to define background functions as event-driven jobs. Your app emits an event (like user/created), and Inngest automatically invokes the right function reliably at scale without requiring you to manage servers or queues.

DigitalOcean App Platform provides streamlined deployment from GitHub repositories with automatic building, deploying, and scaling. Using App Platform’s SaaS Add-Ons feature, you can integrate Inngest with your application in just a few clicks.

This tutorial will guide you through deploying your app on App Platform, adding Inngest as a SaaS Add-On, configuring environment variables, syncing your app with Inngest, and testing the integration. By the end, your application will handle background jobs without additional infrastructure management.

Key Takeaways

  • Inngest eliminates infrastructure complexity by handling background job processing without requiring you to manage servers, queues, or worker processes
  • DigitalOcean App Platform’s SaaS Add-Ons make it simple to integrate Inngest with your existing applications in just a few clicks
  • Event-driven architecture allows your app to emit events (like user/created) and Inngest automatically invokes the appropriate functions
  • Zero-infrastructure scaling means Inngest handles reliability, retries, and scaling automatically as your application grows
  • Secure integration uses environment variables and signing keys to ensure safe communication between your app and Inngest

What is Inngest and how does it work with DigitalOcean App Platform?

Inngest is an event-driven, durable workflow engine that lets you run reliable background jobs and orchestrate workflows on any platform—including serverless environments. Instead of maintaining servers, job queues, or worker processes, you simply define functions in your application that respond to specific events.

When your application emits an event (for example, user/created), Inngest detects it and invokes the corresponding function automatically and reliably, handling scaling, retries, and failure recovery for you. This event-driven approach is ideal for building resilient, maintainable systems where background jobs and workflows are essential.

Real-life Examples & Use Cases:

  • Sending User Welcome Emails: When a new user registers (user/created), automatically trigger an email welcome sequence.
  • Image or Video Processing: When a user uploads media (media/uploaded), kick off background processing without blocking the main app.
  • Order Processing in E-commerce: Respond to events like order/placed or payment/received to manage inventory, notify fulfillment providers, or send receipts.
  • Scheduled Reports or Notifications: Use time-based events to periodically generate and email reports or reminders.

DigitalOcean App Platform streamlines deployment by allowing you to launch applications directly from GitHub repositories. It automatically handles build, deploy, and scaling steps. By integrating Inngest using App Platform’s SaaS Add-Ons feature, you can connect your background job workflows to your application with just a few clicks—unlocking powerful event-driven capabilities with minimal setup.

Prerequisites

Before starting, make sure you have:

How to deploy your application to DigitalOcean App Platform?

If your app is not yet on App Platform, you’ll need to deploy it. DigitalOcean App Platform makes deployment straightforward by automatically detecting your framework and handling the build process. For more detailed deployment guidance, see our App Platform deployment guide.

  • Log in to the DigitalOcean Control Panel.
  • From the left-hand menu, go to Apps.
  • Click Create App.
  • Select GitHub as the source and connect your account if you haven’t already.
  • Choose the repository and branch (usually main or master).
  • App Platform will auto-detect your framework (for example, Node.js or Next.js) and pre-fill build and run commands.
  • Select the deployment region (closest to your primary users).
  • Click Next, review your configuration, and then click Create App.

DigitalOcean will deploy your app and give you a live URL, such as:

https://<your-app-name>.ondigitalocean.app

This URL is what users will interact with and what Inngest will connect to later.

How to add Inngest as a SaaS Add-On to your App Platform project?

Now that your app is running, the next step is to integrate Inngest as a SaaS Add-On. This process automatically generates the necessary credentials for secure communication between your app and Inngest.

  • Open your application from the Apps section.
  • Go to SaaS Add-Ons.
  • Click Add SaaS Add-OnInngest.
  • Select the region closest to your app’s deployment.
  • Click Create Resource.

inngest_on_saas_add_on_menu

DigitalOcean will now:

  • Attach Inngest as an add-on to your project.
  • Automatically generate secure credentials (INNGEST_EVENT_KEY and INNGEST_SIGNING_KEY):

inngest_sidebar_menu

  • Make these keys available for you to configure in the next step.

How to configure environment variables for Inngest integration?

Your app needs the keys generated in the previous step to securely communicate with Inngest. These environment variables enable authentication and ensure that only your application can trigger Inngest functions.

  • Go to your app’s Components → Web Service section.
  • Scroll down to Environment Variables and click Edit.
  • Add the following:
    • INNGEST_EVENT_KEY → copy from the Inngest SaaS Add-On.
    • INNGEST_SIGNING_KEY → copy from the Inngest SaaS Add-On.
  • Save your changes.
  • Redeploy your app so the new environment variables are available.

How to sync your app with Inngest?

Your repository should contain the logic to integrate with Inngest. This involves creating an API endpoint that Inngest can communicate with and defining functions that respond to specific events. The two major components that handle this integration are:

The API Route

Located at app/api/inngest/route.js:

import { serve } from "inngest/next";
import { inngest } from "../../../src/inngest/client";
import * as fns from "../../../src/inngest/functions";

export const { GET, POST, PUT } = serve({
  client: inngest,
  functions: Object.values(fns),
});

This route:

  • Registers all your functions with Inngest when the app boots
  • Listens for signed requests from Inngest
  • Verifies authenticity using the Signing Key

For more information about managing environment variables in App Platform, see our documentation.

The Functions

Functions live in src/inngest/functions/.

Example: userCreated.js:

import { inngest } from "../client";

export const userCreated = inngest.createFunction(
  { id: "user-created" },
  { event: "user/created" },
  async ({ event }) => {
    console.log("User created event:", event);
    return { name: event.data.name };
  }
);

Example: welcomeEmail.js:

import { inngest } from "../client";

export const welcomeEmail = inngest.createFunction(
  { id: "welcome-email" },
  { event: "user/created" },
  async ({ event }) => {
    console.log("Sending welcome email to", event.data.email);
    return { email: event.data.email };
  }
);

How to trigger an event to test your Inngest integration?

Now, let’s confirm the setup works by triggering a test event. This will verify that your application can successfully communicate with Inngest and that your functions are executing properly.

  • Open your deployed app’s public URL.
  • Perform an action that triggers a user/created event (e.g., submit a signup form).
  • Go to the Inngest dashboard:
    • Navigate to your app.
    • Open Events and confirm user/created appears.
    • Check Functions and verify welcomeEmail was executed.

inngest_dashboard_link

inngest_app_list

If both the event and the function run successfully, the integration is complete.

How to troubleshoot common Inngest integration issues?

When setting up Inngest with DigitalOcean App Platform, you may encounter several common issues. Here’s how to resolve them:

Functions not showing in the dashboard?

  • Verify environment variables are set correctly
  • Ensure /api/inngest is deployed and accessible
  • Check that your app has been redeployed after adding environment variables

Events not triggering the functions?

  • Confirm the app is actually emitting user/created events
  • Double-check event names in your functions match exactly
  • Verify that your functions are properly exported and registered

Unauthorized errors

  • Rotate keys in the Inngest add-on and redeploy your application
  • Ensure the signing key matches between your app and Inngest configuration

FAQs

1. What is the difference between App Platform and Functions?

App Platform is a Platform-as-a-Service (PaaS) offering that allows developers to publish code directly to DigitalOcean servers without worrying about the underlying infrastructure. Functions are blocks of code that run on demand without the need to manage any infrastructure. Inngest works with both App Platform and Functions, but this tutorial focuses on App Platform integration.

2. Is DigitalOcean App Platform free?

DigitalOcean App Platform offers a free tier that’s ideal for trying out the platform, hosting personal websites, portfolios, or small projects. However, for production applications with Inngest integration, you’ll likely need a paid plan that includes access to SaaS Add-Ons and environment variables.

3. What is the use of Inngest?

Inngest is an event-driven durable workflow engine that enables you to run reliable code on any platform, including serverless. With any Inngest SDK, you write functions in your codebase and make them available to Inngest using an HTTP endpoint. It’s particularly useful for background job processing, workflow orchestration, and event-driven architecture.

You can refer to Inngest official documentation for more information on how to use Inngest.

4. How to use Inngest?

To use Inngest, you:

  1. Install the Inngest SDK in your application
  2. Create an Inngest client and configure it with your credentials
  3. Define functions that respond to specific events
  4. Set up an HTTP endpoint that Inngest can communicate with
  5. Emit events from your application to trigger the functions

5. What are the three types of workflows?

The three main types of Inngest workflows are:

  • Sequential workflows: Follow a strict, step-by-step path where each task must be completed before the next one begins
  • State machine workflows: Progress through different states based on events or decisions, allowing movement back and forth between steps
  • Rules-driven workflows: Triggered by specific conditions or business rules, with paths determined by logic like “if/then” statements

Inngest supports all three types of workflows, making it flexible for various use cases.

6. Can you run background jobs on DigitalOcean App Platform?

Yes, DigitalOcean App Platform supports background jobs through several methods:

  • Scheduled Jobs: Run tasks on a schedule using cron-like syntax
  • Worker Components: Run background services that don’t respond to HTTP requests
  • SaaS Add-Ons: Integrate with services like Inngest for more advanced background job processing

This tutorial focuses on using Inngest as a SaaS Add-On for sophisticated background job processing.

Conclusion

You’ve successfully deployed your app on DigitalOcean App Platform, added Inngest as a SaaS Add-On, configured secure environment variables, synced functions and created an /api/inngest endpoint, and triggered a test event to verify execution.

Your application can now handle background jobs without managing servers or queues. As your project grows, simply add new events and functions—Inngest will scale automatically.

Next Steps

Ready to explore more advanced background job processing and App Platform features? Check out these related tutorials:

For more background job processing solutions, explore our App Platform documentation or visit the DigitalOcean Community for additional tutorials and support.

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author(s)

zasghar
zasghar
Author
See author profile

Solution Architect

Anish Singh Walia
Anish Singh Walia
Editor
Sr Technical Writer
See author profile

I help Businesses scale with AI x SEO x (authentic) Content that revives traffic and keeps leads flowing | 3,000,000+ Average monthly readers on Medium | Sr Technical Writer @ DigitalOcean | Ex-Cloud Consultant @ AMEX | Ex-Site Reliability Engineer(DevOps)@Nutanix

Still looking for an answer?

Was this helpful?


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Creative CommonsThis work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
Join the Tech Talk
Success! Thank you! Please check your email for further details.

Please complete your information!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.