Skip to main content
Background jobs are parts of your app’s code that run on their own: on a schedule, such as every weekday at 8am, or when your app sends an event, such as when a new order is saved. You create them by asking the AI. The app editor lists them in a tab labelled Workflows.
Background jobs belong to an app and run its code. To have an AI coworker do something on a schedule, use scheduled tasks instead.

Create a background job

Ask the AI in the app chat. Say what should happen, when, and in which timezone.
Every weekday at 8am New York time, pull yesterday’s closed deals from HubSpot and save them to the deals table.
Once an hour, check the inventory table and post in #ops on Slack when a product drops below 10 units.
When someone submits a new expense, email a summary to finance@acme.com.
On the first day of every month, delete tasks that were completed more than 90 days ago.
The AI writes the job and connects it to your app. Then publish: a new or changed job only starts running on its own once you publish the app.

Two kinds of jobs

Schedules are in UTC. Tell the AI which timezone you mean, then check the time shown in the Workflows tab. If a job must run at the same local time all year, say so: a fixed UTC time moves by an hour against your local time when daylight saving time starts or ends.

The Workflows tab

Add the Workflows tab from the + menu in the editor’s tab bar. Some older apps don’t have this tab. The top of the tab counts your jobs, for example “3 deployed, 1 not deployed”. Each job has a card with:
  • its name and ID
  • status badges (see below)
  • Triggers: the schedule or the event that starts it
  • Concurrency and Rate Limit, when the job sets them
  • a Test Run button, except on jobs that will be removed on the next publish
If the app has no jobs yet, the tab reads “No workflows deployed yet”.

Status badges

Test a job

Click Test Run to run a job once, right away, without waiting for its schedule or event. It runs in your app’s preview environment. A notice confirms that the run started, or shows the error if it couldn’t start.
A test run does real work. It uses the same database as your live app, so any data it writes shows up in the live app, and it can send real messages through your integrations.
The tab doesn’t show what happened during a run. Check the data the job was meant to change, or ask the AI to look at the logs.

What the tab doesn’t have

  • No run history or step-by-step logs.
  • No way to see runs of the published app.
  • No switch to pause or disable a job.

Change, pause or remove a job

Ask the AI, then publish:
Change the inventory check to run every 4 hours instead of every hour.
Stop the daily HubSpot sync and remove that job.
Until you publish, the published app keeps running the old version. A job you removed shows Will be removed on next publish until then.

Tips

  • Use shared connections. A background job can only use integration accounts shared with the whole organization. Private accounts work only when a signed-in person is using the app, so a job can’t use them. See Integrations.
  • Event names must match exactly. If an event-driven job never runs, ask the AI to check that the app sends exactly the event name shown under Triggers.

For developers

Background jobs are Inngest functions. They live in src/inngest/functions. Each one must be exported from src/inngest/index.ts and listed in the serve route, src/app/api/inngest/route.ts. A function that isn’t exported from src/inngest/index.ts shows as Unregistered. A scheduled job looks like this:
An event-driven job uses { event: "expense/submitted" } as its trigger, and your app starts it with inngest.send({ name: "expense/submitted", data: { ... } }). You can read and edit these files in the Code tab. See Working with code.