Warehouse execution (WES) · Supporting domain · EventStorming board

material-flow-control

Turns a warehouse transport request into a finished move of a container across the rack and the robots, and knows where every container physically is.

GitHub ↗ · Documentation ↗ · Architecture check · Briefings

events published
7
commands
15
policies
12
read models
8
hot spots
4

The story in 5 key events

The pivotal events: the few that matter most, in the order they happen.

  1. Pivotal eventTransportAccepted
  2. Pivotal eventContainerArrivedAtStation
  3. Pivotal eventTransportCompleted
  4. Pivotal eventTransportFailed
  5. Pivotal eventContainerSentToClarification

Listens to (2): contexts whose events this one reacts to

Tells (0): contexts that react to its events

none

The board, row by row

16 rows, in the order the business story happens: the main path first, then how this context reacts to the others, then the clock. Rows are small stories; read each one left to right.

  • Event
  • Command
  • Actor
  • Aggregate
  • Policy
  • Read model
  • External system
  • Hot spot
  • Opportunity
  1. Accept a transport request

    The warehouse execution system asks to move a container. From local knowledge only, the request is checked, a route over the rack and the robots is planned and an order is opened. The same request id always gets the same answer.

    ActorWarehouse execution system
    Read modelWhere each container is
    Read modelSubsystem capacity
    Read modelThe floor layout
    CommandRequestTransportPOST /transport-requests
    AggregateOrder
    EventTransportAccepted

    Source: application/usecases/requests.go · domain/transportorder/order.go · domain/routing/routing.go

  2. Refuse a request that cannot be done

    A request is refused at once, with a plain reason, when the container is unknown at its source or already moving, the destination cannot be reached, or a machine on the route is unavailable. The refusal is recorded and published.

    ActorWarehouse execution system
    Read modelWhere each container is
    Read modelSubsystem capacity
    CommandRequestTransportPOST /transport-requests
    AggregateRequest
    EventTransportRejected

    Source: application/usecases/requests.go · domain/transportrequest/request.go

  3. Send each step to the right machine

    The next step of an order is sent, in order, to the rack controller or the robot fleet. A refusal that can be retried, an error or a timeout is tried again until a deadline, then the step fails.

    TimeDispatcher
    PolicyWhenever a step is due, send it to the machine that owns it, in order
    CommandDispatchDuestarted by the clock
    AggregateOrder

    Source: application/usecases/dispatch.go · 0002-material-flow-layout-routing-and-the-command-outbox.md

  4. The rack stores a container

    The rack controller says the container is in the rack. The registry now knows it there, and the order's store step is done.

    Systemasrs-control
    EventContainerStored
    PolicyWhenever the rack stores a container, record where it is and finish the store step
    CommandOnContainerStoredstarted by the policy
    AggregateOrder
    Read model · kept up to dateWhere each container is

    Source: application/usecases/asrs_facts.go · domain/containertrack/track.go

  5. A retrieved container reaches its port

    The container waits at the rack's output port. A clean read moves the order on to the next step; a failed read or a wrong container puts the container on hold.

    Systemasrs-control
    EventContainerPresentedAtPort
    PolicyWhenever the rack presents a container at a port, read the scan and either go on or hold it
    CommandOnContainerPresentedstarted by the policy
    AggregateOrder
    EventContainerSentToClarification
    EventTransportFailed
    Read model · kept up to dateWhere each container is

    Source: application/usecases/asrs_facts.go · domain/containertrack/track.go

  6. The rack cannot run a job

    A container missing from its port, or one the rack finds elsewhere than its map said, goes on hold. A store refused for an equipment fault is planned once more through another input; any other failure ends the transport.

    Systemasrs-control
    EventStorageJobFailed
    PolicyWhenever a rack job fails, hold the container, re-plan a store once, or end the transport
    CommandOnStorageJobFailedstarted by the policy
    AggregateTrack
    EventContainerSentToClarification
    EventTransportFailed

    Source: application/usecases/asrs_facts.go · application/usecases/flow.go · domain/containertrack/track.go

  7. Remember each rack unit's state

    The state of each rack unit is kept for the read views. It does not move the capacity numbers; those come from the capacity fact.

    Systemasrs-control
    EventEquipmentStateChanged
    PolicyWhenever a rack unit changes state, keep the new state
    CommandOnEquipmentStateChangedstarted by the policy
    Read model · kept up to dateRack unit states

    Source: application/usecases/asrs_facts.go

  8. Keep the rack's capacity in view

    The rack's free units and open jobs are copied into this context's own capacity view. A new capacity is published when a published number moved, and a request for an unavailable machine is refused.

    Systemasrs-control
    EventAsrsCapacityChanged
    PolicyWhenever the rack's capacity changes, refresh its snapshot and publish it if a number moved
    CommandOnAsrsCapacityChangedstarted by the policy
    AggregateSnapshot
    EventSubsystemCapacityChanged
    Read model · kept up to dateSubsystem capacity

    Source: application/usecases/asrs_facts.go · domain/capacity/capacity.go

  9. A robot takes a leg

    The robot fleet says which robot carries the leg of an order. The order remembers it, and nothing is published.

    Systemamr-fleet-control
    EventLegAssigned
    PolicyWhenever the fleet gives a leg to a robot, note which robot has it
    CommandOnLegAssignedstarted by the policy
    AggregateOrder
    Read model · kept up to dateWhich robot has each leg

    Source: application/usecases/amr_facts.go · domain/transportorder/legs.go

  10. A robot picks up the container

    The container is now on the robot. A pickup from a rack output port is confirmed to the rack controller so the port frees up; a pickup from a station frees its slot and lets the next waiting order in.

    Systemamr-fleet-control
    EventContainerPickedUp
    PolicyWhenever a robot picks up a container, track it on the robot and free the place it left
    CommandOnContainerPickedUpstarted by the policy
    AggregateOrder
    Read model · kept up to dateWhere each container is
    Read model · kept up to dateStation queues

    Source: application/usecases/amr_facts.go · domain/stationqueue/queue.go

  11. A robot delivers the container

    The container is at the end of the leg. The next leg starts, or the transport is complete. At a pick station the arrival is announced first, with the container's place in the queue, then the completion.

    Systemamr-fleet-control
    EventLegCompleted
    PolicyWhenever a robot drops a container, start the next leg or complete the transport
    CommandOnLegCompletedstarted by the policy
    AggregateOrder
    EventContainerArrivedAtStation
    EventTransportCompleted
    Read model · kept up to dateWhere each container is

    Source: application/usecases/amr_facts.go · application/usecases/flow.go · domain/transportorder/order.go

  12. A robot cannot finish its leg

    Robot trouble such as a block, a fault or an offline robot is retried a few times. A failed pick or drop, or a container still on the robot, puts the container on hold; anything else ends the transport.

    PolicyWhenever a robot leg fails, retry it, hold the container, or end the transport
    CommandOnLegFailedstarted by the policy
    AggregateOrder
    EventTransportFailed
    EventContainerSentToClarification

    Source: application/usecases/amr_facts.go · application/usecases/flow.go

  13. Keep the fleet's capacity in view

    The fleet's robots and open legs are copied into this context's own capacity view and published when a published number moved. A fleet with no robot online makes new requests for it refuse.

    Systemamr-fleet-control
    EventFleetCapacityChanged
    PolicyWhenever the fleet's capacity changes, refresh its snapshot and publish it if a number moved
    CommandOnFleetCapacityChangedstarted by the policy
    AggregateSnapshot
    EventSubsystemCapacityChanged
    Read model · kept up to dateSubsystem capacity

    Source: application/usecases/amr_facts.go · domain/capacity/capacity.go

  14. Cancel a transport

    Between steps an order is cancelled at once; a step sent to a machine but not yet picked up asks that machine to stop. With the container on a robot or at a rack output port, the transport cannot be cancelled.

    ActorWarehouse execution system
    CommandCancelTransportPOST /transport-requests/{transportRequestId}/cancellation
    AggregateOrder
    EventTransportFailed

    Source: application/usecases/requests.go · domain/transportorder/order.go

  15. Give up on a stalled transport

    A step its machine accepted but that shows no progress for too long fails the transport as timed out, and the machine is asked to drop the step. A container left on a robot goes on hold.

    TimeStall check
    PolicyWhenever a step shows no progress for too long, fail the transport and ask the machine to drop it
    CommandTickstarted by the clock
    AggregateOrder
    EventTransportFailed
    EventContainerSentToClarification

    Source: application/usecases/tick.go · application/usecases/flow.go

  16. Let an agent look, not touch

    A read-only agent surface shows where a transport stands, where a container is, what waits at a station and how each machine is doing. Nothing can be moved from it.

    ActorOperations agent
    Read modelTransports
    Read modelContainer tracks
    Read modelStation queues
    Commandget_transportcalled as an MCP tool

    Source: adapters/inbound/mcp/tools.go · 0007-observability-and-the-read-only-agentic-surfaces.md

Hot spots and opportunities

Open questions and known gaps, each taken from a decision record or a document in the repository, never invented. Opportunities are improvements the documentation already names.

Opportunities

This board is a reconstruction from the code and documentation of material-flow-control at origin/develop, not a workshop output. Roles are the ones the documentation names. How the boards were made.