Node Topology
node-topology is the Supporting bounded context of the retail network (area Network, CloudEvents tier logistics) that owns the network's shape. It is the authoritative registry of the buildings the network runs through (fulfilment centres, inbound cross-docks, returns centres, sortation centres, delivery stations and air hubs), what each building declares it can do (a versioned, immutable operational profile), the directed lanes between active nodes, the regions that partition the network, and which delivery station serves which postal prefix.
It sits at the root of the network's dependency graph. A delivery promise is a claim about a path: this node can have the package ready by this cutoff, a departure leaves on this lane, this station serves this prefix. If two contexts held two copies of "which station serves 01310", the network would promise from one and route from the other. Node Topology is the single owner of those facts, publishes every change as a CloudEvent on retailnetwork.node-topology.events through a transactional outbox, and the neighbours keep their own read models of it. It consumes no Kafka topic and calls no sibling context (ADR 0001, ADR 0003).
:::info What runs on develop
Three binaries are built from one module and one image: cmd/api (REST, migrations, the outbox relay), cmd/mcp (a read-only MCP server, ADR 0008) and cmd/a2a (a read-only A2A agent, ADR 0011). A web console remote lives in web/ (ADR 0009). It runs on real Postgres and, for the api, real Kafka only: there is no in-memory runtime. REST, MCP and A2A are unauthenticated; reachability is the cluster and gateway boundary. Packaging is the Helm chart charts/node-topology; see Before the first release for what is still open.
:::
What the context owns
| Aggregate | Where it lives | Rule in one line |
|---|---|---|
| Node | internal/domain/node | One physical building, of one of six types, run by the NETWORK or a VENDOR. Lifecycle PROPOSED to ACTIVE, SUSPENDED, RETIRED (terminal). Capabilities derive from the type, never from the caller. |
| OperationalProfile (inside Node) | internal/domain/node | Append-only revisions: operating hours by weekday, holidays, handling time, cutoffs, throughput cap, sort dwell (sortation centres and air hubs only), optional inbound limits. A new declaration never edits an old revision. |
| Lane | internal/domain/lane | A directed, mode-specific (GROUND or AIR) connection between two different ACTIVE nodes along an allowed type pair; OPEN to CLOSED, no reopen. |
| ServiceArea | internal/domain/servicearea | Which ACTIVE delivery station serves a postal prefix, versioned by assignmentVersion; no unassign. |
| Region | internal/domain/region | A partition of the network with a unique code; defined once, never renamed or removed. |
What it does not own
| Not here | Owner |
|---|---|
| Scheduled departures on a lane, their capacity and loads (a lane holds only the nominal transit time) | linehaul-transportation |
| Waves and routes inside a station's service area | last-mile-delivery |
| Measured performance and grades of a node (this context holds the declared half of a node's capability only) | node-performance |
| What a node can sell, and how much | offer-availability |
| Vendor accounts, ack windows and the Vendor API | vendor-connectivity |
| Which node should hold which item before demand arrives | nobody yet (gap G49 in the network model) |
| Suspending a node because it performs badly | nobody automatically: a planner decides |
Classification and tier
- Supporting subdomain, evolution custom-built, business model enabler: every decision depends on the registry, but nobody chooses a network for how it stores its node list. The parcel-node rule and the versioned profile are specific to this network, so it is not Generic (Subdomain classification).
- Area Network, CloudEvents tier
logistics: types look likecom.retailnetwork.logistics.node-topology.<entity>.<EventName>.
Main capabilities
- Register nodes (
POST /nodes), vendor nodes throughvendor-connectivityand parcel nodes by a network-ops planner, with the operator, subtype and region rules enforced. - Declare operational profile revisions (
PUT /nodes/{nodeId}/operational-profile), and move nodes through activate, suspend and retire. - Open and close lanes, declare the cost of a lane, define regions and assign postal prefixes to delivery stations under a strictly increasing
assignmentVersion. - Answer the reads of the network:
GET /nodes,GET /nodes/{nodeId},GET /lanes,GET /service-areas/{postalPrefix},GET /regions, over REST, MCP tools and two A2A skills. - Publish the ten events of the four aggregates, at least once and in order per aggregate, through the transactional outbox.
- Make every write retry-safe with the
Idempotency-Keyheader (24 h).
Ten commands change state (Use cases); everything else is a read.
Where to go next
| You want to | Read |
|---|---|
| See the layers, binaries, ports and the rules that police them | Architecture, Runtime |
| Run it and make the first calls | Quickstart |
| Know every setting | Configuration |
| Deploy and operate it | Runbook, Observability, Before the first release |
| Fix something that broke | Troubleshooting |
| Know what tests and CI gates exist | Testing |
| See who talks to whom | Integration |
| See the use cases and their invariants | Use cases |
| Read the design as ddd-crew artifacts | DDD artifacts, Ubiquitous language |
| Read the contracts | API overview, Event catalogue, MCP tools |
| Read the decisions | ADR index |
Published at https://iqvo.github.io/node-topology/.
This project is a domain-driven design study. It is not associated with, endorsed by or affiliated with any company, and it uses no company's code, data, logos or trademarks. All names, figures and examples are illustrative or synthetic.