Work States
As your work goes through its lifetime, it goes through various States. Later in this document, we will talk about how to observe the changes. But first, you should learn about each of them:
- Work is in the
BLOCKEDStateif it has prerequisite work that hasn't finished yet. - Work that is eligible to run as soon as its
Constraintsand timing are met is considered to beENQUEUED. - When a worker is actively being executed, it is in the
RUNNINGState. - A worker that has returned
Result.success()is considered to beSUCCEEDED. This is a terminalState; onlyOneTimeWorkRequests may enter thisState. - Conversely, a worker that returned
Result.failure()is considered to beFAILED. This is also a terminalState; onlyOneTimeWorkRequests may enter thisState. All dependent work will also be marked asFAILEDand will not run. - When you explicitly cancel a
WorkRequestthat hasn't already terminated, it enters theCANCELLEDState. All dependent work will also be marked asCANCELLEDand will not run.

