# Background job

**Source:** https://promtable.com/glossary/background-job

> A background job is the unit of work in a [[task-queue]] system — a small piece of code that runs out-of-band from a request, may be retried on failure, and reports back via webhook / dashboard / database update.

---
A background job is the unit of work in a [[task-queue]] system — a small piece of code that runs out-of-band from a request, may be retried on failure, and reports back via webhook / dashboard / database update.

Background jobs are short-to-medium-running async tasks: send a welcome email, render a PDF, call an LLM, kick off a cron-scheduled report. They differ from full workflows ([[durable-execution]]) by being mostly single-step; workflows are multi-step + stateful. Best practices: keep jobs small (< 5 min ideal), make them idempotent (safe to retry), use structured logging, capture errors to observability (Sentry / Datadog), expose a queue-depth metric to alert on backups. Frameworks differ on what they optimize: Sidekiq + BullMQ are throughput-first; Trigger.dev + Inngest add durable + replay; cloud queues (SQS, Cloud Tasks) trade richer UX for scale and managed-ness.

## When to use

- Asynchronous post-request work.
- Scheduled cron-style jobs.

## Common mistakes

- Making jobs too big — long-running jobs survive workers crashes poorly.
- Not making jobs idempotent — retries duplicate side effects.

## Related terms

- [task-queue](https://promtable.com/glossary/task-queue)
- [durable-execution](https://promtable.com/glossary/durable-execution)

*Last updated: 2026-06-01*
---

Original page: https://promtable.com/glossary/background-job
Maintained by Promtable (https://promtable.com). Content: CC BY 4.0. Cite as "Promtable — https://promtable.com/glossary/background-job".
Contact: info@vibecodingturkey.com.