Skip to content

Add Order Fulfillment Workflow and Workflow Saga demo apps#444

Open
schananas wants to merge 5 commits intomainfrom
feat/workflow-demo-apps
Open

Add Order Fulfillment Workflow and Workflow Saga demo apps#444
schananas wants to merge 5 commits intomainfrom
feat/workflow-demo-apps

Conversation

@schananas
Copy link
Copy Markdown
Contributor

Summary

Two new demo modules showing how to model multi-step business processes with the Axon Workflow Engine:

  • order-fulfillment-workflow — order → reserve stock → payment → ship → notify. Includes a live tracking UI: Leaflet map with animated truck movement, status pills, stats panel and activity log, all driven by SSE pushed from the projection's @EventHandlers. One-click buttons trigger single orders, bursts, and failure scenarios (out-of-stock, payment-timeout).
  • workflow-saga — saga-style order process showing wait/compensate patterns with the workflow DSL.

Test plan

  • mvn verify in order-fulfillment-workflow/ (Testcontainers IT spins up Axon Server)
  • mvn verify in workflow-saga/
  • Manual: mvn spring-boot:run in order-fulfillment-workflow/, open http://localhost:9090/, click "Stress test ×25" and "Mixed burst" — markers should animate end-to-end on the map


<axon.version>5.1.0</axon.version>
<axoniq-framework.version>5.1.0</axoniq-framework.version>
<axon-workflow.version>1.0.0-SNAPSHOT</axon-workflow.version>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<axon-workflow.version>1.0.0-SNAPSHOT</axon-workflow.version>
<axon-workflow.version>0.1.0</axon-workflow.version>

Comment thread order-fulfillment-workflow/README.md Outdated
- Java 21+
- Maven 3.9+
- Docker (for Axon Server)
- The Axon Workflow Engine (`io.axoniq.framework.workflow:*:1.0.0-SNAPSHOT`) installed in the local Maven repository
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- The Axon Workflow Engine (`io.axoniq.framework.workflow:*:1.0.0-SNAPSHOT`) installed in the local Maven repository
- The Axoniq Workflow Engine (`io.axoniq.framework.workflow:*:1.0.0-SNAPSHOT`) installed in the local Maven repository

Comment thread workflow-saga/README.md Outdated
Comment thread workflow-saga/README.md
request payment + shipment in parallel, react to either of two payment outcomes, complete the
process — is expressed as plain imperative Java.

## What got simpler
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd word this section differently. It's fine to suggest things are better, but stating it like this is super on-the-nose and not in all cases entirely correct. It would come across as more honest if you also include what's better in a Saga compared to Workflows (from my pov, the massive single-method block is a massive no-no, for example).

Copy link
Copy Markdown
Collaborator

@smcvb smcvb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All seems fair to me, but I'd want @zambrovski to give his two cents as well before merging.

Furthermore, although it's great this is here, we have not yet updates the code-samples build with AF5 at all. So, it might be a bit early to have these modules already.

@EventHandler
public void on(OrderPlaced event) {
var payload = new HashMap<String, Object>();
payload.put("type", "PLACED");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ObjectMapper can do it much faster by transforming a bean to Map<String, Object>.

Copy link
Copy Markdown
Contributor

@zambrovski zambrovski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this has its own value to be presented here, independent of the visibility of examples we provide inside the module itself. This is a show case and it lives along side with other show cases.

Given the workflow-module is not public yet, I believe this one can be public before the access to the extension repository is changed to public.

So to me, if the proposed changes are applied, I see a value in publishing it here, in order to be able to show it to public already.

zambrovski and others added 2 commits May 5, 2026 17:33
Co-authored-by: Steven van Beelen <steven.vanbeelen@axoniq.io>
Co-authored-by: Steven van Beelen <steven.vanbeelen@axoniq.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants