Skip to main content

material-flow-control

Built - IQVO/material-flow-control on develop, released v0.1.1

Classification Supporting. CloudEvents segment wes. Topics warehouse.material-flow-control.events and .analytics. Repository: IQVO/material-flow-control, merged 2026-11-22 (plan WCS-04, PR #2), released v0.1.0: transport orders through the AS/RS and AMR subsystems, container tracking, station sequencing and clarification. Since plan WCS-06 (PR #12, 2026-11-23) its transport legs reach the pick-face, forward and clarification handoff points PK1/FWD1/CLR1 on amr-fleet-control's 2026-11-22.1 map, verified live through Kong. Verified at develop cabc7c1 on 2026-12-02: released v0.1.1 (the tag carries cmd/api, cmd/mcp and cmd/a2a, and is the image the k3s cluster runs), applied to the cluster with mcp.enabled: true, a2a.enabled: true and agents.colocate: true (warehouse-infra helm-values/material-flow-control.yaml); on 2026-12-02 material-flow-control was 1/1 and material-flow-control-agents 1/1. Agent surfaces: a read-only MCP server (5 L1 tools) and a read-only A2A agent (5 L1 skills), see Agent surfaces.

Purpose​

Turn a WES transport request into a completed physical move of a container across the automated subsystems, and be the one source of truth for where each container physically is inside the automation. It is the material flow controller of the sources, the "specialized on-the-ground traffic controller" between the host and the subsystems (see the industry reference).

Business capabilities​

CapabilityWhat it does
Transport order managementAccepts or rejects a request, splits it into legs through handoff points (for example AS/RS port, then AMR, then station) and tracks it to exactly one outcome.
Container trackingKeeps each container's physical position: in the AS/RS, at an AS/RS port, on a robot, at a station, at a dock or at a clarification point.
Station sequencingOrders arrivals at each goods-to-person station by priority and due time, and holds the station buffer limit.
Clarification and exceptionsHandles unknown or mismatched containers, failed legs and retries; sends a container to a clarification point and raises an anomaly.
Subsystem capacityAggregates the state and capacity facts of amr-fleet-control and asrs-control into the capacity view the WES consumes.

Responsibilities (what it must guarantee)​

  1. A container has at most one active transport order.
  2. A leg starts only after the previous leg's handoff is confirmed by the subsystem that holds the container.
  3. A station queue never exceeds its configured buffer, and arrivals follow the requested priority, then the due time.
  4. A container at a clarification point is never dispatched until it is resolved.
  5. Every accepted request ends in exactly one of Completed or Failed, and a failure carries a reason code.
  6. A request is idempotent on its transportRequestId: a retried request returns the original outcome and creates no second order.

What it does not own​

ConcernOwner
What is in a container, and the stock ledgerinventory-storage
Which container moves, and when work is releasedfulfillment-execution, wes-work-planning
The destination of a moveThe WES request; the WCS chooses only the route
Robot paths, traffic, deadlocks and chargingamr-fleet-control
Rack positions and shuttle and lift schedulingasrs-control
The anomaly lifecycle once raisedexception-management

Ubiquitous language​

TermMeaning
TransportRequestThe WES's request to move one container: source, destination, purpose, priority, due. Identified by transportRequestId.
TransportOrderThis context's accepted plan for one request: a sequence of legs and one outcome. Not a customer order and not a VDA 5050 order.
LegOne move inside one subsystem, from one handoff point to the next.
HandoffPointA place where a container passes from one subsystem to another: an AS/RS port, an AMR pickup or drop node at a station or a dock.
ContainerTrackThe physical position of one container and its history inside the automation.
StationQueueThe ordered arrivals and the buffer limit of one goods-to-person station.
ClarificationPointWhere a container goes when it cannot be identified or does not match its order (SAP EWM's term).
PurposeWhy a container moves: PICK, PUTAWAY, REPLENISH, OUTBOUND or RETURN.
SubsystemOne equipment system under this context: the AMR fleet or the AS/RS.

Candidate aggregates​

AggregateInvariants it protects
TransportOrder2, 5, 6: legs in order, one outcome, idempotency
ContainerTrack1, 4: one active order per container, no dispatch while in clarification
StationQueue3: buffer limit and arrival order

To be confirmed in the Define and Code steps with the Aggregate Design Canvas.

Inbound communication​

FromMessageChannel
fulfillment-executionPOST /transport-requests; POST /transport-requests/{id}/cancellationREST, Idempotency-Key
amr-fleet-controlLegAssigned, LegCompleted, LegFailed, FleetCapacityChangedKafka
asrs-controlContainerStored, ContainerPresentedAtPort, StorageJobFailed, EquipmentStateChanged, AsrsCapacityChangedKafka

Outbound communication​

ToMessageChannel
amr-fleet-controlRequest a leg; cancel a legREST
asrs-controlRequest a store or a retrieve job; cancel a jobREST
fulfillment-executionTransportAccepted, TransportRejected, ContainerArrivedAtStation, TransportCompleted, TransportFailedKafka
wes-work-planningSubsystemCapacityChangedKafka
exception-managementContainerSentToClarificationKafka

Event types follow the Event Standard, for example com.warehouse.wes.material-flow-control.transport.ContainerArrivedAtStation with subject set to the transport order id.

Agent surfaces​

material-flow-control ships the fleet's two agent adapters over the same read use cases as REST, both read-only at authority L1: ADR 0007, docs/adr/0007-observability-and-the-read-only-agentic-surfaces.md (accepted). Five tools and five skills over a Reader that has no write method: they never dial Kafka, never call a subsystem and never start the relay or the dispatcher, and a fitness test enforces the imports. Requesting and cancelling a transport stay on the relationship-1 REST interface. The levels are those of the Agentic Standard v2.

MCP server​

cmd/mcp on port 8090: Streamable HTTP, stateless, at /mcp and /, with /healthz open. Five tools, each annotated readOnlyHint, idempotentHint, openWorldHint: false and declaring _meta["com.warehouse/authority"] = "L1"; the registry is pinned by internal/adapters/inbound/mcp/testdata/tool_registry.golden.json. One resource template, warehouse://material-flow-control/stations/{stationId}, and one prompt, review_transport.

|| Tool | Authority | What it reads | || --- | --- | --- | || get_container_track | L1 | Where a container physically is (IN_ASRS, AT_PORT, ON_ROBOT with the robot, AT_STATION, AT_HANDOFF, AT_CLARIFICATION, UNKNOWN), its active transport and its clarification reason. | || get_station | L1 | A goods-to-person station queue: buffer limit, the containers occupying it in position order and the containers waiting upstream in admission order (priority, then due time). | || get_transport | L1 | One transport request: status (IN_PROGRESS, CANCEL_REQUESTED, COMPLETED, FAILED, REJECTED), reason, the container's last confirmed location, and every leg with its subsystem, kind (RETRIEVE, MOVE, STORE), status, the subsystem's job or leg id and the robot. | || list_equipment_units | L1 | The last reported state of every shuttle-and-lift unit of one AS/RS (IDLE, EXECUTE, HELD), as asrs-control's EquipmentStateChanged reported it. | || list_subsystems | L1 | The capacity of the AMR fleet, the AS/RS and every station as SubsystemCapacityChanged publishes it (status, units total and available, open work, capacity per hour, queue depth). |

Errors carry the REST slugs (container-track-not-found, station-not-found, transport-request-not-found, transport-request-expired, asrs-not-found). These views are the one place the equipment ids appear: ADR 0007 keeps robot keys, storage job ids and leg ids off the relationship-1 REST interface and the published events, so an agent can explain why a transport waits (which leg, which robot) without being able to move anything.

A2A agent​

cmd/a2a on port 8093: JSON-RPC, the Agent Card at /.well-known/agent-card.json, no security scheme. A message-only agent (no task lifecycle); a problem carries the REST catalogue slug as code inside the message envelope. Five skills, each tagged authority:L1.

|| Skill id | Name | Authority | Arguments | What it reads | || --- | --- | --- | --- | --- | || transport_status | Transport status | L1 | transportRequestId | One transport request as get_transport reads it. | || container_position | Container position | L1 | containerId | Where a container physically is, as get_container_track reads it. | || station_queue | Station queue | L1 | stationId | A station queue as get_station reads it. | || subsystem_capacity | Subsystem capacity | L1 | none | The subsystem capacity view as list_subsystems reads it. | || equipment_units | AS/RS unit states | L1 | asrsId | The AS/RS unit states as list_equipment_units reads them. |

Routes and deployment​

REST goes through Kong at /api/material-flow-control (the chart's gatewayApi.path, prefix stripped; fulfillment-execution is the designed caller). MCP and A2A go through the Agent Router (Envoy Gateway agent-router in envoy-gateway-system; warehouse-infra ADR 0015 for MCP, 0014 for A2A): /api/mcp/material-flow-control is rewritten to /mcp on the material-flow-control-mcp Service (:8090), and /api/a2a/material-flow-control is rewritten to / on the material-flow-control-a2a Service (:8093); on the host the Agent Router is http://localhost:8010. The chart defaults mcp.enabled, a2a.enabled and agents.colocate to false; warehouse-infra helm-values/material-flow-control.yaml (read at d12d05f on 2026-12-02) switches all three on, so cmd/mcp and cmd/a2a run as the two containers of one material-flow-control-agents Deployment (warehouse-infra ADR 0012). Nothing authenticates; the in-cluster boundary is the access control.