Software Architecture

Domain-Driven Design: Domain Discovery and EventStorming—how to discover and model the business before writing code.

Explore a purchase with EventStorming: identify events, commands, actors, rules, and exceptions. Learn to prepare a workshop, propose boundaries, and turn validated findings into verifiable scenarios and a brief TypeScript policy.

Updated on October 29, 2026

Content explored 0%
18px

The indicator keeps the furthest percentage explored; marking the article complete is your choice.

“Confirm order” means four different things

The team receives a story: “As a customer, I want to confirm my order so I can receive it.”

Development interprets this as simply saving the cart. Payments understands that payment must first be completed. The warehouse expects a stock reservation. Customer support knows some orders are canceled after payment because the product was unavailable.

The story describes an intention, but does not yet explain the process the software must support.

Domain Discovery is the work of understanding decisions, rules, events, and exceptions with the people who know the business. It does not end when requirements are written: it continues when cases contradict our assumptions.

In this article, we will explore a purchase from order to dispatch. We will use an EventStorming board to make questions visible before turning them into code.

Discovery is more than collecting features

A list may request creating orders, collecting payments, and dispatching. Discovery asks what each action means and what must be true to perform it.

For example:

  • When do we consider an order to exist?
  • Who can cancel it, and until when?
  • Does confirmed payment mean authorization or capture?
  • Does an availability query guarantee stock?
  • What happens if payment arrives after cancellation?
  • Who resolves an operation whose result we do not know?

We are not trying to replace requirements with endless conversations. We are seeking information that lets us write more precise requirements and models.

A requested interface may also be a premature solution. If someone requests “a button to force dispatch,” first investigate the situation they need to resolve before automating that permission.

EventStorming within discovery

EventStorming is a flexible collaborative workshop format for exploring complex domains. It lets participants with different knowledge construct and challenge a shared representation of the business. Official EventStorming website.

It is not synonymous with Domain Discovery. We can also learn through interviews, observation, documents, examples, and prototypes. The workshop is particularly useful for bringing perspectives together and detecting disagreements.

The official name is written EventStorming, although you will also find “Event Storming.” Here, we will keep both expressions recognizable and use EventStorming when describing the technique.

You do not need a broker, event repository, or new project to start. Board events do not automatically become software messages.

Choosing the right depth

Its creators' documentation distinguishes three main formats: Big Picture, Process Modelling, and Software Design. Process-Level and Design-Level are often used to refer to those depths. Avanscoperta: EventStorming formats.

Big Picture: broadly explore a line of business and its perspectives, looking for problems and opportunities.

Process-Level or Process Modelling: examine a specific process and its variants in greater detail.

Design-Level or Software Design: move closer to behaviors, decisions, and boundaries that will guide software design.

These are not three mandatory meetings or a staircase that must always be completed. Choose the scope according to the question you need to answer.

In our store, broad exploration might show that payment and preparation contain the most uncertainty. We will then examine that workflow more deeply and, finally, a small preparation rule.

Preparing a useful session

The following proposal is an instructional exercise for our fictional store, not a universal recipe or the result of a real workshop.

Define a question and scope

We can start with:

What must happen from the moment a buyer submits an order until the warehouse can dispatch it, and which situations prevent progress?

Clarify whether we are describing the current process or designing a future one. Mixing them produces apparent agreements: one person describes what happens today while another describes what they expect the new system to do.

If comparing both, keep them distinct.

Invite people who know different decisions

Include people from sales, payments, warehouse operations, and customer support, alongside development and product when appropriate.

A domain expert is not only someone with a formal title. It may be the person who knows why a return blocked a shipment or how to recognize a duplicate payment.

Do not assume one person knows the entire process. If someone who can answer an important question is missing, record that absence as outstanding work.

Prepare space and examples

Use a large physical or digital surface accessible to participants. Check that everyone can read, write, and navigate the representation.

Bring anonymized examples of normal and problematic operations. There is no need to load personal data or secrets into a shared board.

For a first focused session, reserve time to explore, walk through examples, and agree on next steps. Duration depends on scope; a calendar slot does not guarantee the domain will be understood.

A legend that does not rely only on colors

For this exercise, we will use text labels. Colors can accompany them, but the meaning must remain readable without distinguishing colors.

[EVENT]    Something relevant that happened.
[COMMAND]  An intention to change a situation.
[ACTOR]    Participating person or role.
[POLICY]   Rule connecting a situation to an action.
[READ]     Information needed to decide.
[QUESTION] Conflict, uncertainty, or outstanding question.
[EXTERNAL] System outside the explored scope.

