Celery

Distributed task queue for running asynchronous jobs, scheduled work, and complex workflows across Python applications at scale.

Library
PyPI
v5.6.3
28,937 stars
BSD 3-Clause License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
92 /100 Excellent
Development Activity 100
Maintenance 84
Community 84
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
90 /100 Excellent
Architecture 90
Code Quality 88
Innovation 80
Learning Curve 100

Celery is the standard distributed task queue for Python. An application defines a Celery instance, decorates functions with @app.task, and Celery takes care of routing each call as a message to a broker (RabbitMQ, Redis, Amazon SQS, and others) where a pool of worker processes picks it up and executes it out-of-band from the request/response cycle. It requires no configuration files to get started, retries automatically on connection loss, and can scale from a single machine to a fleet of workers spread across datacenters.

Beyond simple fire-and-forget jobs, Celery’s canvas API (chain, group, chord, chunks) composes tasks into multi-step workflows — running steps in sequence, fanning work out in parallel, or collecting results from a group into a callback. Celery Beat adds cron-like periodic scheduling, and results can be stored in Redis, a database, or a cache backend for later retrieval. Because the wire protocol is broker-based rather than Python-specific, Celery interoperates with non-Python workers and integrates cleanly into Django, Flask, and FastAPI applications without needing a dedicated integration package.

What You Get

  • A Celery app object and @app.task decorator for turning any Python function into an asynchronously executable unit of work
  • Pluggable broker and result-backend support — RabbitMQ, Redis, Amazon SQS, SQLAlchemy, MongoDB, and more
  • A canvas API (chain, group, chord, chunks, map/starmap) for composing tasks into sequential, parallel, and callback-driven workflows
  • Celery Beat for cron-style periodic task scheduling without an external scheduler
  • Multiple concurrency pools — prefork (multiprocessing), threads, eventlet, and gevent — selectable per deployment
  • Automatic retry, rate limiting, task revocation, and result expiry built into the worker and task lifecycle
  • A CLI (celery worker, celery beat, celery inspect, celery control) for running, monitoring, and managing workers in production

Common Use Cases

  • Offloading slow operations (sending email, generating PDFs, processing uploads, calling third-party APIs) out of a web request so responses stay fast
  • Running scheduled/periodic jobs — nightly reports, cache warmups, cleanup tasks — via Celery Beat instead of cron
  • Building multi-step data pipelines with chain/chord, where each stage runs as an independent, retryable, horizontally scalable worker task
  • Fan-out/fan-in processing — splitting a large batch into a group of parallel subtasks and aggregating results in a chord callback
  • Decoupling microservices via a message broker so producers and consumers scale independently of each other

Under The Hood

Architecture

Celery is organized around a central Celery app instance (celery/app/base.py) that owns configuration, task registration (TaskRegistry), signal dispatch, and broker connection management; tasks defined with @app.task become Signature-based proxy objects (celery/canvas.py) that can be composed into chain, group, and chord workflows before being serialized and sent through an AMQP-style transport layer provided by the separate Kombu library. On the consumption side, celery/worker/ implements the actual process/thread pool (concurrency/prefork.py, eventlet.py, gevent.py, thread.py), a Bootstep-based startup sequence (bootsteps.py) that wires up connection, consumer, and pool components independently, and worker/request.py/worker/strategy.py handling per-message execution, retries, and revocation. This bootstep/component design lets brokers, pools, and result backends be swapped without touching task-authoring code — the core abstraction that would be most disruptive to change is the Signature object, since canvas composition, serialization, and the worker’s execution trace (app/trace.py) all depend on its shape.

Tech Stack

