step
Define a saga step with forward logic using explicit outcome control.
This method finalizes the previous step (if any) and starts configuring a new step. The forward action receives the saga context and has access to the shared state via StatefulStepScope.
The forward action must return a StepOutcome:
completes with result- Step completed successfullyfails with reason- Step failed, trigger compensationskip with reason- Skip remaining steps without compensation
Return
This builder for method chaining
Parameters
Step identifier wrapped in TypedValue (can be enum or string)
Maximum execution time for this step (null = no timeout)
Suspend function that executes the step's forward logic
Define a saga step with string name (convenience overload).
Define a saga step with an enum step identifier (convenience overload).
Equivalent to step(TypedValue.fromEnum(name), timeout, forward).