Visual conventions vary by format. A common representation uses orange events, blue commands, and green read models; there is no need to introduce every category in the first minute.

The legend above is an educational adaptation. What matters is agreeing on it and preventing a label from presenting an assumption as fact.

Differences we need to recognize

OrderPlaced expresses a fact: the order was placed. PlaceOrder expresses an intention: place the order.

A command can be rejected or fail to complete. Do not draw its expected event as inevitable.

A policy such as “when payment is confirmed and the reservation is valid, allow preparation” expresses a business rule. It does not yet decide whether implementation will use synchronous code, human intervention, or an asynchronous mechanism.

A read model, such as “orders ready for preparation,” supplies information for a decision. It does not immediately determine a table, materialized view, or specific architecture.

Initial exploration: placing events

Invite participants to write relevant facts in the past tense without requiring everyone to share the same sequence from the start.

The following appear:

OrderPlaced       Order placed
StockReserved     Stock reserved
PaymentConfirmed  Payment confirmed
OrderPrepared     Order prepared
OrderShipped      Order shipped

If a card says “validation,” ask what actually happened. It might be “order rejected for incomplete address” or a technical step that need not appear at this scale.

Do not turn that question into an endless linguistic debate. Look for the decision or result the name represents and add an example.

Nor should you discard an event because it occurs outside software. Physically handing the package to the carrier may be essential to understanding dispatch.

Ordering without inventing a single process

For a normal purchase, the group proposes:

OrderPlaced
     |
StockReserved
     |
PaymentConfirmed
     |
OrderPrepared
     |
OrderShipped

This line is a hypothesis about the normal workflow. It does not claim reservation must always precede payment.

Someone from payments explains that some operations can be confirmed before the reservation is known. Instead of correcting this for convenience, we draw a variant and ask what conditions preparation needs.

The group proposes a rule to validate:

Prepare only when the order is not canceled, a corresponding payment confirmation exists, and the required reservation has been confirmed.

We have now discovered a more useful condition than a rigid visual order.

Card proximity does not demonstrate causality. One fact may ordinarily follow another without a mandatory dependency existing.

Adding intentions, actors, and decisions

We examine one section of the workflow more deeply:

[ACTOR] Buyer
   |
[COMMAND] PlaceOrder
   |
[EVENT] OrderPlaced
   |
[POLICY] Request stock reservation for the placed order
   |
[COMMAND] ReserveStock
   |
[EVENT] StockReserved

Elsewhere:

[READ] Confirmed payment + available reservation + order not canceled
   |
[ACTOR] Warehouse operator
   |
[COMMAND] PrepareOrder
   |
[EVENT] OrderPrepared

The operator needs reliable information to act. That raises questions: when does the read model update, what happens if the reservation expires, and who checks a cancellation arriving during preparation?

Adding arrows does not resolve them. Cases must be described and responsibility assigned.

Questions for discovering implicit knowledge

Instead of asking only “is this correct?”, try:

  • “Tell me about the last time this did not end well.”
  • “Which information do you check before allowing this action?”
  • “What can make you stop an order even when it looks ready?”
  • “Who has authority to resolve a discrepancy?”
  • “Does that status mean the same thing to payments and the warehouse?”
  • “How do you recognize that two references belong to the same operation?”

These are proposed questions for the exercise. Adapt them to the people and real process without suggesting the answer you want to hear.

Exploring exceptions before closing the board

We add uncertainty cards:

[QUESTION] Payment is confirmed, but there is no stock.
[QUESTION] The reservation expired before preparation.
[QUESTION] The order was canceled, then payment confirmation arrived.
[QUESTION] The operator lost connectivity while recording dispatch.

For each, identify what we know and what remains undecided.

In the first case, inventing “automatically refund the money” is not enough. The business may offer waiting, substitution, or review. We need owners, conditions, and an understandable customer outcome.

In the fourth, lost connectivity does not prove the record was not saved. The discovery question is how to know what happened and who can verify it, without yet designing every technical mechanism.

A session can end with open questions. The problem is removing them from the drawing to make the process look complete.

Facilitating without imposing an architecture

The facilitator helps perspectives emerge and be compared.

One possible approach for our session is to begin with brief individual contributions, group accounts, and ask another person to walk through a specific operation from beginning to end.

