Isaac
02/07/2025, 8:05 AMMarvin
02/07/2025, 8:05 AMCOMPLETED
, FAILED
, or CRASHED
) or non-terminal. Each state represents a specific point in the execution lifecycle, and transitions occur based on the success, failure, or other conditions encountered during execution.
For example, a task might transition from a PENDING
state to a RUNNING
state, and then to a COMPLETED
state if it finishes successfully. If an error occurs, it might transition to a FAILED
state instead.
You can manually interact with states in Prefect to conditionally respond to task or flow outcomes. More details can be found in the Prefect documentation on managing states.
Here's a snippet of the Prefect top-level API related to states:
- `State`: Represents the state of a task or flow run.
- `Transaction`: Manages lifecycle stages like BEGIN, STAGE, ROLLBACK, and COMMIT.
For more in-depth information, you might want to explore the Prefect documentation further or the API related to state management.