Enum WorkflowInstanceState
Lifecycle states of a workflow instance (ARCHITECTURE.md ยง6).
public enum WorkflowInstanceState
Fields
Running = 0Activities are in flight, or ready to be dispatched.
Includes a saga that is unwinding: compensations are dispatched as ordinary activities, so an instance busy undoing its work is still Running. What distinguishes the two is
SagaState.Compensatingon the cursor, not this field.Suspended = 1Waiting on a signal bookmark or parked for operator action; no job exists.
Completed = 2Reached the end of its graph. Terminal.
Failed = 3Stopped on a failure, with whatever had already been done left in place. Terminal.
Reached three ways: there was nothing to undo, a step's failure policy said the earlier work should stand, or an operator abandoned a stalled unwind. The common thread is that partial work survives โ which is exactly what separates this from Compensated.
Compensated = 4A saga unwound completely: every step it had finished was compensated. Terminal.
Kept distinct from Failed because the two differ in the only way that matters to whoever reads the record later โ one leaves partial work behind and the other does not.
Cancelled = 5Cancelled before reaching an end of its own. Terminal.