If one voice dominates, explicitly invite people doing the everyday work. If disagreement arises, record the versions and seek evidence; a vote does not determine how the business actually works.

Also distinguish:

  • Observations from real operations.
  • A policy confirmed by its owner.
  • A proposal for the future process.
  • A technical team's hypothesis.
  • A question needing investigation.

Not everything must be resolved in the workshop. A sorting-algorithm discussion can be set aside if the current question is who can authorize dispatch.

The facilitator does not use cards as an excuse to decide on the experts' behalf.

Discovering modeling candidates

With several scenarios reviewed, we can propose boundaries.

In Sales, “confirmation” can describe a commercial commitment. In Payments, it describes financial evidence. In the warehouse, “prepared” describes a physical situation.

Those changes in vocabulary, rules, and responsibility offer signals for investigating context candidates. Counting colors, departments, or card groups is not enough.

Aggregate candidates may also emerge when certain decisions need to protect a lifecycle together. For example, the team might study how to control order transitions.

That does not mean each command creates an aggregate or that the entire purchase process should fit into one. We validate candidates with examples and rules, not by automatically extracting them from the board.

The discovered contact points can later inform a Context Map. Organizational relationships and contracts still need specific discussion.

From a finding to a verifiable case

Let us take the preparation hypothesis and write scenarios:

Given an order that is not canceled
and payment and reservation evidence corresponding to the order,
when its preparation is assessed,
the result allows progress.

Given the same order without payment evidence,
when its preparation is assessed,
the result indicates payment is missing.

Given a canceled order,
even with payment and reservation,
the assessment does not allow progress.

These scenarios make explicit what we must confirm with the responsible people. They do not yet describe transport, persistence, or permissions.

We also need a counterexample: a valid payment for another order does not satisfy the condition. Adding it prevents “there is a payment” from replacing “this order is paid.”

A small translation into TypeScript

The following snippet illustrates an assessment derived from the workshop. The facts have already been obtained and validated through authorized sources. It does not query external contexts or execute dispatch.

In preparation-assessment.ts:

export interface PreparationFacts {
  readonly orderId: string;
  readonly cancelled: boolean;
  readonly confirmedPaymentOrderId: string | null;
  readonly reservedStockOrderId: string | null;
}

export type PreparationAssessment =
  | { readonly kind: "READY" }
  | {
      readonly kind: "BLOCKED";
      readonly reason:
        | "ORDER_CANCELLED"
        | "PAYMENT_NOT_CONFIRMED"
        | "STOCK_NOT_RESERVED";
    };

export function assessPreparation(
  facts: PreparationFacts,
): PreparationAssessment {
  if (facts.cancelled) {
    return { kind: "BLOCKED", reason: "ORDER_CANCELLED" };
  }

  if (facts.confirmedPaymentOrderId !== facts.orderId) {
    return { kind: "BLOCKED", reason: "PAYMENT_NOT_CONFIRMED" };
  }

  if (facts.reservedStockOrderId !== facts.orderId) {
    return { kind: "BLOCKED", reason: "STOCK_NOT_RESERVED" };
  }

  return { kind: "READY" };
}

The function is self-contained as an instructional policy. It includes neither external packages nor a complete order model.

Payment evidence assumes the correct amount and currency. Reservation evidence assumes verified products, quantities, and validity. We show only correspondence with the order to focus on the discovered rule.

READY is an assessment of supplied facts, not durable authorization to prepare at any time. Before applying the real operation, concurrent changes, permissions, and validity must be addressed. The board helps recognize those requirements; it does not implement them.

If different priorities between blocking reasons emerge, the order of checks must also be validated with the business.

Checking the hypothesis without mistaking it for a system test

A proposed test example uses built-in Node.js APIs and assumes compilation to ESM JavaScript. It has not been run as part of this article.

import test from "node:test";
import assert from "node:assert/strict";
import { assessPreparation } from "./preparation-assessment.js";

test("un pago de otro pedido no permite preparar", () => {
  assert.deepEqual(assessPreparation({
    orderId: "order-100",
    cancelled: false,
    confirmedPaymentOrderId: "order-999",
    reservedStockOrderId: "order-100",
  }), {
    kind: "BLOCKED",
    reason: "PAYMENT_NOT_CONFIRMED",
  });
});

test("una cancelación impide continuar aunque haya evidencia previa", () => {
  assert.deepEqual(assessPreparation({
    orderId: "order-100",
    cancelled: true,
    confirmedPaymentOrderId: "order-100",
    reservedStockOrderId: "order-100",
  }), {
    kind: "BLOCKED",
    reason: "ORDER_CANCELLED",
  });
});

