Workflow Lifecycle
The lifecycle of a workflow consists of a set of states in which a workflow can be, as well as the transitions between the states.
Lifecycle diagram
The following diagram shows the lifecycle of a workflow, including the states and transitions between them. Note the following conventions:
- States are represented by rectangles. A description of the state is provided in the states section (below).
- Transitions are of the form
state1 --> state2 : [_actor/component_, EventType | _attribute/result_]
.
stateDiagram-v2
classDef goodState stroke:green
classDef warningState stroke:orange
classDef badState stroke:red
[*] --> NEW : [Start]
NEW --> VALID : [Validate | _valid_]
NEW --> FAILED_SAFE : [Validate | _invalid_]
VALID --> READY : [Conditions | _true_]
VALID --> BLOCKED_WAITING: [Conditions | _false_]
BLOCKED_WAITING --> READY : [Conditions | _true_]
READY --> RESOURCE_DISCOVERY : [Discover]
RESOURCE_DISCOVERY --> RESOURCES_DISCOVERED: [Discovered | _resources_]
RESOURCES_DISCOVERED --> SCHEDULED : [Lock]
RESOURCE_DISCOVERY --> FAILED_SAFE: [Discovered | _error_]
SCHEDULED --> LOCKING : [Lock]
LOCKING --> LOCKED : [Run]
LOCKING --> SCHEDULED : [Unlock | _error_]
LOCKED --> RUNNING : [Run]
RUNNING --> ERROR: [error | _error_]
RUNNING --> ERROR: [timeout | _error_]
ERROR --> ROLLBACK: [canRollback | yes]
ROLLBACK --> FAILED_SAFE: [success | yes]
ROLLBACK --> FAILED_UNSAFE: [success | no]
ERROR --> FAILED_UNSAFE: [canRollback | no]
RUNNING --> COMPLETED: [success | _success_]
FAILED_UNSAFE --> FAILED_SAFE : [Rollback | _success_]
FAILED_SAFE --> FAILED_SAFE_ACK
FAILED_UNSAFE --> FAILED_UNSAFE_ACK
COMPLETED --> COMPLETED_ACK
FAILED_SAFE_ACK --> [*]
FAILED_UNSAFE_ACK --> [*]
COMPLETED_ACK --> [*]
class NEW goodState
class READY goodState
class VALID goodState
class LOCKING goodState
class LOCKED goodState
class BLOCKED_WAITING goodState
class RESOURCE_DISCOVERY goodState
class RESOURCES_DISCOVERED goodState
class SCHEDULED goodState
class RUNNING goodState
class COMPLETED goodState
class COMPLETED_ACK goodState
class FAILED_SAFE warningState
class ERROR warningState
class ROLLBACK warningState
class FAILED_UNSAFE badState
class FAILED_UNSAFE_ACK badState
class FAILED_SAFE_ACK warningState
States
NEW
Actions
Actions are the operations that alter the state of a workflow, eventually leading to a terminal state (COMPLETED or FAILED).