Celery is pure Python (3.9–3.13, plus PyPy3.9+) built on top of its own sibling libraries: Kombu for messaging/transport abstraction, Billiard for the enhanced multiprocessing pool, and Vine for promise-style callback chaining. The CLI is built on Click (click, click-didyoumean, click-repl, click-plugins), with python-dateutil for schedule parsing and tzlocal/tzdata for timezone handling. Broker and backend support is delivered through optional extras (celery[redis], celery[sqs], celery[sqlalchemy], celery[elasticsearch], and many more) rather than hard dependencies, keeping the core install lean while supporting a wide array of production backends including Redis, RabbitMQ, Amazon SQS, MongoDB, Cassandra, and several cloud object stores as result backends.

Code Quality

The project has a large, well-organized test suite split into t/unit (per-module unit tests mirroring the celery/ package layout), t/integration, and t/smoke (Docker-based end-to-end scenarios using pytest-docker-tools with automatic retries), all run through pytest and coordinated via tox.ini across unit/integration/smoke environments. CI (GitHub Actions) runs a dedicated linter workflow, CodeQL and Semgrep static analysis, and a matrix Python-package test workflow; pyproject.toml configures mypy (targeted at core modules with disallow_untyped_defs) and flake8/codespell. Error handling is deliberately explicit throughout the worker and app layers, with a dedicated celery.exceptions module and structured retry/revocation paths rather than broad exception swallowing.

What Makes It Unique

Celery’s canvas primitives (chain, group, chord, chunks, map/starmap) give it a workflow-composition capability that goes well beyond simple task dispatch — tasks can be wired into arbitrarily nested pipelines with fan-out/fan-in semantics and callback-driven completion, all serializable and inspectable before execution. Combined with a broker-agnostic protocol (the same task can, in principle, be consumed by non-Python workers implementing the protocol) and a pluggable concurrency-pool model that lets a single codebase run under prefork, eventlet, or gevent depending on the I/O profile of its tasks, Celery covers a broader workflow-orchestration surface than most background-job libraries in its category, which tend to focus on simple enqueue/dequeue semantics.

Used by 16 apps in this directory

Python
63%
GPL 3.0

Paperless-ngx

Bookmarks Archiving

46,451

Turn your paper pile into a searchable digital archive with OCR, AI classification, and automated workflows — all running on your own server.

View details
91
Repo Health
88
Technical
67
Dependency
Built with
Python 63%
TypeScript 28%
Updated 1 weeks ago
Python
55%
Other

PostHog

Ab Testing Experimentation · Analytics · Developer Tools

40,208

The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.

View details
92
Repo Health
80
Technical
65
Dependency
Built with
Python 55%
TypeScript 36%
Updated 1 weeks ago
Python
86%
Apache 2.0

PrivateGPT

AI Development

57,566

The open-source API layer that turns local LLMs into production private AI applications with full Claude API compatibility

View details
88
Repo Health
83
Technical
70
Dependency
Built with
Python 86%
Updated 2 weeks ago
Python
68%
Apache 2.0

SurfSense

AI Assistants · Search

16,342

The open-source, unlimited NotebookLM alternative with real-time collaboration, a desktop app, and no vendor lock-in.

View details
88
Repo Health
71
Technical
66
Dependency
Built with
Python 68%
TypeScript 29%
Updated 2 weeks ago
Python
94%
Apache 2.0

SWIRL

Data Engineering · Databases · Search

3,047

Federated AI search and RAG across 100+ enterprise sources—no data extraction, no vector database required.

View details
60
Repo Health
83
Technical
65
Dependency
Built with
Python 94%
Updated 3 weeks ago
Python
97%
MPL 2.0

Taiga Back

Developer Tools · Project Management

858

Self-hosted agile project management backend with Scrum, Kanban, issue tracking, and a full REST API — built on Django and PostgreSQL.

View details
76
Repo Health
74
Technical
64
Dependency
Built with
Python 97%
Updated 3 weeks ago
Python
92%
GPL 3.0

Weblate

Developer Tools

6,110

Continuous localization platform that commits translations directly into your version control system with full translator attribution.

View details
95
Repo Health
86
Technical
67
Dependency
Built with
Python 92%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers