This document describes the current stable version of Celery (5.3). For development docs, go here.
Built-in task states.
Set of states meaning the task result is ready (has been executed).
Set of states meaning the task result is not ready (hasn’t been executed).
Set of states meaning the task returned an exception.
Set of exception states that should propagate exceptions to the user.
Set of all possible states.
- celery.states.FAILURE = 'FAILURE'¶
- celery.states.PENDING = 'PENDING'¶
Task state is unknown (assumed pending since you know the id).
- celery.states.RECEIVED = 'RECEIVED'¶
Task was received by a worker (only used in events).
- celery.states.RETRY = 'RETRY'¶
Task is waiting for retry.
- celery.states.REVOKED = 'REVOKED'¶
Task was revoked.
- celery.states.SUCCESS = 'SUCCESS'¶
- celery.states.precedence(state: str) int ¶
Get the precedence index for state.
Lower index means higher precedence.
- class celery.states.state¶
State is a subclass of
str, implementing comparison methods adhering to state precedence rules:
>>> from celery.states import state, PENDING, SUCCESS >>> state(PENDING) < state(SUCCESS) True
>>> state('PROGRESS') > state(STARTED) True >>> state('PROGRESS') > state('SUCCESS') False