Skip to content

Lesson 13 of 17 · How We Think About Code

Event Storming and Event Modeling: Planning Before You Code

Intermediate•
lesson•
September 11, 2026•
~10 min read

Planning the wrong thing

Technical planning is important. Understanding the business processes first, and planning the use cases of what needs to happen, is more important than that.

I've watched teams that had been together for a while skip that first part. A new feature kicks off with schema decisions, library choices, and folder layout. Then someone starts drawing boxes for services and queues. Eventually somebody timidly asks whether the team has actually agreed on what the feature is supposed to do, and the room goes quiet.

This is technical planning without business planning. It's the most popular kind of planning, and the one most likely to produce code that solves the wrong problem on time and under budget.

User stories aren't use case planning

There are user stories, sure. Backlogs are full of them. They don't represent the whole picture of the process. A user story is one sentence about one actor and one outcome. The process around it - the steps before and after, the alternatives, the edge cases, the rules that say "no, not this way" - lives in someone's head, or in a tab nobody opened, or in a meeting that didn't happen.

Building from user stories alone is like assembling furniture from the warning labels. You know some things you mustn't do. You don't know what you're making.

Take one from the hotel backlog: "As a guest, I want to cancel my reservation." One actor, one outcome. Put the same thing on an Event Storming board and the process shows up around it: which cancellation policy applies to this reservation, how much of the payment comes back, the refund going out through the payment provider, the room going back into availability, the guest getting a cancellation email. Five decisions the story never mentioned, and the developer who builds from the story alone guesses at all of them.

The result is the data-first pattern in disguise: code shaped around the data the team happened to remember, instead of shaped around the process the business actually runs. The team doesn't notice, because each user story was implemented faithfully. The product manager doesn't notice, because each story shipped. The customer notices, eventually, when the workflow doesn't fit how they actually work.

A few ways to plan use cases

There are many ways to plan business processes. Three I'd point at:

  • Event Storming. Big sticky-note workshop, all stakeholders in one room, mapping the events that happen in the product over time.

  • Event Modeling. A more structured cousin of Event Storming, focused on flows: command, event, view, repeat.

  • Domain Storytelling. Stefan Hofer and Henning Schwentner's method: domain experts tell a story of how work actually gets done, and it gets drawn as it's told, using a small pictographic language.

They work differently, and they share the same core: get the behavior of the business onto a wall, in the business's own words, before anyone argues about tables or classes. The first two organize that around events. The third organizes it around the story of who does what.

How I'd pick between them: Event Storming when you need the whole business in one room and nobody yet knows where the boundaries are. Event Modeling when the process is roughly known and you want a blueprint the team can build from slice by slice, screens included. Domain Storytelling when the domain experts describe their work as who hands what to whom, and asking them for events would put words in their mouths.

What an Event Storming board looks like

An Event Storming session produces a long horizontal wall covered in colored sticky notes. The notes follow a simple grammar:

  • Orange notes are events: things that have happened, named in the past tense. ReservationRequested, GuestCheckedIn, PaymentFailed, ReservationCancelled.

  • Blue notes are commands: things someone does to make events happen. Request Reservation, Check In Guest, Cancel Reservation.

  • Yellow notes are actors: people or systems that issue commands. Guest, Front Desk Agent, Nightly No-Show Job.

  • Pink notes are external systems: things outside your domain that participate. Payment Provider, Email Provider, Channel Manager (Booking.com and the like).

  • Purple notes are policies: rules that say "when this happens, that should happen". When ReservationConfirmed, send the confirmation email.

  • Green notes are read models / views: what people need to see. Reservation Summary, Availability Grid.

The notes go on the wall left-to-right in time order. You start with the events, because the events are the part the business already knows. The commands, actors, policies, and views get filled in around them as the conversation surfaces them.

After a session, you can look at the board and quickly understand how the system works, what its capabilities are, and you don't really have to guess what's happening by reading the code.

Part of the reservation wall, redrawn:

An Event Storming wall for a hotel reservation. Orange event notes run left to right: Reservation Requested, Payment Authorized, Reservation Confirmed, Confirmation Sent. Blue command notes sit before each event, a yellow Guest note and pink Payment Provider and Email Provider notes hang above, a purple policy note says when confirmed, send the confirmation email, green read model notes show Availability Grid and Reservation Summary, and a Payment Failed branch leads to Reservation Cancelled.

The actual board has hundreds of notes. The shape is the same: a left-to-right timeline of what happens, who triggers it, and what the system reacts with.

The same flow in Event Modeling and Domain Storytelling

Event Modeling lays the same reservation flow out as a blueprint. The screens run along the top, commands and events sit on a timeline in the middle, read models sit below, and each vertical slice reads top to bottom: a screen triggers a command, the command produces an event, and later events feed a read model that a screen shows. The third slice has no screen. A processor reads the payment result off a read model and issues the confirm command itself, which is Event Modeling's automation pattern.

An Event Modeling blueprint for the same reservation flow, in four vertical slices. Slice one: the reservation form triggers the blue Request Reservation command, which produces the orange Reservation Requested event. Slice two: the payment page triggers Authorize Payment, producing Payment Authorized. Slice three: Payment Authorized feeds a green Reservations to confirm read model, a processor gear reads it and issues Confirm Reservation, producing Reservation Confirmed. Slice four: Reservation Confirmed feeds a green Reservation Summary read model, which the confirmation page shows.

Domain Storytelling tells the flow as a story. Each numbered arrow is one sentence in the domain's own words ("the guest requests a reservation", "the front desk quotes a price"), and the icons between the actors are the things those sentences are about.

