Lifecycle and statuses
A run has a status. A deployment has a status. Each one moves along a short path. Read the status to know what to do next.
A run
A run starts as PENDING. It ends as COMPLETED, FAILED or CANCELLED. These three are final. A final run never changes again.
Status
Final
Meaning
PENDING
no
The run waits for a place to start.
task:run returns it at once in this status.PROVISIONING
no
The platform boots a VM for the run.
RUNNING
no
Your code runs in the VM. A run that takes a VM that is already warm goes from PENDING to RUNNING at once.
RETRYING
no
The run failed for a short-lived reason. It waits, then goes back to PENDING. It still counts against your limits.
COMPLETED
yes
The run finished and reported a result.
FAILED
yes
The run failed. A run that failed too many times also ends here.
CANCELLED
yes
You stopped the run with
run:cancel, or you deleted its deployment or task. A stop is not a failure. If its VM was already created, that VM time still shows in usage.What moves a run
You do this
What happens
task:runA new run starts in PENDING.
task:run --waitThe CLI follows the run to its end. The exit code is 0 only when the run is COMPLETED. Ctrl+C stops the wait, not the run.
run:cancelA run that is not final becomes CANCELLED. A final run keeps its status. A graceful stop of a task that listens for it leaves the run RUNNING until the task ends or the grace time ends; if the task finishes first, the run is COMPLETED.
A short-lived failure
The run goes to RETRYING, then PENDING. After the last allowed try, it goes to FAILED.
A deployment
A deployment starts as BUILDING. The platform builds it once. You can start runs only when it is READY.
Status
Meaning
BUILDING
The platform builds the code.
task:deploy waits for this to end.READY
The build worked. You can run it.
FAILED
The build failed. The deployment keeps the reason.
ARCHIVED
You deleted the deployment and the platform freed its image. The row stays as history.
What moves a deployment
You do this
What happens
task:deployA new deployment starts in BUILDING. The same code gives the same deployment, so a repeat does not build twice.
deployment:deleteThe deployment is deleted with all its runs. A run that is not final becomes CANCELLED. Later, the platform frees the image and the status becomes ARCHIVED.