
Enact¶
Build Spring Boot applications around use cases. Write small steps as ordinary Spring beans, wire them into a graph in YAML, and let Enact check every edge at startup.
Alpha
0.0.1-alpha is an early preview. APIs and the YAML schema may change before 1.0.
-
Steps are beans
Annotate a method, or implement a function interface. No base classes, no framework lock-in.
-
Use cases in YAML
Wire steps into a use case in a YAML file. Every use case becomes an injectable
UseCase<I, O>bean. -
Fails fast
Missing steps, duplicate ids, and an edge whose types do not fit stop the application at startup, not in production.
-
Retry and cache
Add retry with backoff or caching to any step, per use case, without changing its code.
-
HTTP trigger
Expose a use case as a REST endpoint with a few lines of YAML. Path variables, query parameters, headers and the body bind to the input.
-
Kotlin and Java
Built on Spring Boot 4 and Java 25. The examples show both Kotlin and Java.
At a glance¶
use-cases:
createOrder: # (1)!
trigger:
rest: # (2)!
method: POST
path: /api/v1/orders
status: 201
steps:
- step: validateOrder # (3)!
- step: saveOrder
settings:
retry:
max-retries: 3 # (4)!
- step: priceOrder
in: $validateOrder # (5)!
- step: buildInvoice
in: { order: $saveOrder, price: $priceOrder } # (6)!
- The use case is registered as a Spring bean named
createOrder. - Optional. Without a trigger, the use case is only available through injection.
- Nothing is bound, so the step reads the one declared before it, or the use case's input when it is first.
- Settings apply to this use case only. The same step can be retried here and not elsewhere.
$validateOrderreads another step's output, sosaveOrderandpriceOrderboth branch off the same value.- A step taking two inputs binds each of them by name.
buildInvoiceis what the use case returns: nothing reads it.
At startup Enact:
- resolves every step name to a step bean,
- checks that every edge of the graph carries a type the step it feeds accepts, and fails fast if it doesn't,
- registers each use case as a Spring bean you can inject, and
- optionally exposes it as an HTTP endpoint.
Modules¶
| Artifact | Purpose |
|---|---|
io.github.enact-framework:enact-core |
Step and use case model, validation, execution |
io.github.enact-framework:enact-starter |
Spring Boot auto-configuration, YAML loading, use case injection |
io.github.enact-framework:enact-starter-web |
HTTP (REST) trigger for Spring MVC applications |
Requirements¶
- Java 25
- Spring Boot 4.0
- Kotlin 2.3 or Java