Publisher-side event contract for the Process Path Management
bounded context. Unlike labor-performance's own apis/asyncapi.yaml
(which documents what that service SUBSCRIBES TO), this document
describes what this service PUBLISHES: it is the SOURCE of the
process-path published language for the fleet, never a consumer of
anyone else's events.
Every message on warehouse.process-path-management.events AND
warehouse.process-path-management.analytics is a CloudEvents 1.0
event in structured content mode (Kafka protocol binding). The Kafka
message value is the JSON event format and every message carries the
Kafka header content-type: application/cloudevents+json; charset=UTF-8.
W3C trace context travels in the traceparent (and, when present,
tracestate) Kafka headers of every message raised inside a traced
operation (ADR 0027); a message raised outside any trace carries no
trace headers. Baggage is never propagated. The CloudEvent body does
not carry the trace context.
There is no other envelope, no dual-write and no envelope toggle.
{
"specversion": "1.0",
"id": "4f1c2a7e-9d31-4a6b-8f0e-6b2c1d5e7a90",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathCreated",
"subject": "PICK",
"time": "2026-09-06T00:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:events:ProcessPathCreated:v1",
"data": { "path_id": "PICK", "...": "..." }
}
id is minted once per domain event and persisted with the outbox
row, so a redelivery carries the same id; (source, id) is the
consumer idempotency key.subject is the aggregate id (path_id for ProcessPath* events,
site_id for CPTScheduleChanged, flow_id for ProcessFlow* events) —
the same value as the Kafka key.type = com.warehouse.wes.process-path-management.<entity>.<EventName>.
These exact strings are a cross-service contract (consumed by
fulfillment-execution, wes-work-planning, workforce-management and
order-management); consumers dispatch on the FULL type.dataschema = urn:warehouse:process-path-management:<events|analytics>:<EventName>:v1
distinguishes the integration payload from the analytics payload of
the same occurrence (today both carry the identical data shape)..v2 type with a new
dataschema version, never by mutating an existing one.A single topic (not one per event type) per stream. Consumers dispatch
on the CloudEvents type. ProcessPathCreated, ProcessPathUpdated,
and ProcessPathDeactivated are keyed by path_id;
CPTScheduleChanged (ADR 0010) is keyed by site_id — a different
aggregate on the same topic, so a consumer replaying the topic sees a
given path's or a given site's events in publish order, never
interleaved with another aggregate's out of order.
ProcessFlowDefined, ProcessFlowRevised and ProcessFlowRetired
(entity processflow, keyed by flow_id) carry the FULL state of one
flow: flow_id, name, stages ([{path_id, process_type}], in
order), status (ACTIVE | RETIRED) and version. The version
starts at 1 and grows by one per accepted change (a revision that
changes something, or the retirement); a change that changes nothing
raises no event and keeps it. A consumer applies a message only when
its version is greater than the one it holds, so a redelivery, and
the ProcessFlowRevised the startup republish re-enqueues for every
ACTIVE flow (at its current version), are no-ops for a consumer that is
caught up. The three types are additive on a topic whose consumers
already ignore a type they do not handle.
ProcessPathCreated/ProcessPathUpdated gained two additive fields —
cycle_time_p95 (the operator-declared p95 end-to-end cycle time) and
eligibility (the rules a unit of work must satisfy to be routed to
this path) — and this topic now also carries CPTScheduleChanged, a
new event type for the site-scoped Critical Pull Time schedule. Every
consumer's decoder must tolerate an unknown type (ignore it,
not fail) and tolerate unknown/absent fields on the payloads it
already knows, exactly as it already must for any future addition —
see ADR 0010's Consequences section.
ProcessPathCreated/ProcessPathUpdated gained an additive intake
array: the demand sources (CUSTOMER_ORDER, STOCK_TRANSFER,
SLOT_RELOCATION, INVENTORY_CONTROL, and since ADR 0036
REPLENISHMENT) allowed to route work onto the
path. order-management's path selection considers only paths whose
intake contains CUSTOMER_ORDER; [] means the path is reached only by
an explicit path id (PACK, REBIN, SLAM).
The closed intake vocabulary gained REPLENISHMENT (additive: no new
event type, no payload field). It is declared on exactly one path,
REPLENISH (match_prefix replenish, required capability
replenish), the path wes-work-planning releases pick-face top-ups on.
Consumers that decode intake as free strings need no change; a
consumer that validates against a fixed enum must accept the new value.
Three paths are declared as catalogue data under the unchanged v1
payload (additive: no new event type, no payload field, no new enum
value). FULL_CASE (match_prefix full-case, capability pick)
and CROSS_DOCK (match_prefix cross-dock, capability dispatch,
destination_location_role Shipping) accept CUSTOMER_ORDER
only for a line carrying their required_product_attributes
(fullCase, crossDock), so a line without them still selects PICK;
CROSS_DOCK also accepts STOCK_TRANSFER. BREAK_CASE
(match_prefix break, capability break) has an empty intake and is
reached only by an explicit path id. This service reads no pack fact:
the attributes are derived by the consumer from its own data.
fulfillment-execution, wes-work-planning, workforce-management
(ProcessPath* catalogue caches), order-management and
network-fulfillment (ProcessPath* and CPTScheduleChanged) consume the
integration topic; dock-scheduling and outbound-shipping consume
only CPTScheduleChanged from it. The analytics
topic is consumed only by this service's own projector
(cmd/pathmgmt-projector). See docs/docs/ecosystem/context-map.md.
Shared Kafka broker for warehouse-systems integration events. Locally, a broker is available at localhost:9092 via ~/warehouse-systems/docker-compose.kafka.yml.
This service's own integration topic (its kafka.Topic constant). Carries all three ProcessPath* event types, CPTScheduleChanged (ADR 0010) and the three ProcessFlow* event types (ADR 0042) as CloudEvents 1.0 (ADR 0016), dispatched by consumers on the full type. Kafka message key = the CloudEvents subject (path_id, site_id for CPTScheduleChanged, flow_id for ProcessFlow*), hash-balanced. Every message carries the Kafka header content-type: application/cloudevents+json; charset=UTF-8 plus traceparent / tracestate when raised inside a traced operation. Events travel through the transactional outbox (Postgres is mandatory, ADR 0037); there is no log or in-memory publisher in the shipped binary. The topic is auto-created by the broker on first write.
Publish ProcessPathCreated / ProcessPathUpdated / ProcessPathDeactivated / CPTScheduleChanged / ProcessFlowDefined / ProcessFlowRevised / ProcessFlowRetired.
One message per domain event raised by the DefinePath, RevisePath, DeactivatePath, DefineCPTSchedule, DefineProcessFlow and RetireProcessFlow use cases. A no-op revision (RevisePath, DefineCPTSchedule or DefineProcessFlow with no actual change), a no-op deactivation (already-deactivated path) and a no-op retirement (already-retired flow) raise nothing — consumers never have to diff two identical payloads to notice nothing changed.
Additionally, once at every service start (ADR 0038), after the migrations and before the listener binds, the service re-enqueues its whole CURRENT catalogue through the same transactional outbox: one ProcessPathUpdated (the path's full current state) per ACTIVE path, in ascending path_id order, then one CPTScheduleChanged per site, in ascending site_id order, then one ProcessFlowRevised (the flow's full current state at its current version, ADR 0042) per ACTIVE flow, in ascending flow_id order. Deactivated paths and retired flows are not republished. This keeps the topic carrying the current state of every live path and schedule even after the broker's retention expired their original events, so a consumer that rebuilds its catalogue by replaying the topic from the earliest offset never depends on retention. The events are ordinary ones: same types, same data, same dataschema, no new attribute; applying one for an already-known path or site is an idempotent upsert. The republish is NOT written to the analytics topic. It is bounded to 1000 paths, 1000 schedules and 1000 flows per start; beyond that the rest are not republished and an ERROR is logged.
Available only on servers:
Accepts one of the following messages:
A brand-new process path was defined.
Raised the first time a PathId is defined. Carries enough of the definition for a consumer to build its local read model without a follow-up query.
A new PICK path defined with the pick capability.
{
"specversion": "1.0",
"id": "4f1c2a7e-9d31-4a6b-8f0e-6b2c1d5e7a90",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathCreated",
"subject": "PICK",
"time": "2026-09-06T00:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:events:ProcessPathCreated:v1",
"data": {
"path_id": "PICK",
"match_prefix": "pick",
"direct": true,
"required_capabilities": [
"pick"
],
"cycle_time_p95": "24h0m0s",
"eligibility": {},
"intake": [
"CUSTOMER_ORDER"
]
}
}
A new PACK path defined with a declared Drop destination role.
{
"specversion": "1.0",
"id": "6a2d3b8f-0e42-4b7c-9f1d-7c3e2f6b8a91",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathCreated",
"subject": "PACK",
"time": "2026-09-13T00:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:events:ProcessPathCreated:v1",
"data": {
"path_id": "PACK",
"match_prefix": "pack",
"direct": true,
"required_capabilities": [
"pack"
],
"destination_location_role": "Drop",
"cycle_time_p95": "6h0m0s",
"eligibility": {},
"intake": []
}
}
A new SINGLES path with a narrowed eligibility (ADR 0010): at most one unit per line, gift-wrap required, hazmat excluded, non-sortable.
{
"specversion": "1.0",
"id": "9c4e5f21-7a83-4d5f-b1c2-8e5a3f7d2b64",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathCreated",
"subject": "SINGLES",
"time": "2026-09-13T00:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:events:ProcessPathCreated:v1",
"data": {
"path_id": "SINGLES",
"match_prefix": "singles",
"direct": true,
"required_capabilities": [
"pick"
],
"cycle_time_p95": "1h30m0s",
"eligibility": {
"max_units_per_line": 1,
"required_product_attributes": [
"giftWrap"
],
"excluded_product_attributes": [
"hazmat"
],
"non_sortable": true
},
"intake": [
"CUSTOMER_ORDER"
]
}
}
The FULL_CASE path (ADR 0038): whole-case picking, selectable only for a line carrying the fullCase attribute.
{
"specversion": "1.0",
"id": "1b7d4e92-5c68-4f03-a9d1-3e8f6a2c7b15",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathCreated",
"subject": "FULL_CASE",
"time": "2026-10-24T00:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:events:ProcessPathCreated:v1",
"data": {
"path_id": "FULL_CASE",
"match_prefix": "full-case",
"direct": true,
"required_capabilities": [
"pick"
],
"cycle_time_p95": "1h30m0s",
"eligibility": {
"required_product_attributes": [
"fullCase"
]
},
"intake": [
"CUSTOMER_ORDER"
]
}
}
The CROSS_DOCK path (ADR 0038): receive to ship with no put-away; completed work is destined for Shipping.
{
"specversion": "1.0",
"id": "8e3a5c71-2d94-4b60-8f17-5a9c1e4d6b38",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathCreated",
"subject": "CROSS_DOCK",
"time": "2026-10-24T00:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:events:ProcessPathCreated:v1",
"data": {
"path_id": "CROSS_DOCK",
"match_prefix": "cross-dock",
"direct": true,
"required_capabilities": [
"dispatch"
],
"destination_location_role": "Shipping",
"cycle_time_p95": "1h0m0s",
"eligibility": {
"required_product_attributes": [
"crossDock"
]
},
"intake": [
"CUSTOMER_ORDER",
"STOCK_TRANSFER"
]
}
}
The BREAK_CASE path (ADR 0038): reached only by an explicit path id, never selected for an order line.
{
"specversion": "1.0",
"id": "5d2f8b46-7a10-4c93-b2e5-9f6d3a1c8e72",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathCreated",
"subject": "BREAK_CASE",
"time": "2026-10-24T00:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:events:ProcessPathCreated:v1",
"data": {
"path_id": "BREAK_CASE",
"match_prefix": "break",
"direct": true,
"required_capabilities": [
"break"
],
"cycle_time_p95": "2h0m0s",
"eligibility": {},
"intake": []
}
}
An Active path's matchPrefix, requiredCapabilities, cycleTimeP95, eligibility, or intake was revised.
Raised when RevisePath actually changes something. Not raised for a no-op update. Also published once per ACTIVE path at every service start (ADR 0038), carrying the path's full current state, so the topic holds it regardless of broker retention; consumers upsert it exactly like a revision.
The PICK path's zone and required capabilities were revised.
{
"specversion": "1.0",
"id": "8a3d6c11-52b7-4f0d-9c14-3e7a5b8d2f46",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathUpdated",
"subject": "PICK",
"time": "2026-09-06T01:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:events:ProcessPathUpdated:v1",
"data": {
"path_id": "PICK",
"match_prefix": "pick-zone-a",
"direct": true,
"required_capabilities": [
"pick",
"hazmat"
],
"cycle_time_p95": "24h0m0s",
"eligibility": {},
"intake": [
"CUSTOMER_ORDER"
]
}
}
A path was retired.
Raised the first time a path transitions to Deactivated (never republished on a subsequent, already-deactivated deactivation attempt). Consumers must stop accepting NEW work against this path once they observe this event, but this service takes no position on in-flight work already assigned to it in a downstream context — that is each consumer's own operational concern.
The PACK path was retired.
{
"specversion": "1.0",
"id": "c25b9f83-7e64-4a19-b8d2-0f5a3c6e1b47",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathDeactivated",
"subject": "PACK",
"time": "2026-09-06T02:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:events:ProcessPathDeactivated:v1",
"data": {
"path_id": "PACK"
}
}
A site's Critical Pull Time (CPT) schedule was defined or revised.
Raised by DefineCPTSchedule whenever a schedule is first defined or a subsequent revision actually changes something (ADR 0010). Carries the FULL schedule — a snapshot, not a diff — so a fresh consumer replaying from FirstOffset needs no prior state to build its read model, the same self-sufficient-event convention ProcessPathCreated/Updated already use. Keyed by site_id, not path_id — a different aggregate sharing this topic. Also published once per site at every service start (ADR 0038), with the schedule's current cutoffs, so the topic holds it regardless of broker retention; consumers upsert it as they do a revision.
Site sp1's schedule defined with one 15:00 ground cutoff.
{
"specversion": "1.0",
"id": "1d2e3f4a-5b6c-4d7e-8f9a-0b1c2d3e4f5a",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.cptschedule.CPTScheduleChanged",
"subject": "sp1",
"time": "2026-09-13T00:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:events:CPTScheduleChanged:v1",
"data": {
"site_id": "sp1",
"timezone": "America/Sao_Paulo",
"cutoffs": [
{
"cpt_id": "sp1-1500",
"local_time": "15:00",
"days_of_week": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
],
"ship_method": "ground",
"eligible_path_ids": [
"PICK",
"PACK"
]
}
]
}
}
A process flow was defined.
Raised by DefineProcessFlow the first time a flow_id is defined (PUT /process-flows/{flowId}). Carries the FULL state of the flow at version 1. Keyed by flow_id, so one flow's events stay in order on one partition.
The flow single-unit at version 1.
{
"specversion": "1.0",
"id": "7a1e5c32-6b04-4d58-9e3f-2c8d1f0a4b66",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processflow.ProcessFlowDefined",
"subject": "single-unit",
"time": "2026-11-20T08:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:events:ProcessFlowDefined:v1",
"data": {
"flow_id": "single-unit",
"name": "Single unit",
"stages": [
{
"path_id": "PICK",
"process_type": "PICK"
},
{
"path_id": "PACK",
"process_type": "PACK"
}
],
"status": "ACTIVE",
"version": 1
}
}
A process flow was revised (or republished at start).
Raised by DefineProcessFlow when a revision of an ACTIVE flow changes its name or stages, with the full new state and the next version. Also enqueued once per ACTIVE flow at every service start (ADR 0038) with the CURRENT state at the CURRENT version: a consumer that is caught up (it applies a message only when its version is greater than the one it holds) ignores it, a fresh one learns the flow. Keyed by flow_id, so one flow's events stay in order on one partition.
The flow single-unit at version 2.
{
"specversion": "1.0",
"id": "7a1e5c32-6b04-4d58-9e3f-2c8d1f0a4b66",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processflow.ProcessFlowRevised",
"subject": "single-unit",
"time": "2026-11-20T08:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:events:ProcessFlowRevised:v1",
"data": {
"flow_id": "single-unit",
"name": "Single unit",
"stages": [
{
"path_id": "PICK",
"process_type": "PICK"
},
{
"path_id": "REBIN",
"process_type": "REBIN"
},
{
"path_id": "PACK",
"process_type": "PACK"
}
],
"status": "ACTIVE",
"version": 2
}
}
A process flow was retired.
Raised by RetireProcessFlow the first time a flow is retired: the full state with status RETIRED and the next version. A retired flow cannot be revised. Keyed by flow_id, so one flow's events stay in order on one partition.
The flow single-unit at version 3.
{
"specversion": "1.0",
"id": "7a1e5c32-6b04-4d58-9e3f-2c8d1f0a4b66",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processflow.ProcessFlowRetired",
"subject": "single-unit",
"time": "2026-11-20T08:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:events:ProcessFlowRetired:v1",
"data": {
"flow_id": "single-unit",
"name": "Single unit",
"stages": [
{
"path_id": "PICK",
"process_type": "PICK"
},
{
"path_id": "REBIN",
"process_type": "REBIN"
},
{
"path_id": "PACK",
"process_type": "PACK"
}
],
"status": "RETIRED",
"version": 3
}
}
Internal analytics topic (kafka.AnalyticsTopic, ADR 0007), consumed only by this service's own projector. Same CloudEvents type, subject, time and data as the integration occurrence; only dataschema differs (...:analytics:<EventName>:v1). Messages that fail CloudEvents validation are dead-lettered to warehouse.process-path-management.analytics.dlq.
Publish the analytics occurrence of every domain event.
Written in the same outbox transaction as the integration row, sharing its CloudEvents id. The startup catalogue republish (ADR 0038) is the one exception: it is not a catalogue change, so it is not written here and never inflates the revised-paths report (and, likewise, never a ProcessFlowRevised). Kafka key and headers are the same as on the integration topic.
Available only on servers:
Accepts one of the following messages:
Analytics occurrence of ProcessPathCreated for this service's own projector.
Same occurrence as the integration message; only dataschema differs.
{
"specversion": "1.0",
"id": "4f1c2a7e-9d31-4a6b-8f0e-6b2c1d5e7a90",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathCreated",
"subject": "PICK",
"time": "2026-09-06T00:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:analytics:ProcessPathCreated:v1",
"data": {
"path_id": "PICK",
"match_prefix": "pick",
"direct": true,
"required_capabilities": [
"pick"
],
"cycle_time_p95": "24h0m0s",
"eligibility": {},
"intake": [
"CUSTOMER_ORDER"
]
}
}
Analytics occurrence of ProcessPathUpdated for this service's own projector.
Same occurrence as the integration message; only dataschema differs.
{
"specversion": "1.0",
"id": "4f1c2a7e-9d31-4a6b-8f0e-6b2c1d5e7a90",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathUpdated",
"subject": "PICK",
"time": "2026-09-06T00:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:analytics:ProcessPathUpdated:v1",
"data": {
"path_id": "PICK",
"match_prefix": "pick-zone-a",
"direct": true,
"required_capabilities": [
"pick",
"hazmat"
],
"cycle_time_p95": "24h0m0s",
"eligibility": {},
"intake": [
"CUSTOMER_ORDER"
]
}
}
Analytics occurrence of ProcessPathDeactivated for this service's own projector.
Same occurrence as the integration message; only dataschema differs.
{
"specversion": "1.0",
"id": "4f1c2a7e-9d31-4a6b-8f0e-6b2c1d5e7a90",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathDeactivated",
"subject": "PACK",
"time": "2026-09-06T00:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:analytics:ProcessPathDeactivated:v1",
"data": {
"path_id": "PACK"
}
}
Analytics occurrence of CPTScheduleChanged for this service's own projector.
Same occurrence as the integration message; only dataschema differs.
{
"specversion": "1.0",
"id": "4f1c2a7e-9d31-4a6b-8f0e-6b2c1d5e7a90",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.cptschedule.CPTScheduleChanged",
"subject": "sp1",
"time": "2026-09-06T00:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:analytics:CPTScheduleChanged:v1",
"data": {
"site_id": "sp1",
"timezone": "America/Sao_Paulo",
"cutoffs": [
{
"cpt_id": "sp1-1500",
"local_time": "15:00",
"days_of_week": [
"Mon"
],
"ship_method": "ground",
"eligible_path_ids": [
"PICK"
]
}
]
}
}
Analytics occurrence of ProcessFlowDefined (acknowledged, not projected, by this service's projector).
Raised by DefineProcessFlow the first time a flow_id is defined (PUT /process-flows/{flowId}). Carries the FULL state of the flow at version 1. Same type, subject, time and data as the integration occurrence; only dataschema differs.
The flow single-unit at version 1.
{
"specversion": "1.0",
"id": "7a1e5c32-6b04-4d58-9e3f-2c8d1f0a4b66",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processflow.ProcessFlowDefined",
"subject": "single-unit",
"time": "2026-11-20T08:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:analytics:ProcessFlowDefined:v1",
"data": {
"flow_id": "single-unit",
"name": "Single unit",
"stages": [
{
"path_id": "PICK",
"process_type": "PICK"
},
{
"path_id": "PACK",
"process_type": "PACK"
}
],
"status": "ACTIVE",
"version": 1
}
}
Analytics occurrence of ProcessFlowRevised (acknowledged, not projected, by this service's projector).
Raised by DefineProcessFlow when a revision of an ACTIVE flow changes its name or stages, with the full new state and the next version. The startup republish (ADR 0038) is not written to this topic. Same type, subject, time and data as the integration occurrence; only dataschema differs.
The flow single-unit at version 2.
{
"specversion": "1.0",
"id": "7a1e5c32-6b04-4d58-9e3f-2c8d1f0a4b66",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processflow.ProcessFlowRevised",
"subject": "single-unit",
"time": "2026-11-20T08:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:analytics:ProcessFlowRevised:v1",
"data": {
"flow_id": "single-unit",
"name": "Single unit",
"stages": [
{
"path_id": "PICK",
"process_type": "PICK"
},
{
"path_id": "REBIN",
"process_type": "REBIN"
},
{
"path_id": "PACK",
"process_type": "PACK"
}
],
"status": "ACTIVE",
"version": 2
}
}
Analytics occurrence of ProcessFlowRetired (acknowledged, not projected, by this service's projector).
Raised by RetireProcessFlow the first time a flow is retired: the full state with status RETIRED and the next version. A retired flow cannot be revised. Same type, subject, time and data as the integration occurrence; only dataschema differs.
The flow single-unit at version 3.
{
"specversion": "1.0",
"id": "7a1e5c32-6b04-4d58-9e3f-2c8d1f0a4b66",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processflow.ProcessFlowRetired",
"subject": "single-unit",
"time": "2026-11-20T08:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:analytics:ProcessFlowRetired:v1",
"data": {
"flow_id": "single-unit",
"name": "Single unit",
"stages": [
{
"path_id": "PICK",
"process_type": "PICK"
},
{
"path_id": "REBIN",
"process_type": "REBIN"
},
{
"path_id": "PACK",
"process_type": "PACK"
}
],
"status": "RETIRED",
"version": 3
}
}
Internal analytics topic (kafka.AnalyticsTopic, ADR 0007), consumed only by this service's own projector. Same CloudEvents type, subject, time and data as the integration occurrence; only dataschema differs (...:analytics:<EventName>:v1). Messages that fail CloudEvents validation are dead-lettered to warehouse.process-path-management.analytics.dlq.
Receive the analytics occurrence of the catalogue events (own projector).
Read by cmd/pathmgmt-projector only, in consumer group process-path-management-analytics. It decodes and validates every message as a CloudEvents 1.0 event, dispatches on the FULL type, and projects only ProcessPathCreated, ProcessPathUpdated and ProcessPathDeactivated (counting them per UTC day by the event time, deduplicated on the CloudEvents id). Any other valid type, CPTScheduleChanged and the three ProcessFlow* types (ADR 0042) included, is acknowledged and not projected: it is committed as a no-op, never retried and never dead-lettered. A message that fails CloudEvents validation, or whose handler keeps failing after its retries, is copied unmodified to the dead-letter topic warehouse.process-path-management.analytics.dlq and the offset is committed; the consumer never crashes on it and never parses a legacy shape.
Available only on servers:
Accepts one of the following messages:
Analytics occurrence of ProcessPathCreated for this service's own projector.
Same occurrence as the integration message; only dataschema differs.
{
"specversion": "1.0",
"id": "4f1c2a7e-9d31-4a6b-8f0e-6b2c1d5e7a90",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathCreated",
"subject": "PICK",
"time": "2026-09-06T00:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:analytics:ProcessPathCreated:v1",
"data": {
"path_id": "PICK",
"match_prefix": "pick",
"direct": true,
"required_capabilities": [
"pick"
],
"cycle_time_p95": "24h0m0s",
"eligibility": {},
"intake": [
"CUSTOMER_ORDER"
]
}
}
Analytics occurrence of ProcessPathUpdated for this service's own projector.
Same occurrence as the integration message; only dataschema differs.
{
"specversion": "1.0",
"id": "4f1c2a7e-9d31-4a6b-8f0e-6b2c1d5e7a90",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathUpdated",
"subject": "PICK",
"time": "2026-09-06T00:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:analytics:ProcessPathUpdated:v1",
"data": {
"path_id": "PICK",
"match_prefix": "pick-zone-a",
"direct": true,
"required_capabilities": [
"pick",
"hazmat"
],
"cycle_time_p95": "24h0m0s",
"eligibility": {},
"intake": [
"CUSTOMER_ORDER"
]
}
}
Analytics occurrence of ProcessPathDeactivated for this service's own projector.
Same occurrence as the integration message; only dataschema differs.
{
"specversion": "1.0",
"id": "4f1c2a7e-9d31-4a6b-8f0e-6b2c1d5e7a90",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathDeactivated",
"subject": "PACK",
"time": "2026-09-06T00:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:analytics:ProcessPathDeactivated:v1",
"data": {
"path_id": "PACK"
}
}
A brand-new process path was defined.
Raised the first time a PathId is defined. Carries enough of the definition for a consumer to build its local read model without a follow-up query.
An Active path's matchPrefix, requiredCapabilities, cycleTimeP95, eligibility, or intake was revised.
Raised when RevisePath actually changes something. Not raised for a no-op update. Also published once per ACTIVE path at every service start (ADR 0038), carrying the path's full current state, so the topic holds it regardless of broker retention; consumers upsert it exactly like a revision.
A path was retired.
Raised the first time a path transitions to Deactivated (never republished on a subsequent, already-deactivated deactivation attempt). Consumers must stop accepting NEW work against this path once they observe this event, but this service takes no position on in-flight work already assigned to it in a downstream context — that is each consumer's own operational concern.
A site's Critical Pull Time (CPT) schedule was defined or revised.
Raised by DefineCPTSchedule whenever a schedule is first defined or a subsequent revision actually changes something (ADR 0010). Carries the FULL schedule — a snapshot, not a diff — so a fresh consumer replaying from FirstOffset needs no prior state to build its read model, the same self-sufficient-event convention ProcessPathCreated/Updated already use. Keyed by site_id, not path_id — a different aggregate sharing this topic. Also published once per site at every service start (ADR 0038), with the schedule's current cutoffs, so the topic holds it regardless of broker retention; consumers upsert it as they do a revision.
A process flow was defined.
Raised by DefineProcessFlow the first time a flow_id is defined (PUT /process-flows/{flowId}). Carries the FULL state of the flow at version 1. Keyed by flow_id, so one flow's events stay in order on one partition.
A process flow was revised (or republished at start).
Raised by DefineProcessFlow when a revision of an ACTIVE flow changes its name or stages, with the full new state and the next version. Also enqueued once per ACTIVE flow at every service start (ADR 0038) with the CURRENT state at the CURRENT version: a consumer that is caught up (it applies a message only when its version is greater than the one it holds) ignores it, a fresh one learns the flow. Keyed by flow_id, so one flow's events stay in order on one partition.
A process flow was retired.
Raised by RetireProcessFlow the first time a flow is retired: the full state with status RETIRED and the next version. A retired flow cannot be revised. Keyed by flow_id, so one flow's events stay in order on one partition.
Analytics occurrence of ProcessPathCreated for this service's own projector.
Analytics occurrence of ProcessPathUpdated for this service's own projector.
Analytics occurrence of ProcessPathDeactivated for this service's own projector.
Analytics occurrence of CPTScheduleChanged for this service's own projector.
Analytics occurrence of ProcessFlowDefined (acknowledged, not projected, by this service's projector).
Raised by DefineProcessFlow the first time a flow_id is defined (PUT /process-flows/{flowId}). Carries the FULL state of the flow at version 1. Same type, subject, time and data as the integration occurrence; only dataschema differs.
Analytics occurrence of ProcessFlowRevised (acknowledged, not projected, by this service's projector).
Raised by DefineProcessFlow when a revision of an ACTIVE flow changes its name or stages, with the full new state and the next version. The startup republish (ADR 0038) is not written to this topic. Same type, subject, time and data as the integration occurrence; only dataschema differs.
Analytics occurrence of ProcessFlowRetired (acknowledged, not projected, by this service's projector).
Raised by RetireProcessFlow the first time a flow is retired: the full state with status RETIRED and the next version. A retired flow cannot be revised. Same type, subject, time and data as the integration occurrence; only dataschema differs.
Every attribute is REQUIRED in this fleet. Kafka header content-type: application/cloudevents+json; charset=UTF-8.
Rules a unit of work must satisfy to be routed to this path (ADR 0010). Every field is omitted (not zero-valued) when unset; a fully permissive eligibility still appears as an empty object {}, never an absent field.
The FULL state of one flow at one version (ADR 0042), the payload of all three ProcessFlow* types. A consumer applies a message only when version is greater than the one it holds.