Warehouse execution (WES) · Generic domain · EventStorming board

amr-fleet-control

Drives the robot fleet: gives each transport leg to the nearest free robot, keeps robots apart on a shared map, and publishes seven facts about what happened.

GitHub ↗ · Documentation ↗ · Architecture check · Briefings

events published
7
commands
11
policies
16
read models
9
hot spots
4

The story in 5 key events

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

  1. Pivotal eventLegAssigned
  2. Pivotal eventContainerPickedUp
  3. Pivotal eventLegCompleted
  4. Pivotal eventLegFailed
  5. Pivotal eventFleetCapacityChanged

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

none

Tells (1): contexts that react to its events

The board, row by row

13 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. Request a transport leg

    The material flow controller names a container and two handoff points. A leg to an unknown or unreachable point, for a container already moving, or while no robot is online, is refused at once; otherwise it waits for a robot.

    ActorMaterial flow control
    Read modelHandoff points on the map
    Read modelRobots online
    CommandRequestLegPOST /fleets/{fleetId}/legs
    AggregateMission

    Source: application/usecases/legs.go · domain/mission/mission.go

  2. Give a waiting leg to the nearest robot

    Whenever a leg is waiting and a robot is free, the nearest one by route length gets it, with its battery and key as tie-breakers. Its first stretch of road is reserved and the order goes out over the robot link.

    Event · earlierRobotStateChanged
    PolicyWhenever a leg waits and a robot is free, the nearest assignable robot takes the next leg in acceptance order
    Read modelRobots and their battery
    Read modelReserved nodes and edges
    CommandAssignLegstarted by the policy
    AggregateMission
    EventLegAssigned
    Systemmaterial-flow-control
    PolicyNotes which robot carries the leg

    Source: application/usecases/traffic.go · domain/dispatch/dispatch.go · domain/mission/transitions.go

  3. The robot picks up the container

    The robot reports that its pick action finished at the leg's start point. The leg is now carrying the container and the fact is published.

    System · outsideRobot (VDA 5050)
    EventState report
    PolicyWhenever a robot reports its pick action finished, the leg becomes picked up
    CommandHandleStatestarted by the policy
    AggregateMission
    EventContainerPickedUp
    Systemmaterial-flow-control
    PolicyMoves the container onto the robot; confirms the pickup at an AS/RS output port or frees a station slot

    Source: application/usecases/uplink.go · domain/mission/transitions.go

  4. The robot drops the container

    The robot reports that its drop action finished at the leg's end point. The leg is complete, the robot is free again and the fact is published.

    System · outsideRobot (VDA 5050)
    EventState report
    PolicyWhenever a robot reports its drop action finished, the leg is completed
    CommandHandleStatestarted by the policy
    AggregateMission
    EventLegCompleted
    Systemmaterial-flow-control
    PolicyRecords the container at its destination; starts the next leg or completes the transport

    Source: application/usecases/uplink.go · domain/mission/transitions.go

  5. A robot cannot finish its leg

    A robot rejects the order, fails to pick or drop, or reports a fatal fault. The leg ends with one plain reason, and says whether the container is still on the robot.

    System · outsideRobot (VDA 5050)
    EventState report
    PolicyWhenever a robot reports a failed action, a rejected order or a fatal error, the leg fails with that reason
    CommandHandleStatestarted by the policy
    AggregateMission
    EventLegFailed
    Systemmaterial-flow-control
    PolicyRetries the leg for robot trouble, or puts the container on hold and ends the transport

    Source: application/usecases/uplink.go · domain/mission/transitions.go

  6. Cancel a transport leg

    The material flow controller cancels a leg. One still waiting for a robot is cancelled at once; one already with a robot asks the robot to cancel its order, and the robot's answer ends the leg.

    ActorMaterial flow control
    CommandCancelLegPOST /fleets/{fleetId}/legs/{legId}/cancellation
    AggregateMission
    EventLegFailed
    Systemmaterial-flow-control
    PolicyMarks the transport cancelled once the leg ends

    Source: application/usecases/legs.go · domain/mission/transitions.go

  7. Give up on a silent or stuck robot

    A robot that stays silent, held or blocked too long loses its leg, and so does an order the robot never answers after its resends. Each ends with its own reason, so the controller can tell a retry from a real fault.

    TimeOne-second tick
    PolicyWhenever a robot is stopped or held too long, or an order stays unanswered, fail its leg
    CommandTickstarted by the clock
    AggregateMission
    EventLegFailed

    Source: application/usecases/tick.go · domain/mission/transitions.go

  8. Recover after a restart

    At boot, every open leg made on an older map version fails as retired, and every robot is asked for its state at once before the fleet carries on.

    TimeBoot recovery
    PolicyAt boot, fail legs of a retired map and ask every robot for its state
    CommandRecoverstarted by the clock
    AggregateMission
    EventLegFailed

    Source: application/usecases/tick.go · 0002-vda5050-v3-conformance-map-and-traffic-control.md

  9. A robot changes state

    Each robot's connection and state reports are folded into one view: online, stopped, held, charging. A change is published; nothing in the fleet reads it yet.

    System · outsideRobot (VDA 5050)
    EventConnection message
    PolicyWhenever a robot's state or connection changes, publish the change
    CommandHandleConnectionstarted by the policy
    AggregateRobot
    EventRobotStateChanged
    Read model · kept up to dateRobot registry

    Source: application/usecases/uplink.go · domain/robot/robot.go

  10. Two robots wait on each other

    When robots wait for nodes in a circle, the cycle is published once and the youngest leg is re-routed around the nodes others hold. A cycle that lasts too long fails that leg as blocked.

    TimeFleet scheduling pass
    PolicyWhenever robots wait on each other in a circle, report it once and re-route the youngest leg
    Read modelWho waits for which node
    CommandDetectDeadlocksstarted by the clock
    AggregateFleetMap
    EventDeadlockDetected

    Source: application/usecases/traffic.go · domain/fleetmap/deadlock.go

  11. Charge and park idle robots

    An idle robot below the charge threshold drives to the nearest free charger and charges up; an idle robot off a parking spot drives to the nearest free one. These trips publish nothing.

    Event · earlierRobotStateChanged
    PolicyWhenever an idle robot is low on battery or off a parking spot, send it to the nearest free charger or parking node
    CommandChargeAndParkstarted by the policy
    AggregateMission

    Source: application/usecases/traffic.go · 0002-vda5050-v3-conformance-map-and-traffic-control.md

  12. Publish what the fleet can do

    Every change of robots, queued legs or active legs renews the fleet's numbers. The new capacity is published only when a number actually moved.

    Event · earlierLegCompleted
    PolicyWhenever a count changes, publish the fleet's capacity
    CommandRefreshCapacitystarted by the policy
    AggregateSnapshot
    EventFleetCapacityChanged
    Systemmaterial-flow-control
    PolicyRefreshes its view of how much the fleet can take

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

  13. Let an agent look, not touch

    A read-only agent surface answers what the fleet looks like, which legs are open and where a robot is. It cannot request or cancel a leg; an agent that must move a container asks the material flow controller.

    ActorOperations agent
    Read modelFleet
    Read modelOpen legs
    Read modelRobots
    Commandget_fleetcalled as an MCP tool

    Source: adapters/inbound/mcp/server.go · 0006-read-only-mcp-and-a2a-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 amr-fleet-control at origin/develop, not a workshop output. Roles are the ones the documentation names. How the boards were made.