Skip to content

Maestro is a simple but powerful durable workflow library.

License

Notifications You must be signed in to change notification settings

lucidity-labs/maestro

Repository files navigation

Maestro

Need something like Temporal but simpler?

Use Maestro

  • durably persists workflows and their activities (workflow steps)
  • automatically retries failed activities
  • requires only 2 Postgres tables
  • packaged as a library that can be included as a simple dependency via Gradle or Maven
  • no separate server deployment
  • simple, readable codebase
  • embedded UI

UI

Access the UI simply by navigating to port 8000 after starting your application. No separate deployment needed!

Screenshot 2024-08-06 at 22 18 11

Example app

Take a look at the example app for an example of how to create your first durable workflow!

Start the app with:

docker compose -f script/docker-compose.yml up --build --force-recreate

Then, try calling the app using requests.http.

View all of your workflows and workflow events at http://localhost:8000!

Use Maestro in Your Own Project

  1. include maestro-core as a dependency in your build.gradle.kts:

    implementation("io.github.lucidity-labs:maestro-core:0.1.2")

    or your pom.xml:

    <dependency>
        <groupId>io.github.lucidity-labs</groupId>
        <artifactId>maestro-core</artifactId>
        <version>0.1.2</version>
    </dependency>
  2. Execute maestro.sql against your Postgres database to create the necessary schema. If you instead want to start off with a ready-to-go local Dockerized Postgres instance, just execute:

    docker compose -f script/docker-compose.yml up --build --force-recreate postgres
  3. Write your durable workflow! It's super easy - take a look at the example app to see how.

Write Your First Workflow

  1. Create at least one activity interface, like PaymentActivity. Activities are like steps of your workflow.
  2. Implement your activity, like PaymentActivityImpl.
  3. Create a workflow interface, like OrderWorkflow. Include a method annotated with @WorkflowFunction in this interface.
  4. Implement your workflow, like OrderWorkflowImpl. You can call the activities you've created earlier by declaring them as fields and annotating the fields with @Activity.
  5. Register the workflow implementation and the activity implementations, like in Config.
  6. Call your workflow, like in Controller.

About

Maestro is a simple but powerful durable workflow library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages