Back to Glossary

Background Job

A task that runs outside the normal request-response cycle, like sending emails, processing uploads, or syncing data.

Some operations are too slow to run during an API request. Sending an email might take 2 seconds. Processing an uploaded video might take minutes. Syncing data with a third-party API might fail and need retries. Background jobs handle these tasks asynchronously.

A background job system has three parts: a producer (your API endpoint that creates the job), a queue (where jobs wait), and a worker (a process that picks up jobs and executes them). Tools like Inngest, Trigger.dev, BullMQ, and QStash make this easy to set up.

For vibe coders, background jobs are essential for any feature that involves external services, heavy processing, or operations that can fail and need retries. AI can generate the job definitions and handlers, but the architecture decision of what to run synchronously vs. asynchronously is a human judgment call.

Related Courses

Links open the course details directly on the Courses page.