Skip to main content

Integration

NIP integrates with its neighbours only through Kafka (CloudEvents 1.0, structured mode, internal/adapters/kafka/cloudevents). It makes no synchronous REST or MCP call to any sibling context: the planning use cases receive their inputs from local read models or from the request body. It is itself called over REST (operators, the console remote) and MCP (warehouse-ops-agent).

Context map​

Source: internal/adapters/inbound/kafka/*.go, internal/adapters/outbound/kafka/*.go, internal/adapters/inbound/mcp/tools.go

Upstreams (NIP consumes)​

ContextTopicCloudEvents typePayload fields NIP readsEffectOn failure
facility-layoutwarehouse.facility.eventscom.warehouse.wms.facility-layout.site.SiteCapabilityChangedsite_code, transfer_origin_enabled, transfer_destination_enabled, capability_revision (+ CE time as as_of)Upsert site_capability; a strictly greater capability_revision winsMalformed or invalid payload: WARN, committed past. Database error: the same message is retried, the partition waits.
order-managementwarehouse.order-management.eventscom.warehouse.wes.order-management.siteskudemand.SiteSkuDemandChangedsource_order_id, line_no, site_id, sku, demanded_units, due_at, state (ACTIVE/REMOVED), assignment_versionUpsert site_sku_demand keyed by (source_order_id, line_no), only when the event's CloudEvents time is not older than the stored as_of (ADR 0014; an older redelivery is a no-op); REMOVED tombstones the lineSame as above.
warehouse-planningwarehouse.warehouse-planning.eventscom.warehouse.wes.warehouse-planning.capacityplan.CapacityPlanPublishedplan_id, site_id, location, path_id, window_start, window_end, assigned_demand, capacity_over_window, shortage, published_atUpsert published_capacity_plan; a newer published_at winsA legacy event without site_id is excluded, never inferred. Others as above.
inventory-storagewarehouse.inventory.eventscom.warehouse.wms.inventory-storage.reservation.TransferStockAllocatedtransfer_id, transfer_line_id, origin_site_id, reservation_id, sku, quantity, allocations[]{stock_unit_id, bin_id, quantity}, expires_atALLOCATING → ALLOCATED and the pick WorkDemandReleased, one transactionUnknown transfer or illegal state: WARN, skipped. A reply that does not match the transfer (line, origin, SKU, totals, missing reservation or expiry) is dead-lettered to warehouse.inventory.events.dlq and committed past (ADR 0013; see Troubleshooting).
inventory-storagewarehouse.inventory.eventscom.warehouse.wms.inventory-storage.reservation.TransferStockAllocationRejectedtransfer_id, transfer_line_id, reason (ORIGIN_SITE_UNKNOWN, INSUFFICIENT_USABLE, IDEMPOTENCY_CONFLICT)ALLOCATING → UNFULFILLABLEAn unknown reason is a contract break: WARN, skipped. A rejection for a different transfer_line_id is dead-lettered like any other refused reply (ADR 0013).
inventory-storagewarehouse.inventory.eventscom.warehouse.wms.inventory-storage.reservation.TransferStockAllocationReleasedtransfer_id, transfer_line_id, reservation_id, origin_site_id, sku, quantity, outcome (RELEASED, ALREADY_RESOLVED), reasonRELEASING → CANCELLED (ADR 0022); clears the reservation id, allocations and expiry (ADR 0023)Unknown transfer or illegal state: WARN, skipped. A fact that does not match the transfer (line, reservation, origin, SKU, quantity, outcome) is dead-lettered to warehouse.inventory.events.dlq (ADR 0013).
inventory-storagewarehouse.inventory.eventscom.warehouse.wms.inventory-storage.stock.TransferReceiptStagedtransfer_id, transfer_line_id, destination_site_id, sku, quantitiesIN_TRANSIT → ARRIVED (scan-driven receiving)Out-of-order or unknown: WARN, skipped.
inventory-storagewarehouse.inventory.eventscom.warehouse.wms.inventory-storage.stock.TransferStockStowedtransfer_id, transfer_line_id, destination_site_id, sku, received_quantity, stowed_quantity, allocations[]ARRIVED → RECEIVED with the stow allocationsMismatch: ErrFactRefused, WARN, skipped.
fulfillment-executionwarehouse.fulfillment.eventscom.warehouse.wes.fulfillment-execution.transfer.TransferPickedtransfer_ref, quantity (+ demand_id, work_unit_id, task_id, work_kind, site_id, sku)ALLOCATED → PICKED with the picked quantity (short picks recorded) and the dispatch WorkDemandReleasedUnknown transfer_ref: WARN, skipped. Dispatch leg not configured: the transition commits, the demand is withheld, WARN.
fulfillment-executionwarehouse.fulfillment.eventscom.warehouse.wes.fulfillment-execution.transfer.TransferDispatchedtransfer_refPICKED → IN_TRANSITAs above.
fulfillment-executionwarehouse.fulfillment.eventscom.warehouse.wes.fulfillment-execution.transfer.TransferArrivedtransfer_refIN_TRANSIT → ARRIVED (reserved kind; TransferReceiptStaged drives the same transition)A transfer already past IN_TRANSIT: skipped.
product-masterwarehouse.product-master.eventscom.warehouse.wms.product-master.product.ProductPackLevelDeclaredsku, level, gtin, units_per_pack, effective_from, versionUpsert the local pack_levels copy used to round case SKUs to whole cases (ADR 0017); a version not greater than the stored one is a no-opA payload that can never apply is dead-lettered to warehouse.product-master.events.dlq; non-CloudEvents and other types on the topic are skipped.
product-masterwarehouse.product-master.eventscom.warehouse.wms.product-master.product.ProductPackLevelRetiredsku, level, gtin, effective_to, versionEnd-dates that level in the local copy; a level never seen or a GTIN that is no longer the stored one is ignoredAs above.

Every consumer dispatches on the full type string and ignores other types on the topic; anything that is not a valid CloudEvents 1.0 message is skipped. The group ids are configuration (see Configuration); in the kind deployment warehouse-infra sets network-inventory-planning-site-capability, -site-sku-demand, -capacity-plan, -transfer-reply and -transfer-fact.

Downstreams (NIP publishes)​

All through the transactional outbox and the relay (see the Runbook).

ConsumerTopicCloudEvents typeKey / subjectPayloadContract owner
inventory-storage (its transfer allocation consumer)warehouse.network-inventory-planning.eventscom.warehouse.wes.network-inventory-planning.transfer.TransferAllocationRequestedtransfer_line_id (<transfer_id>:1)transfer_id, transfer_line_id, origin_site_id, sku, quantityinventory-storage's consumed contract
inventory-storage (its transfer allocation consumer)warehouse.network-inventory-planning.eventscom.warehouse.wes.network-inventory-planning.transfer.TransferAllocationReleaseRequestedtransfer_line_id (<transfer_id>:1)transfer_id, transfer_line_id, reservation_id, origin_site_id, sku, quantity, reasoninventory-storage's consumed contract (ADR 0022)
wes-work-planning (its inbound work-demand consumer)warehouse.network-inventory-planning.eventscom.warehouse.wes.network-inventory-planning.workdemand.WorkDemandReleaseddemand_id (<transfer_id>:pick or <transfer_id>:dispatch)demand_id, work_kind (TRANSFER_PICK, TRANSFER_DISPATCH), transfer_ref, path_id, site_id, cpt, sku, quantitywes-work-planning's consumed contract
no consumer found in the fleetwarehouse.network-inventory-planning.eventscom.warehouse.wes.network-inventory-planning.transfer.TransferPlanApprovedtransfer idtransfer_id, origin_site_id, destination_site_id, sku, quantity, policy_version, operator_reason, proposal_as_ofNIP
nip-projector (this repo)warehouse.network-inventory-planning.analytics...network-inventory-planning.saga.TransferStateAdvanced, ...saga.TransferStuckDetected, ...saga.RebalanceRunCompletedtransfer id / run idsee Domain eventsNIP

source is /warehouse/network-inventory-planning; dataschema is urn:warehouse:network-inventory-planning:<events|analytics>:<EventName>:v1. The work kind TRANSFER_ARRIVAL exists in the domain vocabulary but no arrival demand is ever released: the arrival leg is driven by inventory-storage's destination facts.

Synchronous callers​

CallerProtocolSurfaceFailure behaviour
Operators and the console remote nip_mfe (ADR 0010)REST through Kong :8000 under /api/network-inventory-planningthe routes in the API referenceRFC 7807 problems; fail-closed 503/422 instead of fabricated answers
warehouse-ops-agentMCP Streamable HTTP to the mcp Service (:8090)get_transfer, list_transfers, find_stuck_transfers, simulate_transfer_options (see MCP tools)isError tool results with a slug prefix
Dashboards / analystsREST to nip-reports (ClusterIP, not routed by Kong)/reports/*400 / 500 problems

Absent edges (on purpose)​

  • No call to inventory-storage for stock positions: proposals take positions in the request body, and the scheduled rebalance has no positions source yet.
  • No consumer of process-path-management: the pick and dispatch path ids are plain configuration (TRANSFER_PICK_PATH_ID, TRANSFER_DISPATCH_PATH_ID).
  • No outbound HTTP client of any kind, hence no circuit breaker or timeout configuration.