Run the progression
Clone the example repository (main).
With Java 21, run the parentless module:
1. Two sequential Steps
The request is the root value.Fetch produces a Diff; WriteReport needs both the request and that diff.
Its record input declares those dependencies directly.
ReportInput from legally visible typed values.
You do not write bindings, casts, context keys or explicit builder type arguments.
See the complete Sequential.java.
2. Reuse a nested workflow
The child receives aDiff and returns an Assessment.
The caller keeps its earlier Request; the child exposes its declared result.
assess instance used to define the child.
The definition reuses composition; constructor injection supplies the implementation.
See Nested.java.
3. Route exhaustively on an enum
Choose implements Step<Request, Route>.
The enum controls routing; each review still receives the request.
Both arms return a Report, so the workflow can terminate after the choice.
end() closes the choice; terminate(SUCCEEDED) declares execution completion.
See EnumDecision.java.
4. Route a native Verdict
Assess implements Step<Request, Verdict> and invokes a native Judge Jury.
This fixture chooses deterministic judgments through its request; production Steps would supply their actual evidence.
The branch receives the complete assessment, its selected conclusion and the original request.
FAIL is a valid negative assessment, and this workflow successfully returns a changes-requested report.
The fixture’s INCONCLUSIVE assessment retains both ERROR: Scanner unavailable and ABSTAIN: No evidence.
A thrown evaluation ends with ASSESSMENT_FAILED; an unusable Verdict ends with ASSESSMENT_INVALID.
Neither failure invents an INCONCLUSIVE assessment.
The accepted assessment, selected route and exact first executable branch input commit together.
See NativeVerdict.java.
5. Parallel assessments and a typed report
AssessQuality takes Diff; AssessBackport takes BackportInput assembled from the request and diff.
Their distinct output records declare distinct report roles.
Quality(false) is a value; an execution failure prevents the successful join.
Admitted work settles before failure is reported.
See ParallelAssessments.java.
6. Discover files and fan out at runtime
DiscoverFiles implements Step<ReviewRequest, List<FilePatch>>.
ReviewFile implements Step<FilePatch, FileReview>.
WriteReport receives the ordered review results and earlier request.
maxItems refuses oversized input before item effects; it never truncates.
The durable manifest fixes membership and order before item work starts.
Each occurrence has a distinct index identity, even when two values are equal.
maxInFlight limits admitted, unsettled item bodies; an item waiting for descendants keeps its occupancy.
Physical Step capacity is a separate runtime setting.
Completion order never changes the returned list order; empty input returns an empty list.
No successful join can omit a failed item’s result.
See FanOut.java.
Register objects and configure execution
The definition contains authored Steps and control flow. The registry names the supplied Step objects; runtime configuration chooses physical capacity and deployment compatibility.StepContext supplies run, invocation and attempt metadata.
The tutorial harness ExampleRunner.java asserts expected results without casting or choosing an execution path.
For store compatibility and unresolved-effect limits, read Durability.
Sequence.build() is available starting in 0.14.0 for a parent ending in an always-failing/cancelling child; see the API reference.