Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
aj-geddes avatar

Background Job Processing

  • 432 installs
  • 305 repo stars
  • Updated March 4, 2026
  • aj-geddes/useful-ai-prompts

background-job-processing is an agent skill that implements async workers, job queues, retries, idempotency keys, dead-letter handling, and schedulers for developers offloading emails, exports, and long-running backend t

About

background-job-processing is a useful-ai-prompts agent skill for building robust asynchronous job systems with distributed queues, worker pools, scheduling, and monitoring. The quick-start configures a Celery app with Redis broker and result backend, JSON serializers, 30-minute hard and 25-minute soft task time limits, and named task queues via kombu Exchange and Queue objects. Five reference guides cover Python Celery and Redis, Node.js Bull Queue, Ruby Sidekiq, job retry and error handling, and monitoring observability patterns. Best practices require task timeouts, exponential backoff retries, idempotent handlers, job priorities, dead-letter queues, and queue-depth monitoring while warning against unbounded retries and blocking operations inside workers. Developers reach for background-job-processing when moving email sends, report exports, dataset processing, or recurring cron work out of synchronous HTTP handlers into durable worker infrastructure.

  • Queue and worker architecture
  • Retry with exponential backoff
  • Idempotency and deduplication
  • Dead-letter queue handling
  • Scheduled and delayed jobs

Background Job Processing by the numbers

  • 432 all-time installs (skills.sh)
  • Ranked #1,018 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill background-job-processing

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs432
repo stars305
Last updatedMarch 4, 2026
Repositoryaj-geddes/useful-ai-prompts

How do you implement background job queues with retries?

Implement async workers, job queues, retries, idempotency keys, dead-letter handling, and schedulers for emails, exports, and long-running tasks.

Who is it for?

Backend developers adding durable async processing for emails, exports, reports, or batch jobs who need Celery, Bull, or Sidekiq patterns with retries and observability.

Skip if: Simple fire-and-forget setTimeout calls or serverless-only workflows without persistent queues, workers, or retry semantics.

When should I use this skill?

The user asks to queue background jobs, send emails asynchronously, schedule recurring tasks, or add retry and dead-letter handling for long-running backend work.

What you get

Configured task queue with workers, retry and dead-letter policies, idempotent job handlers, schedulers, and monitoring hooks for async workloads.

  • Configured queue broker and worker processes
  • Retry and dead-letter policy implementation
  • Monitoring hooks for queue depth and job failures

By the numbers

  • Bundles 5 reference implementation guides
  • Celery quick-start configures 30-minute hard and 25-minute soft task limits
  • Covers 3 queue stacks: Celery, Bull, and Sidekiq

Files

SKILL.mdMarkdownGitHub ↗

Background Job Processing

Table of Contents

Overview

Build robust background job processing systems with distributed task queues, worker pools, job scheduling, error handling, retry policies, and monitoring for efficient asynchronous task execution.

When to Use

  • Handling long-running operations asynchronously
  • Sending emails in background
  • Generating reports or exports
  • Processing large datasets
  • Scheduling recurring tasks
  • Distributing compute-intensive operations

Quick Start

Minimal working example:

# celery_app.py
from celery import Celery
from kombu import Exchange, Queue
import os

app = Celery('myapp')

# Configuration
app.conf.update(
    broker_url=os.getenv('REDIS_URL', 'redis://localhost:6379/0'),
    result_backend=os.getenv('REDIS_URL', 'redis://localhost:6379/0'),
    task_serializer='json',
    accept_content=['json'],
    result_serializer='json',
    timezone='UTC',
    enable_utc=True,
    task_track_started=True,
    task_time_limit=30 * 60,  # 30 minutes
    task_soft_time_limit=25 * 60,  # 25 minutes
    broker_connection_retry_on_startup=True,
)

# Queue configuration
default_exchange = Exchange('tasks', type='direct')
app.conf.task_queues = (
// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
Python with Celery and RedisPython with Celery and Redis
Node.js with Bull QueueNode.js with Bull Queue
Ruby with SidekiqRuby with Sidekiq
Job Retry and Error HandlingJob Retry and Error Handling
Monitoring and ObservabilityMonitoring and Observability

Best Practices

✅ DO

  • Use task timeouts to prevent hanging jobs
  • Implement retry logic with exponential backoff
  • Make tasks idempotent
  • Use job priorities for critical tasks
  • Monitor queue depths and job failures
  • Log job execution details
  • Clean up completed jobs
  • Set appropriate batch sizes for memory efficiency
  • Use dead-letter queues for failed jobs
  • Test jobs independently

❌ DON'T

  • Use synchronous operations in async tasks
  • Ignore job failures
  • Make tasks dependent on external state
  • Use unbounded retries
  • Store large objects in job data
  • Forget to handle timeouts
  • Run jobs without monitoring
  • Use blocking operations in queues
  • Forget to track job progress
  • Mix unrelated operations in one job

Related skills

How it compares

Use background-job-processing for self-hosted queue workers; choose serverless queue skills when the architecture is fully managed cloud functions without persistent worker processes.

FAQ

Which queue libraries does background-job-processing cover?

background-job-processing provides reference guides for Python Celery with Redis, Node.js Bull Queue, and Ruby Sidekiq, plus dedicated docs for retry/error handling and monitoring observability across those stacks.

What Celery timeouts does the skill recommend?

The background-job-processing Celery quick-start sets task_time_limit to 30 minutes and task_soft_time_limit to 25 minutes, with JSON serializers, UTC timezone, and broker_connection_retry_on_startup enabled.

What are key background job best practices in this skill?

background-job-processing requires idempotent tasks, exponential backoff retries, dead-letter queues for failures, task timeouts, queue-depth monitoring, and avoiding blocking operations or unbounded retries inside workers.

Backend & APIsbackendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.