Integration
Process Path Management is upstream of everyone and downstream of no one. Its inputs are operator decisions made through its own REST API (and nothing else); its outputs are Kafka events, a read-only MCP surface and a report API. The DDD patterns for each edge are on the Context Map; this page is the engineering view: what travels on each edge and what happens when it fails.
At a glance
Source: cmd/pathmgmt/main.go, cmd/mcp/main.go,
internal/adapters/outbound/kafka/publisher.go,
internal/adapters/inbound/kafka/analytics_consumer.go, web/src/config.ts;
consumer evidence as listed on the Context Map.
Omits: the analytical database and the Nginx gateway serving the remote's
assets.
Inbound (who calls this service)
| Caller | Protocol | Contract | Failure behaviour |
|---|---|---|---|
Operator through warehouse-console and this repo's process_path_mfe remote (web/) | REST over Kong, base /api/process-path-management (web/src/config.ts; http://localhost:8087 in dev) | GET /process-paths, POST /process-paths (fresh Idempotency-Key per submit), PUT /process-paths/{pathId}, DELETE /process-paths/{pathId} — see the API Reference | Errors come back as RFC 7807 problem documents the remote shows to the operator. The remote has no CPT schedule screen: PUT /sites/{siteId}/cpt-schedule is called directly against the API. |
| warehouse-console context reports | REST to pathmgmt-reports | GET /reports/catalogue-growth, GET /reports/catalogue-growth/freshness, specified in apis/openapi-reports.yaml (ADR 0031, Runbook) | 400 invalid-report-query, 500 report-store-error. Independent of the OLTP database. |
| warehouse-ops-agent | MCP Streamable HTTP to cmd/mcp (/, /mcp) | Tools get_process_path, list_process_paths (and get_cpt_schedule, get_process_flow, list_process_flows, get_catalogue_growth_report, which no sibling calls) — MCP tools | The agent's client is constructed but assigned to _ in its cmd/agent/main.go; no use case calls it today. |
| Any sibling over Kafka | — | None. This service consumes no other context's topic. | — |
All inbound surfaces are unauthenticated
(ADR 0005); CORS on the REST API allows
the origins in CORS_ALLOWED_ORIGINS.
Outbound (what this service emits)
warehouse.process-path-management.events
The integration topic, a Published Language consumed by seven siblings (see the Consumers column).
Event type | Raised by | data | Consumers |
|---|---|---|---|
com.warehouse.wes.process-path-management.processpath.ProcessPathCreated | DefinePath | path_id, match_prefix, direct, required_capabilities, destination_location_role (omitted when unset), cycle_time_p95 (Go duration string), eligibility | fulfillment-execution, wes-work-planning, workforce-management, order-management, network-fulfillment |
com.warehouse.wes.process-path-management.processpath.ProcessPathUpdated | RevisePath, only when something changed | same full snapshot | same five |
com.warehouse.wes.process-path-management.processpath.ProcessPathDeactivated | DeactivatePath, only on the first deactivation | path_id only | same five |
com.warehouse.wes.process-path-management.cptschedule.CPTScheduleChanged | DefineCPTSchedule, only when the schedule changed | site_id, timezone, cutoffs[] (cpt_id, local_time, days_of_week, ship_method, eligible_path_ids) | order-management, network-fulfillment, dock-scheduling, outbound-shipping |
com.warehouse.wes.process-path-management.processflow.ProcessFlowDefined | DefineProcessFlow, on the first define | flow_id, name, stages[] (path_id, process_type, in order), status, version | warehouse-planning (ADR 0042) |
com.warehouse.wes.process-path-management.processflow.ProcessFlowRevised | DefineProcessFlow, only when the flow changed; and RepublishCatalogue per ACTIVE flow at every start | same full state | same |
com.warehouse.wes.process-path-management.processflow.ProcessFlowRetired | RetireProcessFlow, only on the first retirement | same full state, status RETIRED | same |
Envelope: CloudEvents 1.0, structured mode, source
/warehouse/process-path-management, subject and Kafka key = PathId
(or SiteId, or FlowId), dataschema
urn:warehouse:process-path-management:events:<EventName>:v1
(ADR 0016). Headers:
content-type: application/cloudevents+json; charset=UTF-8, plus
traceparent/tracestate when the write ran inside a trace. Full schemas:
apis/asyncapi.yaml and Domain events.
Every event is a full snapshot of the aggregate (except the
deactivation), so a consumer that replays the topic from offset 0 rebuilds
the whole catalogue. The three WES consumers do exactly that on boot. At
every start this service also re-enqueues the current catalogue on this
topic only (ProcessPathUpdated per ACTIVE path, CPTScheduleChanged per
site, ADR 0038), so a replay
does not depend on broker retention.
RELOCATE (ADR 0033) is published
like every other path, as a ProcessPathCreated keyed RELOCATE
(match_prefix relocate, direct, required_capabilities [relocate],
intake [SLOT_RELOCATION]), once make seed-catalogue applies
catalogue/paths.json. wes-work-planning releases slot-plan moves on it.
fulfillment-execution builds RELOCATE tasks that require relocate, and
workforce-management plans relocate headcount against it.
DISPATCH (ADR 0035) is published
the same way, as a ProcessPathCreated keyed DISPATCH (match_prefix
dispatch, direct, required_capabilities [dispatch], intake
[STOCK_TRANSFER]). network-inventory-planning releases the transfer
dispatch leg under a path id such as dispatch-transfer, which matches the
dispatch prefix. fulfillment-execution builds the task from the path, and
its task type is the path id, DISPATCH. It requires the capability
dispatch.
REPLENISH (ADR 0036) is published
the same way, as a ProcessPathCreated keyed REPLENISH (match_prefix
replenish, direct, required_capabilities [replenish], intake
[REPLENISHMENT]). wes-work-planning releases pick-face top-ups on it,
fulfillment-execution builds REPLENISH tasks that require replenish
(fulfillment-execution ADR 0050), and workforce-management plans replenish
headcount against it. REPLENISHMENT is the only demand source declared on
it, and no other path accepts that source.
Intake (ADR 0034).
ProcessPathCreated/ProcessPathUpdated carry intake, the demand sources
allowed to route work onto the path (CUSTOMER_ORDER, STOCK_TRANSFER,
SLOT_RELOCATION, INVENTORY_CONTROL, REPLENISHMENT); always present, [] when only an
explicit path id reaches the path. order-management's path selection
considers only paths whose intake contains CUSTOMER_ORDER (PICK in the
declared catalogue) and falls back to PICK when none does, so it never
picks PACK, REBIN, SLAM, RELOCATE, DISPATCH, REPLENISH or ADR 0008's families for an order line.
An event without intake comes from a producer older than ADR 0034.
Failure behaviour.
- Broker down. Writes keep succeeding: events are committed to
outbox_eventsin the same transaction as the aggregate. The relay retries every second and drains the backlog in order when the broker returns. Consumers see the change late, never lost. Watchprocess_path_management.outbox.lag_seconds./readyzanswers503 dependency-unavailablewhile no broker answers, so the api pods leave the Service until it is back; liveness (/healthz) is unaffected. - Duplicates. At-least-once: the same CloudEvents
idcan arrive twice. Consumers key their caches byPathId/SiteId, so a duplicate is an overwrite with the same data. - Ordering. Per aggregate only: the relay sends in outbox-id order and the
Hashbalancer keeps one key on one partition (ADR 0013). There is no ordering between different paths or between a path and a schedule.
warehouse.process-path-management.analytics
Same four events, same id, dataschema
urn:warehouse:process-path-management:analytics:<EventName>:v1. Consumed
only by this service's pathmgmt-projector (group
process-path-management-analytics); poison messages go to
warehouse.process-path-management.analytics.dlq. Not a sibling contract
(ADR 0007).
Deliberately absent edges
| Edge | Why absent | Enforced by |
|---|---|---|
| REST or MCP calls from this service to any sibling | A Generic catalogue must not put its availability on, or depend on, a sibling's hot path (ADR 0001) | TestNoSiblingContextOutboundCalls (internal/architecture/fitness_test.go) |
| Consuming any sibling topic | Same reason; the service is the source of its language | No inbound Kafka adapter other than the analytics consumer |
| Validating capability names against workforce-management | Capabilities are free strings declared by the operator | internal/domain/shared (Capability) |
Validating destinationLocationRole / siteId against facility-layout | Separate Ways: Drop, WorkCenter, Shipping and site ids are local copies kept in sync by convention | internal/domain/shared/shared.go |
| Validating eligibility product attributes against product-master | Free strings (hazmat, fragile, ...); product-master's topic is not consumed | internal/domain/shared/eligibility.go |
Because the inputs are local and declarative, a typo in a capability, role
or attribute is accepted here and only shows up as a mismatch in the
consumer. Review the catalogue with GET /process-paths?all=true.