A Domain Storytelling diagram with a Guest on the left, a Front Desk Agent on the right and a Payment Provider system below. Five numbered arrows: the guest requests a reservation, the front desk quotes a price, the guest pays, the payment provider authorizes the payment, the front desk confirms the reservation with a confirmation sent to the guest.

Why this changes how the code gets built

It's not possible to know everything at the beginning. The board will be wrong in places. Some events will turn out to be more complicated than they looked. Some will turn out not to exist. The point is to give you an idea of what needs to be done and what needs to be covered when the software gets built with technical tools and code.

A few specific things you get:

  • Names that came from the business, not from you. When the board says ReservationConfirmed, the code says ReservationConfirmed. Naming by intent stops being a struggle.

  • A process you can read. Bugs, edge cases, and "wait, what happens if..." questions surface in the room instead of in code review or production.

  • Stakeholders aligned on the same artifact. Product, engineering, support, and the business owner are all looking at the same wall. Disagreements happen now, when they're cheap.

  • Less code written speculatively. You can see which parts of the process are complicated and which parts are trivial, before you've built any of them. The trivial parts get the trivial code. The complicated parts get the structure they need.

Modules fall out of the board

This type of planning can also help you figure out the modules (bounded contexts) of your monolithic application. That helps with the folder structure, if you prefer to structure by feature rather than by type.

A bounded context is a chunk of the system where one consistent language applies. Inside the Reservations context, a "room" is a unit a guest can reserve for a date range. Inside the Housekeeping context, a "room" is something to be cleaned, with a state like dirty, clean, or inspected. Both are valid. They live in their own places and don't try to share a definition that wouldn't fit either.

On an Event Storming board, the contexts almost name themselves. You'll see clusters of events that travel together: ReservationRequested, ReservationConfirmed, GuestCheckedIn, GuestCheckedOut, ReservationCancelled will sit near each other on the timeline. A different cluster might be about housekeeping: RoomMarkedDirty, RoomCleaned, RoomInspected. Another about payments. Another about guest profiles. Each cluster is a candidate module.

In the project, those clusters become folders:

TEXT
src/ Reservations/ RequestReservation/ ConfirmReservation/ CancelReservation/ CheckInGuest/ CheckOutGuest/ Housekeeping/ MarkRoomDirty/ MarkRoomClean/ InspectRoom/ Payments/ AuthorizePayment/ CapturePayment/ RefundPayment/ GuestProfile/ RegisterGuest/ UpdateContactInfo/

Each module owns its own events, commands, models, and read views. Cross-module communication happens through events, the way the reservation confirmation handler dispatched ReservationConfirmed through the DomainEvents port: the purple policy notes on the board become listeners in the module that reacts. Housekeeping learns that a room needs cleaning by listening for GuestCheckedOut, and Reservations never calls into it. The folder layout reflects the business.

This is the cure for the "splitting by type" trap. The third course in the series calls it vertical slices. It works well because it lines up with the cost-of-change curve: changes to "confirm a reservation" land in Reservations/ConfirmReservation/.

When the modules need to break apart

At some point, if the product grows to where teams need to split, working on multiple applications, you could move out each module from the monolithic application. The boundary is already there, and the events were already the thing crossing it, which is most of the hard part of any split. It isn't free: the module probably still shares a database with the rest of the monolith, some of its writes might sit in the same transaction as another module's, and somebody has to migrate the data and cut over without taking the product down. Those are real problems, and they take real engineering time. What they don't include is figuring out where the module's boundary actually is. That part's already done, from when the events were named.

Planning by use case and process keeps the option open, at no extra cost up front. Retrofitting boundaries onto a tightly coupled monolith later is real work, work you can skip if the boundaries were already there.

Don't chase complexity

Some teams take "plan the use cases" as permission to design every possible scenario before writing a line. That's a different failure mode, and it ends up in the same place as no planning: too much speculation, not enough contact with reality.

Plan the use cases you have on the board today. Build them. Discover what you got wrong. Update the board. Build the next ones. The board is a living artifact.

It's smaller and cheaper than waterfall or big-design-up-front: enough planning that you know what you're building, no more.

Once the planning is done

The technical decisions become smaller. Should this be a queue job or a sync handler? You can answer that, because you know what the process needs. Should this be one bounded context or two? You can answer that, because you saw the events cluster on the wall. Should this rule live on the model or in a service? Easier to answer, because you know what the rule actually says, in the language the business uses.

Take the first question, with the board from earlier in this lesson. ReservationConfirmed sits on the timeline, then the policy "when ReservationConfirmed, send the confirmation email", then ConfirmationSent. Confirming and emailing are two separate notes joined by a policy, and nothing after the email waits on it. So confirming runs synchronously, because the guest is waiting for the answer, and the email goes to a queued listener, because nobody is waiting for that. The wall answered a question that would otherwise be a meeting.

This is what people mean when they say good architecture follows from understanding the domain. It sounds vague until you've sat in a room and watched the questions get cheap once everyone agrees on what the system is supposed to do.

What this isn't

Not every feature needs an Event Storming workshop - small features, well-understood domains, and obvious flows don't. The point is to stop skipping the planning when the planning would have been cheap. It doesn't replace technical thinking either. You still make schema decisions, library choices, and folder layouts - you make them in service of the use cases you already understand.

The one thing to remember

Plan the business before you plan the code. Most of the bugs, redesigns, and "we built the wrong thing" stories I've seen in long-lived products come from teams that flipped the order: technical decisions first, business understanding later. The good versions of those teams flipped the order back, usually after some pain, and never went back.

Course Content