Skip to content

Enact logo

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.

Get started View on GitHub

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.

    Steps

  • Use cases in YAML


    Wire steps into a use case in a YAML file. Every use case becomes an injectable UseCase<I, O> bean.

    Use cases

  • Fails fast


    Missing steps, duplicate ids, and an edge whose types do not fit stop the application at startup, not in production.

    Validation

  • Retry and cache


    Add retry with backoff or caching to any step, per use case, without changing its code.

    Retry and cache

  • 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.

    HTTP trigger

  • Kotlin and Java


    Built on Spring Boot 4 and Java 25. The examples show both Kotlin and Java.

    Getting started

At a glance

src/main/resources/enact/orders.yaml
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)!
  1. The use case is registered as a Spring bean named createOrder.
  2. Optional. Without a trigger, the use case is only available through injection.
  3. Nothing is bound, so the step reads the one declared before it, or the use case's input when it is first.
  4. Settings apply to this use case only. The same step can be retried here and not elsewhere.
  5. $validateOrder reads another step's output, so saveOrder and priceOrder both branch off the same value.
  6. A step taking two inputs binds each of them by name. buildInvoice is 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