These tests verify the decision with controlled inputs. They do not prove the payment exists or the reservation remains valid.

If facts come from other contexts, their integrations need consumer contracts and translations. Directly importing other contexts' entities or assuming shared transactions over HTTP does not solve that.

Deliverables that enable continued learning

Do not make the board photograph the only result. For this exploration, we need:

  • A process narrative with reviewed variants.
  • Important terms and differences in meaning.
  • Confirmed rules with examples.
  • Questions with owners and a next action.
  • Model and boundary candidates identified as hypotheses.
  • Verifiable cases guiding implementation and testing.

A finding could be recorded like this:

Observation: the operator checks payment and reservation before preparing.
Proposed rule: both pieces of evidence must correspond to the order.
Outstanding: how to detect a reservation expiring during preparation.
People to consult: warehouse operations and the inventory team.
Next step: review a real expiration case and agree on behavior.

Do not attribute agreements to people who did not participate or validate them.

Discovery can also provide strategic evidence: perhaps product selection errors, rather than dispatch, contain the greatest improvement value. That guides which capability to investigate first without repeating the entire subdomain classification.

Two scenarios that change what we discover

Education: enrolled does not mean enabled

A team wants to automate course access. A workshop reveals distinctions between enrollment request, accepted enrollment, and enabled access.

Students may need approval or to meet prerequisites. A “registered user” card does not represent those facts.

The lesson is to seek decisions and exceptions behind an apparently simple state instead of implementing a single boolean.

Reservations: the booking absent from the screen

An application displays available times, but staff also reserve spaces by phone. The real process includes work outside software.

Discovering that operation prevents building a system correct only for cases already visible.

If the process is small and an interview with its owner clarifies the rules, a large workshop may be unnecessary. The technique should serve the question, not become a ceremonial requirement.

Using AI to prepare and organize, not fabricate knowledge

Cursor, Codex, or Claude can help with questions and drafts, but do not inherently know how a particular organization works.

Before the session:

With this scope and the participating roles, prepare questions about decisions, exceptions, and references between operations. Do not invent the process or assume the order of payment and reservation. Separate open questions from hypotheses to test.

After the session:

Organize these anonymized notes into observed facts, confirmed rules, proposals, and questions. Preserve contradictions and available attribution. Do not fill in missing agreements. Suggest examples that would help validate each uncertainty.

When proposing a model:

From the validated scenarios, propose boundary candidates and a small TypeScript policy. Explain which finding justifies each decision and what remains to be checked. Do not turn every card into a message, aggregate, or microservice.

Recordings, transcripts, and operational data must be handled with the appropriate permissions. Sending sensitive information is unnecessary when requesting help structuring questions.

A coherent AI response can still be an invented story. Business owners validate its content.

Discovery exercise

Choose a process you know: buying a product, enrolling in an activity, or reserving a space.

Part 1: normal narrative

Write between six and ten events in the past tense. For each, record how you know it occurred and who can explain it.

Part 2: three different situations

Select one decision and propose:

  1. A normal operation that can continue.
  2. An operation that must stop.
  3. An operation whose result is still unknown.

Add the command, actor, and information they need. If working individually, explicitly mark what you must validate with others.

Part 3: hypothesis and checking

Propose a rule and a modeling candidate. Explain which example supports them and which could demonstrate they are wrong.

Do not begin by writing endpoints or choosing infrastructure.

Illustrative solution and review criteria

There is no single correct board for every process.

For this article's purchase, a reasonable result distinguishes confirmed payment, rejection, and no response; it does not turn uncertainty into failure.

Preparation requires evidence corresponding to the order and considers cancellations. If validity rules are missing, they remain questions with owners.

A context candidate is justified by differences in meaning and responsibility, not three nearby cards. An aggregate candidate is checked against decisions that must remain coherent.

Review should be able to answer: what do we know, what do we assume, who confirmed it, and which example changes our interpretation?

Understanding enough to take the next step

Domain Discovery does not require stopping all development until every exception is known. It requires making assumptions visible and reducing important uncertainty before consolidating it in code.

EventStorming facilitates that conversation when it brings perspectives together and allows the process to be challenged. The board is a learning tool, not an automatic architecture generator.

The next step is small and verifiable: validate a rule, walk through an exception, or test a model candidate. Discovery continues when those steps provide new information.

Loading conversation…

Keep learning