Skip to content

Workshop: a hotel booking, step by step

In this workshop you build one business process from scratch and grow it, module by module, the way a real one grows: a hotel booking with several rooms. A guest asks for three rooms; the hotel’s system needs one booking per room; one of them may be sold out — and then the guest decides —, the hotel’s API may be slow, a manager may have to approve, and the guest has a special request a language model should understand.

Every module is short, runs on your laptop, and ends with something you can see in the console and check in a test. The screenshots on these pages were taken from the workshop’s own project, running exactly as described.

  • Java 21 and Maven 3.9+
  • Git
  • A browser
  • About 2–3 hours for everything; each module stands on its own if you want to stop.

Nothing else: no Docker, no database, no broker, no API key. The project brings an in-memory database, a fake hotel API and a fake language model, so nothing leaves your machine.

The finished project is in the repository, in examples/workshop-hotel-booking. Each module explains the piece it adds; the project holds all of them side by side, one definition per module, so you can run any module at any time.

workshop-hotel-booking/
├── pom.xml # the engine, the forms engine, the console, the built-in workers, the test kit
├── src/main/java/com/example/hotel/
│ ├── HotelBookingApplication.java # the app: engine + console in one Spring Boot app
│ ├── workers/HotelTaskHandlers.java # the hotel's business logic (the ACTION steps)
│ └── fakes/ # a fake hotel API and a fake OpenAI-compatible model
├── src/main/resources/
│ ├── application.properties
│ └── workflows/ # one definition per module: 01-….ec.yaml to 06-….ec.yaml
├── src/test/java/… # the test-kit tests of Part 9
├── src/test/flows/ # test-only definitions
├── forms/booking-approval.ecform # the manager's approval form (module 6)
├── scripts/start.sh # starts a process over the REST API
├── scripts/approve.sh # decides an approval as a manager, through the forms API
└── ci/github-actions-workflows.yml # the CI pipeline of Part 9
#ModuleYou learn
0SetupBuild, run, open the console
1A first flowDefinitions, steps, workers, starting a process, the graph
2One booking per roomforEach, an inline body, labels, lanes in the console
3When things failRetries, timeouts; a sold-out room: the guest decides, and compensation undoes the booking only if they cancel
4Calling the hotelHTTP_CALL, connections, idempotency keys
5Calling an AILLM_CALL, structured output, the AGENT step
6A person in the loopUSER_TASK, escalation, CHOICE, completing a step
7OperatingSearch, retry from a step, batch operations, MCP
8Debugging a workflowErrors, the step history, Copy state, logs, reproducing in a test
9Testing, automatedThe test kit, time travel, simulated integrations, CI that runs it all on every change
10Changing without redeployingGit import, versions side by side, migrating safely

If you only have an hour: modules 0–3, then Part 9. That is the core: a process, its failure handling, and the tests that keep it right.