States control the status of your workflow execution.
Overview
Execution is a single run of a flow in a specific state. Each state represents a particular point in the workflow in which Kestra's orchestration system determines what happens next based on the control flow logic defined in the flow.
You can read more about executions here.
Execution States
Each Kestra execution can transition through several states during its lifecycle. The following diagram illustrates the possible states an execution can be in:
Here is a brief description of each state:
- CREATED: The execution has been created but not yet started. This transient state indicates that the execution is waiting to be processed, and it should usually quickly transition to the
RUNNING
,CANCELLED
orQUEUED
state. If you see executions stuck in this state, it may indicate a problem with the system. - QUEUED: The execution is waiting for a free slot to start running. This transient state is only used when the flow has concurrency limits and all available slots are taken.
- RUNNING: The execution is currently in progress. This transient state continues until all task runs are completed.
- SUCCESS: The execution has completed successfully. This terminal state indicates that the execution has completed successfully and all tasks have finished without errors (or were allowed to fail).
- WARNING: This terminal state is used when the execution has completed successfully, but one or more tasks have emitted warnings.
- FAILED: This state indicates that one or more tasks have failed and will not be retried. If there is an
errors
branch defined in the flow, the errortasks
will be executed before permanently ending the execution, e.g. to send an alert about failure. Without any additional orchestration action, this state is usually considered as a terminal state. However, when the flow has a flow-level retry policy set to theRETRY_FAILED_TASK
behavior, the execution will transition to theRETRYING
state. - RETRYING: This transient state indicates that the execution is currently retrying one or more failed task runs. After all retry attempts are exhausted, the execution will transition to the terminal
SUCCESS
,WARNING
orFAILED
state. - RETRIED: This terminal state indicates that the execution has been retried according to the flow-level retry policy set to the
CREATE_NEW_EXECUTION
behavior. This means that the original execution (which failed and has been retried) is marked asRETRIED
, and a new execution is created to run the flow again. - PAUSED: This transient state indicates that the execution is awaiting manual approval or has been paused for a fixed duration before continuing the execution. Note that there is no
RESUMING
orRESUMED
states as the execution will transition directly from thePAUSED
to aRUNNING
state as soon as the paused execution is resumed. - RESTARTED: This transient state is equivalent to the
CREATED
state, but for a failed execution that has been restarted e.g. from the UI. Such execution will transition to theRUNNING
state as soon as the restarted execution is processed. - CANCELLED: This terminal state indicates that the execution has been automatically cancelled by the system, usually because the
concurrency
limit was reached and the concurrencybehavior
was set toCANCEL
in order to cancel all executions that exceed the concurrency limit. - KILLING: This transient state indicates that the user has issued a command to kill the execution, e.g. via a task or by clicking on the
Kill
button in the UI. The system is in the process of terminating (aka killing) the task runs associated with the execution which are still in progress. As soon as all task runs are terminated, the execution will transition to theKILLED
state. - KILLED: This terminal state indicates that the execution has been killed upon request by the user. No more tasks will be able to run, and the execution is considered terminated.
What is the difference between the CANCELLED
and KILLED
states?
- The
CANCELLED
state is used when the system automatically cancels an execution due to theconcurrency
limit being reached. - The
KILLING
state is used when the user manually kills an execution and the system is in the process of terminating the task runs associated with the execution. - The
KILLED
state is used when the execution has been killed upon request by the user.
How are task run states different from execution states?
Task run states represent the status of a single task run within an execution.
Each task runs can be set to one of the following states:
- CREATED: The task run has been created but not yet started.
- RUNNING: The task run is currently in progress.
- SUCCESS: The task run has completed successfully.
- WARNING: The task run has completed successfully but with warnings.
- FAILED: The task run has failed.
- RETRYING: The task run is currently being retried.
- RETRIED: The task run has been retried.
- KILLING: The task run is in the process of being killed.
- KILLED: The task run has been killed upon request by the user.
Note how there is no QUEUED
, CANCELLED
, PAUSED
or RESTARTED
states for task runs.
Was this page helpful?