Code of Conduct
Feature Description
Standardize scheduling and retry semantics as part of Django's Tasks framework API.
The current Tasks framework defines how tasks are declared and executed, but leaves scheduling (periodic/cron tasks) and retry behavior entirely to backend-specific implementations. I believe these concepts should be part of Django's public Tasks API, with task backends implementing a common contract.
Problem
One of the biggest strengths of Django's new Tasks framework is the ability to swap task backends without changing application code.
However, today each backend exposes its own API for recurring tasks and retry behavior. Existing backends already differ in how scheduled tasks are declared, how cron expressions are represented, and how retry policies are configured. As more backends emerge, this divergence is likely to increase.
This means applications quickly become coupled to a particular backend instead of Django's Tasks API. Switching from one backend to another often requires refactoring task definitions rather than simply changing configuration.
From my perspective, the Tasks framework should define what a task is, while task backends should decide how it is executed.
Scheduling and retry behavior are characteristics of a task's definition, not implementation details of a queue backend. Defining these semantics in Django would make task backends genuinely interchangeable, much like Django's cache, storage, email, and database backends.
This would also support a natural growth path for applications. A project could begin with a lightweight SQLite-backed backend, later migrate to PostgreSQL or MySQL, and eventually adopt a Redis- or RabbitMQ-backed implementation for higher throughput—all without changing application code.
This feels well aligned with Django's "batteries included" philosophy. The Tasks framework provides an excellent foundation, but defining these core semantics would make it a more complete, first-class abstraction while still allowing backend authors to innovate on execution.
For comparison, Ruby on Rails follows a similar model with Active Job. Applications target the framework-defined API while execution is delegated to interchangeable backends such as Solid Queue, Sidekiq, and others. Django Tasks feels like a similar abstraction, and I think scheduling and retry semantics belong at the framework level rather than in backend-specific extensions.
Request or proposal
request
Additional Details
I would be happy to participate in the discussion and help refine the API.
I don't yet have enough familiarity with Django's Tasks internals to commit to implementing the feature myself, but I would be interested in contributing if the proposal is accepted and the implementation approach is well defined.
This proposal is intentionally about standardizing the API rather than implementing scheduling in Django itself.
The goal is to define a common contract that task backends implement so applications can remain backend-agnostic.
Areas that could potentially be standardized include:
recurring or scheduled task definitions
schedule representations (for example cron expressions or other scheduling mechanisms)
retry configuration
retry policies (maximum retries, delays, exponential backoff, retry conditions)
common task metadata exposed to backends
The exact API is intentionally left open for discussion.
Implementation Suggestions
Rather than introducing new scheduling or retry infrastructure into Django itself, my suggestion would be to extend the existing Tasks API with optional metadata describing scheduling and retry behavior.
Backends that support these capabilities would implement the defined contract, while backends that do not could raise NotImplementedError or clearly document unsupported features, similar to how other Django backend abstractions handle optional functionality.
The implementation details—whether a backend uses a database, Redis, RabbitMQ, or another execution engine—would remain entirely the responsibility of the backend. Django would simply define the public API that applications target.
Code of Conduct
Feature Description
Standardize scheduling and retry semantics as part of Django's Tasks framework API.
The current Tasks framework defines how tasks are declared and executed, but leaves scheduling (periodic/cron tasks) and retry behavior entirely to backend-specific implementations. I believe these concepts should be part of Django's public Tasks API, with task backends implementing a common contract.
Problem
One of the biggest strengths of Django's new Tasks framework is the ability to swap task backends without changing application code.
However, today each backend exposes its own API for recurring tasks and retry behavior. Existing backends already differ in how scheduled tasks are declared, how cron expressions are represented, and how retry policies are configured. As more backends emerge, this divergence is likely to increase.
This means applications quickly become coupled to a particular backend instead of Django's Tasks API. Switching from one backend to another often requires refactoring task definitions rather than simply changing configuration.
From my perspective, the Tasks framework should define what a task is, while task backends should decide how it is executed.
Scheduling and retry behavior are characteristics of a task's definition, not implementation details of a queue backend. Defining these semantics in Django would make task backends genuinely interchangeable, much like Django's cache, storage, email, and database backends.
This would also support a natural growth path for applications. A project could begin with a lightweight SQLite-backed backend, later migrate to PostgreSQL or MySQL, and eventually adopt a Redis- or RabbitMQ-backed implementation for higher throughput—all without changing application code.
This feels well aligned with Django's "batteries included" philosophy. The Tasks framework provides an excellent foundation, but defining these core semantics would make it a more complete, first-class abstraction while still allowing backend authors to innovate on execution.
For comparison, Ruby on Rails follows a similar model with Active Job. Applications target the framework-defined API while execution is delegated to interchangeable backends such as Solid Queue, Sidekiq, and others. Django Tasks feels like a similar abstraction, and I think scheduling and retry semantics belong at the framework level rather than in backend-specific extensions.
Request or proposal
request
Additional Details
I would be happy to participate in the discussion and help refine the API.
I don't yet have enough familiarity with Django's Tasks internals to commit to implementing the feature myself, but I would be interested in contributing if the proposal is accepted and the implementation approach is well defined.
This proposal is intentionally about standardizing the API rather than implementing scheduling in Django itself.
The goal is to define a common contract that task backends implement so applications can remain backend-agnostic.
Areas that could potentially be standardized include:
recurring or scheduled task definitions
schedule representations (for example cron expressions or other scheduling mechanisms)
retry configuration
retry policies (maximum retries, delays, exponential backoff, retry conditions)
common task metadata exposed to backends
The exact API is intentionally left open for discussion.
Implementation Suggestions
Rather than introducing new scheduling or retry infrastructure into Django itself, my suggestion would be to extend the existing Tasks API with optional metadata describing scheduling and retry behavior.
Backends that support these capabilities would implement the defined contract, while backends that do not could raise NotImplementedError or clearly document unsupported features, similar to how other Django backend abstractions handle optional functionality.
The implementation details—whether a backend uses a database, Redis, RabbitMQ, or another execution engine—would remain entirely the responsibility of the backend. Django would simply define the public API that applications target.