Domain-event catalog for Workforce Management, a Supporting bounded context in the WES (Warehouse Execution Systems) subdomain. It owns "who is on shift, on which process path, at what rate; direct vs indirect hours" — the shift-start planning horizon (a human commits a split of headcount across paths) plus intra-shift assignment tracking (moving associates between paths as backlogs deviate). It stops at the path boundary: it never links an associate to a specific task, and it never decides a rebalance — it makes the labor picture legible and enforces its invariants.
Three aggregates raise the events documented here:
AssociateShift (package internal/domain/associate) — roster entry:
who is on, their certifications, their break state, their logged hours.
Raises AssociateShiftStarted, AssociateCertified,
AssociateBreakStarted, AssociateBreakEnded, AssociateShiftEnded.ShiftPlan (package internal/domain/shiftplan) — the committed split
of headcount across paths for one site's shift (siteCode; buildingId
is its deprecated alias, ADR 0035), made of PathPlan
lines. Raises ShiftPlanProposed, ShiftPlanCommitted and the
staffing-gap flag PathUnderstaffed.LaborAssignment (package internal/domain/assignment) — one
associate on one path for an interval, with exactly one ACTIVE
assignment per associate at a time. Raises LaborAssigned and
LaborReassigned.Envelope (mandatory). Every Kafka message this service produces or
consumes is a CloudEvents 1.0 event in structured content mode
(ADR-0026, superseding the envelope half of ADR-0004): the Kafka message
value is the JSON event format, content type
application/cloudevents+json, and every message carries the Kafka header
content-type: application/cloudevents+json; charset=UTF-8 alongside the
W3C traceparent/tracestate headers. All of specversion (1.0),
id, source (/warehouse/workforce-management), type, subject,
time, datacontenttype (application/json) and dataschema are
REQUIRED; the bounded context's own payload sits under data. There is
no flat envelope and no envelope toggle.
Type naming convention. The CloudEvents type attribute is
reverse-DNS dotted and follows the exact shape
com.warehouse.<subdomain>.<bounded-context>.<entity>.<EventName>, all
lowercase except the final PascalCase event name. For this context the
subdomain is wes and the bounded context is workforce-management, so
for example a committed shift plan is published as
com.warehouse.wes.workforce-management.shiftplan.ShiftPlanCommitted.
The entity segment is the aggregate that raises the event —
associate, shiftplan or assignment. PathUnderstaffed uses
shiftplan, since the gap is measured against a committed ShiftPlan's
planned heads. A breaking payload change gets a new .v2 type and a new
dataschema version, never a mutation of the old one.
dataschema. urn:warehouse:workforce-management:<stream>:<EventName>:v1
where <stream> is events for warehouse.workforce.events and
analytics for warehouse.workforce.analytics. The same occurrence keeps
the same type on both topics; dataschema names the payload shape.
Subject. The aggregate instance id: the associate id for
associate/assignment events, the path id for PathUnderstaffed and
ShiftPlanProposed, and the ShiftPlan aggregate id
<buildingId>/<shiftId> for ShiftPlanCommitted (the same value as the
integration message's Kafka key). The first segment of that id IS the site
code (ADR 0035): the subject and the Kafka key are unchanged by the
siteCode convergence, so no consumer's partitioning or ordering moves.
siteCode / buildingId (ADR 0035). The ShiftPlan key has one canonical
name, siteCode (the facility-layout Site code), and one deprecated alias,
buildingId, with the SAME value. ShiftPlanProposed and
ShiftPlanCommitted (v1, both topics where published) therefore carry
site_code next to the unchanged, now deprecated, building_id. The
change is additive: no .v2, nothing removed, site_code is not
required in the schema because messages produced before the addition lack
it. Removing building_id is a future breaking change with its own ADR.
Which events leave the process on which topic. The integration topic
warehouse.workforce.events carries only ShiftPlanCommitted, fanned
out into one message per PathPlan line. Every event in this catalog is
published to the internal analytics topic
warehouse.workforce.analytics (consumed by this service's own analytics
projector, ADR-0010). Each message below pins its exact type and
dataschema and documents the payload actually on the wire.
Shared warehouse-systems Kafka cluster. Workforce Management publishes its outbound domain events here; downstream bounded contexts (Work Planning) consume from the same cluster.
The single outbound topic for this bounded context, matching the
Topic constant in internal/adapters/outbound/kafka/publisher.go
(warehouse.workforce.events). Messages are CloudEvents 1.0
structured-mode JSON with the content-type: application/cloudevents+json; charset=UTF-8 Kafka header. Consumers
must dispatch on the full type, ignore unknown type values, and
dedupe on id.
Consume Workforce Management domain events.
Subscribe to the Workforce Management domain-event stream. Every
message is a CloudEvents 1.0 structured-mode event; route on the full
type context attribute, which follows
com.warehouse.wes.workforce-management.<entity>.<EventName>.
Only ShiftPlanCommitted is published to this topic, fanned out into
one message per PathPlan line of the committed plan, each with its
own unique id. The remaining messages listed here are published to
the analytics topic only — see each message's description.
Available only on servers:
Accepts the following message:
A human committed a headcount split across process paths for a site's shift.
Raised by the ShiftPlan aggregate when a human commits the split of
headcount across process paths for one site's shift. The commit
is validated in the domain: plannedHeads(path) must not exceed
installedStations(path), and planned hours must fit the shift's max
hours.
Published to warehouse.workforce.events. This is the only
domain event on the integration topic; wes-work-planning dispatches on
its exact type. The adapter loads the committed
plan through the ShiftPlanRepo and fans the single domain event
out into one Kafka message per PathPlan line — a plan committed
with three path lines produces three messages on
warehouse.workforce.events, each carrying that one line's
path_id, planned_heads, planned_rate and planned_hours
alongside the plan's site_code (canonical) and building_id
(deprecated, same value) and shift_id. Consumers must
therefore expect N messages per commit, not one, and must not assume
a message carries the whole plan. Every line message has its own
unique CloudEvents id (minted once and persisted with the outbox
row, so a redelivery repeats it); subject is the ShiftPlan aggregate
id <buildingId>/<shiftId>, identical to the Kafka key.
CloudEvent for one PathPlan line of a committed
ShiftPlan. The data fields mirror exactly what the Kafka
publisher emits per line.
One of three messages fanned out from a plan committed for building BLD1, shift SHIFT1.
{
"specversion": "1.0",
"id": "9f1c2b7e-4c3a-4a1d-9f0b-6c2b8a7d1e33",
"source": "/warehouse/workforce-management",
"type": "com.warehouse.wes.workforce-management.shiftplan.ShiftPlanCommitted",
"subject": "BLD1/SHIFT1",
"time": "2026-08-21T22:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:workforce-management:events:ShiftPlanCommitted:v1",
"data": {
"site_code": "BLD1",
"building_id": "BLD1",
"shift_id": "SHIFT1",
"path_id": "pack",
"planned_heads": 3,
"planned_rate": 50,
"planned_hours": 24
}
}
Internal analytics topic (ADR-0010), matching the AnalyticsTopic
constant in internal/adapters/outbound/kafka/analytics_publisher.go.
Every domain event this context raises is published here as a
CloudEvents 1.0 structured-mode event with dataschema
urn:warehouse:workforce-management:analytics:<EventName>:v1. Consumed
by this service's own analytics projector (workforce-analytics
consumer group), which dedupes on id and dead-letters anything that
fails CloudEvents validation to warehouse.workforce.analytics.dlq.
Consume Workforce Management analytics events.
Subscribe to the analytics stream. Route on the full type; the same
occurrence carries the same type as on the integration topic, and
dataschema distinguishes the analytics payload shape.
Available only on servers:
Accepts one of the following messages:
The analytics-topic form of a shift-plan commit — one message per commit, not per line.
Published only to warehouse.workforce.analytics. Same type as the
integration message, different dataschema and payload: one message
per commit carrying just the plan's identity. Kafka key is the
building id; subject is the ShiftPlan aggregate id
<buildingId>/<shiftId>.
CloudEvent for one shift-plan commit on the analytics topic.
The analytics record of a plan committed for building BLD1, shift SHIFT1.
{
"specversion": "1.0",
"id": "4f2a9c1d-7b3e-4d8a-9e61-2c5b7a0d3f19",
"source": "/warehouse/workforce-management",
"type": "com.warehouse.wes.workforce-management.shiftplan.ShiftPlanCommitted",
"subject": "BLD1/SHIFT1",
"time": "2026-08-21T22:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:workforce-management:analytics:ShiftPlanCommitted:v1",
"data": {
"site_code": "BLD1",
"building_id": "BLD1",
"shift_id": "SHIFT1"
}
}
Heads for a path were computed from charge and planned rate, ahead of any human commit.
Raised by the ShiftPlan aggregate when heads for a path are
proposed as a pure computation — heads = ceil(charge / plannedRate)
— before a human commits anything. A proposal is advisory: the
software proposes, a human commits.
Not on the integration topic. Published only to the internal
analytics topic warehouse.workforce.analytics (dataschema
urn:warehouse:workforce-management:analytics:<EventName>:v1).
CloudEvent for a proposed, not-yet-committed headcount figure for one path.
Six heads proposed for the pack path at a planned rate of 50 units/hour.
{
"specversion": "1.0",
"id": "3d4a1f60-2b8e-4c17-8a55-0c6f9d2b41aa",
"source": "/warehouse/workforce-management",
"type": "com.warehouse.wes.workforce-management.shiftplan.ShiftPlanProposed",
"subject": "pack",
"time": "2026-08-21T21:30:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:workforce-management:analytics:ShiftPlanProposed:v1",
"data": {
"site_code": "BLD1",
"building_id": "BLD1",
"path_id": "pack",
"planned_heads": 6,
"planned_rate": 50
}
}
A path's active assignments fall short of its committed planned heads.
Raised when the staffing-gap read model finds that a path's active
LaborAssignment count is below the plannedHeads committed for it
on the current ShiftPlan. This is a flag, not a decision: this
bounded context surfaces the gap and never moves anyone in response.
Rebalancing is a human call, recorded back here as a new assignment.
Site scope (ADR 0034, additive). When the gap was requested for
one canonical site, data.site_code carries it and active_heads
counts only associates with an active shift at that site. When
site_code is absent the gap is unscoped (every site together,
the pre-ADR-0034 behaviour): consumers MUST treat absence as
"unscoped", never as a particular site.
Not on the integration topic. Published only to the internal
analytics topic warehouse.workforce.analytics (dataschema
urn:warehouse:workforce-management:analytics:<EventName>:v1).
CloudEvent for the staffing-gap flag on a single path.
The pack path is planned for 5 heads but only 3 assignments are active.
{
"specversion": "1.0",
"id": "b81e5f2c-7a94-4d0e-9c33-1e7f4b6a8d05",
"source": "/warehouse/workforce-management",
"type": "com.warehouse.wes.workforce-management.shiftplan.PathUnderstaffed",
"subject": "pack",
"time": "2026-08-22T02:15:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:workforce-management:analytics:PathUnderstaffed:v1",
"data": {
"path_id": "pack",
"planned_heads": 5,
"active_heads": 3
}
}
The same gap computed for site WH1 only (additive site_code).
{
"specversion": "1.0",
"id": "c92f6a3d-8ba5-4e1f-8d44-2f8a5c7b9e16",
"source": "/warehouse/workforce-management",
"type": "com.warehouse.wes.workforce-management.shiftplan.PathUnderstaffed",
"subject": "pack",
"time": "2026-08-22T02:15:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:workforce-management:analytics:PathUnderstaffed:v1",
"data": {
"path_id": "pack",
"planned_heads": 5,
"active_heads": 2,
"site_code": "WH1"
}
}
An associate's roster entry was created for the shift, with their certifications.
Raised by the AssociateShift aggregate when an associate's shift
roster entry is created. The associate's certifications are the
qualification gate for assignment: an associate untrained on a path
cannot be placed on it.
Not on the integration topic. Published only to the internal
analytics topic warehouse.workforce.analytics (dataschema
urn:warehouse:workforce-management:analytics:<EventName>:v1).
CloudEvent for the creation of an associate's shift roster entry.
Associate A-1001 starts a shift.
{
"specversion": "1.0",
"id": "c4d9a1b2-5e63-4f8a-b0d7-2a9c3e1f7b44",
"source": "/warehouse/workforce-management",
"type": "com.warehouse.wes.workforce-management.associate.AssociateShiftStarted",
"subject": "A-1001",
"time": "2026-08-21T22:05:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:workforce-management:analytics:AssociateShiftStarted:v1",
"data": {
"associate_id": "A-1001"
}
}
A certification was added to an associate's roster entry.
Raised by the AssociateShift aggregate when a named qualification
(for example pack, pick or hazmat) is added to an associate.
Certifications gate assignment: AssignLabor rejects an associate
who does not hold the path's required certification.
Not on the integration topic. Published only to the internal
analytics topic warehouse.workforce.analytics (dataschema
urn:warehouse:workforce-management:analytics:<EventName>:v1).
CloudEvent for adding one certification to an associate.
Associate A-1001 gains the hazmat certification mid-shift.
{
"specversion": "1.0",
"id": "7e2f80a3-91c4-4b56-8de1-3f5a2c9b6d18",
"source": "/warehouse/workforce-management",
"type": "com.warehouse.wes.workforce-management.associate.AssociateCertified",
"subject": "A-1001",
"time": "2026-08-22T00:40:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:workforce-management:analytics:AssociateCertified:v1",
"data": {
"associate_id": "A-1001",
"certification": "hazmat"
}
}
An associate began a logged break and is no longer assignable.
Raised by the AssociateShift aggregate when an associate begins a
logged break. While a break is active the associate cannot be given a
new LaborAssignment — AssignLabor rejects the attempt.
Not on the integration topic. Published only to the internal
analytics topic warehouse.workforce.analytics (dataschema
urn:warehouse:workforce-management:analytics:<EventName>:v1).
CloudEvent for the start of an associate's logged break.
Associate A-1001 goes on break.
{
"specversion": "1.0",
"id": "1a6b4c8d-0e27-43f9-9b51-8c7d2e4a5f36",
"source": "/warehouse/workforce-management",
"type": "com.warehouse.wes.workforce-management.associate.AssociateBreakStarted",
"subject": "A-1001",
"time": "2026-08-22T01:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:workforce-management:analytics:AssociateBreakStarted:v1",
"data": {
"associate_id": "A-1001"
}
}
An associate ended a logged break and is assignable again.
Raised by the AssociateShift aggregate when an associate's logged
break ends. The associate becomes eligible for a new
LaborAssignment again, subject to the certification gate.
Not on the integration topic. Published only to the internal
analytics topic warehouse.workforce.analytics (dataschema
urn:warehouse:workforce-management:analytics:<EventName>:v1).
CloudEvent for the end of an associate's logged break.
Associate A-1001 returns from break.
{
"specversion": "1.0",
"id": "5c0d8e19-6a3b-472c-91ef-4b8a0d6c3e57",
"source": "/warehouse/workforce-management",
"type": "com.warehouse.wes.workforce-management.associate.AssociateBreakEnded",
"subject": "A-1001",
"time": "2026-08-22T01:30:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:workforce-management:analytics:AssociateBreakEnded:v1",
"data": {
"associate_id": "A-1001"
}
}
An associate's shift closed, ending all of their active assignments.
Raised by the AssociateShift aggregate when an associate's shift
closes. Closing a shift ends every active LaborAssignment for that
associate, so downstream consumers should treat this as a terminal
signal for the associate's labor picture on the shift.
Not on the integration topic. Published only to the internal
analytics topic warehouse.workforce.analytics (dataschema
urn:warehouse:workforce-management:analytics:<EventName>:v1).
CloudEvent for the close of an associate's shift.
Associate A-1001 clocks out at end of shift.
{
"specversion": "1.0",
"id": "e2b7d3f4-8c15-4a6e-b09d-7f3c1a5b2d68",
"source": "/warehouse/workforce-management",
"type": "com.warehouse.wes.workforce-management.associate.AssociateShiftEnded",
"subject": "A-1001",
"time": "2026-08-22T06:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:workforce-management:analytics:AssociateShiftEnded:v1",
"data": {
"associate_id": "A-1001"
}
}
An associate was placed on a process path for an interval.
Raised by the LaborAssignment aggregate when an associate is
assigned to a process path. The domain enforces two hard invariants
before this event exists: the associate holds the path's required
certification, and the associate has no other ACTIVE assignment (no
double-booking across paths).
Note the path boundary: this places an associate on a path, never on a specific task. Dispatching individual tasks belongs to Fulfillment Execution.
Attribution (additive). When the assignment was requested through
the MCP assign_labor tool or the A2A assign_labor skill, data
also carries initiated_by (via = mcp or a2a, set by the
adapter, plus the caller's optional proposal_id, approved_by and
agent_id). It is absent for REST and every other caller: absence
means "not agent-initiated". It is event data only; no CloudEvents
extension attribute is added, and the v1 dataschema is unchanged.
Not on the integration topic. Published only to the internal
analytics topic warehouse.workforce.analytics (dataschema
urn:warehouse:workforce-management:analytics:<EventName>:v1).
CloudEvent for placing an associate on a process path.
Associate A-1001 is assigned to the pack path.
{
"specversion": "1.0",
"id": "0b3f6a29-4d71-4e8c-a25b-9e1d7c4f8a02",
"source": "/warehouse/workforce-management",
"type": "com.warehouse.wes.workforce-management.assignment.LaborAssigned",
"subject": "A-1001",
"time": "2026-08-21T22:10:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:workforce-management:analytics:LaborAssigned:v1",
"data": {
"associate_id": "A-1001",
"path_id": "pack"
}
}
Associate A-1001 is assigned to the pack path by the warehouse-ops-agent over A2A, executing an approved proposal.
{
"specversion": "1.0",
"id": "5e1d9c34-7a2b-4c58-b0f6-3a8e2d1c9b47",
"source": "/warehouse/workforce-management",
"type": "com.warehouse.wes.workforce-management.assignment.LaborAssigned",
"subject": "A-1001",
"time": "2026-08-21T22:15:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:workforce-management:analytics:LaborAssigned:v1",
"data": {
"associate_id": "A-1001",
"path_id": "pack",
"initiated_by": {
"via": "a2a",
"proposal_id": "prop-7f3a",
"approved_by": "supervisor-12",
"agent_id": "warehouse-ops-agent"
}
}
}
An associate's active assignment was ended in favour of another path.
Raised by the LaborAssignment aggregate when an associate's prior
active assignment is closed and a new one opened on a different path
— the intra-shift move that keeps the one-ACTIVE-assignment invariant
intact. The move is always a human call recorded here; this context
never decides a rebalance on its own.
Attribution (additive). Like LaborAssigned, data carries
initiated_by when the move was requested through the MCP or A2A
assign_labor surface, and omits it otherwise (REST). An agent
reallocating an associate who is already on a path raises this event,
not LaborAssigned, so the attribution must be here too.
Not on the integration topic. Published only to the internal
analytics topic warehouse.workforce.analytics (dataschema
urn:warehouse:workforce-management:analytics:<EventName>:v1).
CloudEvent for moving an associate from one path to another.
Associate A-1001 is moved from pack to pick as the pick backlog grows.
{
"specversion": "1.0",
"id": "a75c1e88-3b02-4f6d-8c94-2d6b5a0f3e71",
"source": "/warehouse/workforce-management",
"type": "com.warehouse.wes.workforce-management.assignment.LaborReassigned",
"subject": "A-1001",
"time": "2026-08-22T02:20:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:workforce-management:analytics:LaborReassigned:v1",
"data": {
"associate_id": "A-1001",
"from_path_id": "pack",
"to_path_id": "pick"
}
}
Associate A-1001 is moved from pack to pick by the warehouse-ops-agent over A2A, executing an approved proposal.
{
"specversion": "1.0",
"id": "c3a4f7d2-91be-4e60-8d15-6b2f0a9e7c13",
"source": "/warehouse/workforce-management",
"type": "com.warehouse.wes.workforce-management.assignment.LaborReassigned",
"subject": "A-1001",
"time": "2026-08-22T02:25:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:workforce-management:analytics:LaborReassigned:v1",
"data": {
"associate_id": "A-1001",
"from_path_id": "pack",
"to_path_id": "pick",
"initiated_by": {
"via": "a2a",
"proposal_id": "prop-7f3a",
"approved_by": "supervisor-12",
"agent_id": "warehouse-ops-agent"
}
}
}
labor-performance's integration topic (its ADR 0013), CONSUMED by this
service — not published: key and subject = the associate id,
source=/warehouse/labor-performance. This service consumes only
com.warehouse.wes.labor-performance.performance.TaskPerformanceRecorded
and ignores every other type. The consumer is the measured-rate cache
(LABOR_PERFORMANCE_MODE=kafka-cache, the laborperformancecache
adapter: a per-process consumer group replays the topic's full history
at startup, then keeps the local mean and idle-share totals current);
this channel mirrors labor-performance's own apis/asyncapi.yaml
read-only.
Keep the local measured-rate cache current for ProposePathPlan.
Subscribe to labor-performance's TaskPerformanceRecorded stream.
Every message updates the running mean of actual_seconds and the
running idle share for its task_type. efficiency_pct is nullable
and unused here (never coerced to 0); idle_seconds_before is
nullable ("not observed"; such a message contributes to the actual
total only). Messages are CloudEvents 1.0 structured-mode JSON
(dataschema
urn:warehouse:labor-performance:events:TaskPerformanceRecorded:v1).
A message that is not a valid CloudEvents 1.0 event is logged at WARN
and skipped; the cache dedupes on id.
Available only on servers:
Accepts the following message:
One completed task was scored against the standard active at completion time.
CONSUMED, not produced. Pinned by labor-performance's
apis/asyncapi.yaml: type
com.warehouse.wes.labor-performance.performance.TaskPerformanceRecorded,
source=/warehouse/labor-performance, subject and Kafka key = the
associate id. efficiency_pct is NULL when the task could not be
scored (a real business fact, never coerced to 0) and
idle_seconds_before is NULL when no idle gap was observed; the
measured-rate cache (laborperformancecache) updates its
per-task_type running mean of actual_seconds and running idle
share from every message.
CloudEvents 1.0 envelope of labor-performance's
TaskPerformanceRecorded, the integration payload, as consumed here
(not composed from CloudEventBase, whose source is this service's
own).
A PICK task scored at 91.2% of standard after a 90s idle gap.
{
"specversion": "1.0",
"id": "7a2d5e91-3f04-4c8b-9e12-8b4a6d1c5f30",
"source": "/warehouse/labor-performance",
"type": "com.warehouse.wes.labor-performance.performance.TaskPerformanceRecorded",
"subject": "assoc-4471",
"time": "2026-09-05T11:00:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:labor-performance:events:TaskPerformanceRecorded:v1",
"data": {
"task_id": "task-10231",
"associate_id": "assoc-4471",
"task_type": "PICK",
"efficiency_pct": 91.2,
"actual_seconds": 41,
"idle_seconds_before": 90,
"completed_at": "2026-09-05T09:30:00Z"
}
}
process-path-management's integration topic (the Topic constant in
internal/adapters/outbound/kafkacatalog/consumer.go), CONSUMED by this
service, not published: key and subject = the path id,
source=/warehouse/process-path-management. This service acts on
ProcessPathCreated, ProcessPathUpdated and ProcessPathDeactivated
and ignores every other type (CPTScheduleChanged included). The
consumer is the process-path catalogue (PATH_CATALOGUE_SOURCE=kafka,
the default; file is rejected at boot): a per-process, unique consumer
group (prefix workforce-management-process-path-catalogue) replays the
topic's full history from the earliest offset at startup, and readiness
waits for that replay. Both cmd/workforce and cmd/mcp run one, so
path ids are validated against the same catalogue. This channel mirrors
process-path-management's own apis/asyncapi.yaml read-only.
Keep the local process-path catalogue current.
Upsert the path definition on Created and Updated (path_id,
match_prefix, required_capabilities,
destination_location_role; direct is decoded and discarded) and
remove it on Deactivated. Messages are CloudEvents 1.0
structured-mode JSON (dataschema
urn:warehouse:process-path-management:events:<EventName>:v1).
Available only on servers:
Accepts one of the following messages:
A process path was defined.
CONSUMED, not produced. Pinned by process-path-management's
apis/asyncapi.yaml: type
com.warehouse.wes.process-path-management.processpath.ProcessPathCreated,
source=/warehouse/process-path-management, subject and Kafka key =
the path id.
CloudEvents 1.0 envelope of process-path-management's ProcessPathCreated, the integration payload, as consumed here.
{
"specversion": "1.0",
"id": "string",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathCreated",
"subject": "string",
"time": "2019-08-24T14:15:22Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:events:ProcessPathCreated:v1",
"data": {
"path_id": "string",
"match_prefix": "string",
"direct": true,
"required_capabilities": [
"string"
],
"destination_location_role": "Drop"
}
}
A process path definition changed.
CONSUMED, not produced. Pinned by process-path-management's
apis/asyncapi.yaml: type
com.warehouse.wes.process-path-management.processpath.ProcessPathUpdated,
source=/warehouse/process-path-management, subject and Kafka key =
the path id.
CloudEvents 1.0 envelope of process-path-management's ProcessPathUpdated, the integration payload, as consumed here.
{
"specversion": "1.0",
"id": "string",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathUpdated",
"subject": "string",
"time": "2019-08-24T14:15:22Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:events:ProcessPathUpdated:v1",
"data": {
"path_id": "string",
"match_prefix": "string",
"direct": true,
"required_capabilities": [
"string"
],
"destination_location_role": "Drop"
}
}
A process path was deactivated; it carries only the path id.
CONSUMED, not produced. Pinned by process-path-management's
apis/asyncapi.yaml: type
com.warehouse.wes.process-path-management.processpath.ProcessPathDeactivated,
source=/warehouse/process-path-management, subject and Kafka key =
the path id.
CloudEvents 1.0 envelope of process-path-management's ProcessPathDeactivated, the integration payload, as consumed here.
{
"specversion": "1.0",
"id": "string",
"source": "/warehouse/process-path-management",
"type": "com.warehouse.wes.process-path-management.processpath.ProcessPathDeactivated",
"subject": "string",
"time": "2019-08-24T14:15:22Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:process-path-management:events:ProcessPathDeactivated:v1",
"data": {
"path_id": "string"
}
}
warehouse-planning's integration topic (its ADR 0023; the
LabourPlanTopic constant in
internal/adapters/inbound/kafka/labour_plan_consumer.go), CONSUMED by
this service, not published: source=/warehouse/warehouse-planning,
key and subject = site_id/shift_id/path_id. This service acts ONLY
on LabourPlanCommitted (ADR 0043) and commits past every other type
on the topic (CapacityPlan*, Shortage/Bottleneck,
WorkloadForecastReceived, LabourPlanDriftDetected). The consumer runs
in cmd/workforce only, on the STABLE, shared consumer group of the
required LABOUR_PLAN_CONSUMER_GROUP (chart default
workforce-management-labour-plans), starting a new group at the
earliest offset; cmd/mcp and cmd/a2a read the copy and never
consume. This channel mirrors warehouse-planning's own
apis/asyncapi.yaml read-only.
Keep the local copy of the published labour plan current.
Upsert labour_requirements (one row per site_id stored as
site_code, shift_id, path_id: planned_heads,
rate_units_per_hour, hours, heads_source, version) only when
the message's version is greater than the stored one; an equal or
lower version is a no-op. The claim on the CloudEvents id and the
upsert commit in one transaction, so a redelivery is a no-op.
installed_stations and the optional shift_start are part of
the contract but not kept. A message that is not a valid CloudEvents 1.0 event or that
breaks the contract (missing site/shift/path or planned_heads,
negative heads, version < 1) is dead-lettered to
warehouse.warehouse-planning.events.dlq and committed past. Read by
POST /paths/{pathId}/plan-proposals (no charge + shiftId) and shown
as requiredHeads on staffing-gap and committed plan lines.
Available only on servers:
Accepts the following message:
The heads the demand requires on one path for a site's shift.
CONSUMED, not produced (ADR 0043). Pinned by warehouse-planning ADR
0023 decision 2: type
com.warehouse.wes.warehouse-planning.labourplan.LabourPlanCommitted,
source=/warehouse/warehouse-planning, subject and Kafka key
site_id/shift_id/path_id, dataschema
urn:warehouse:warehouse-planning:events:LabourPlanCommitted:v1.
version grows by 1 per accepted change of the key.
CloudEvents 1.0 envelope of warehouse-planning's LabourPlanCommitted,
as consumed here (not composed from CloudEventBase, whose source is
this service's own). Snake_case data, pinned by warehouse-planning
ADR 0023 decision 2.
Six heads required on PICK for the WH1 day shift (with shift_start).
{
"specversion": "1.0",
"id": "7f1c2a9e-3b4d-4e5f-8a6b-1c2d3e4f5a6b",
"source": "/warehouse/warehouse-planning",
"type": "com.warehouse.wes.warehouse-planning.labourplan.LabourPlanCommitted",
"subject": "WH1/2026-11-18-day/PICK",
"time": "2026-11-18T05:30:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:warehouse-planning:events:LabourPlanCommitted:v1",
"data": {
"site_id": "WH1",
"shift_id": "2026-11-18-day",
"path_id": "PICK",
"planned_heads": 6,
"rate_units_per_hour": 120,
"hours": 8,
"installed_stations": 10,
"shift_start": "2026-11-18T06:00:00Z",
"heads_source": "forecast",
"version": 2
}
}
Zero heads requested on PACK for the night shift (shift_start absent).
{
"specversion": "1.0",
"id": "0b9d8c7e-6f5a-4b3c-9d2e-1f0a9b8c7d6e",
"source": "/warehouse/warehouse-planning",
"type": "com.warehouse.wes.warehouse-planning.labourplan.LabourPlanCommitted",
"subject": "WH1/2026-11-18-night/PACK",
"time": "2026-11-18T17:30:00Z",
"datacontenttype": "application/json",
"dataschema": "urn:warehouse:warehouse-planning:events:LabourPlanCommitted:v1",
"data": {
"site_id": "WH1",
"shift_id": "2026-11-18-night",
"path_id": "PACK",
"planned_heads": 0,
"rate_units_per_hour": 45.5,
"hours": 7.5,
"installed_stations": 4,
"heads_source": "request",
"version": 1
}
}
A human committed a headcount split across process paths for a site's shift.
Raised by the ShiftPlan aggregate when a human commits the split of
headcount across process paths for one site's shift. The commit
is validated in the domain: plannedHeads(path) must not exceed
installedStations(path), and planned hours must fit the shift's max
hours.
Published to warehouse.workforce.events. This is the only
domain event on the integration topic; wes-work-planning dispatches on
its exact type. The adapter loads the committed
plan through the ShiftPlanRepo and fans the single domain event
out into one Kafka message per PathPlan line — a plan committed
with three path lines produces three messages on
warehouse.workforce.events, each carrying that one line's
path_id, planned_heads, planned_rate and planned_hours
alongside the plan's site_code (canonical) and building_id
(deprecated, same value) and shift_id. Consumers must
therefore expect N messages per commit, not one, and must not assume
a message carries the whole plan. Every line message has its own
unique CloudEvents id (minted once and persisted with the outbox
row, so a redelivery repeats it); subject is the ShiftPlan aggregate
id <buildingId>/<shiftId>, identical to the Kafka key.
CloudEvent for one PathPlan line of a committed
ShiftPlan. The data fields mirror exactly what the Kafka
publisher emits per line.
The analytics-topic form of a shift-plan commit — one message per commit, not per line.
Published only to warehouse.workforce.analytics. Same type as the
integration message, different dataschema and payload: one message
per commit carrying just the plan's identity. Kafka key is the
building id; subject is the ShiftPlan aggregate id
<buildingId>/<shiftId>.
CloudEvent for one shift-plan commit on the analytics topic.
Heads for a path were computed from charge and planned rate, ahead of any human commit.
Raised by the ShiftPlan aggregate when heads for a path are
proposed as a pure computation — heads = ceil(charge / plannedRate)
— before a human commits anything. A proposal is advisory: the
software proposes, a human commits.
Not on the integration topic. Published only to the internal
analytics topic warehouse.workforce.analytics (dataschema
urn:warehouse:workforce-management:analytics:<EventName>:v1).
CloudEvent for a proposed, not-yet-committed headcount figure for one path.
A path's active assignments fall short of its committed planned heads.
Raised when the staffing-gap read model finds that a path's active
LaborAssignment count is below the plannedHeads committed for it
on the current ShiftPlan. This is a flag, not a decision: this
bounded context surfaces the gap and never moves anyone in response.
Rebalancing is a human call, recorded back here as a new assignment.
Site scope (ADR 0034, additive). When the gap was requested for
one canonical site, data.site_code carries it and active_heads
counts only associates with an active shift at that site. When
site_code is absent the gap is unscoped (every site together,
the pre-ADR-0034 behaviour): consumers MUST treat absence as
"unscoped", never as a particular site.
Not on the integration topic. Published only to the internal
analytics topic warehouse.workforce.analytics (dataschema
urn:warehouse:workforce-management:analytics:<EventName>:v1).
CloudEvent for the staffing-gap flag on a single path.
An associate's roster entry was created for the shift, with their certifications.
Raised by the AssociateShift aggregate when an associate's shift
roster entry is created. The associate's certifications are the
qualification gate for assignment: an associate untrained on a path
cannot be placed on it.
Not on the integration topic. Published only to the internal
analytics topic warehouse.workforce.analytics (dataschema
urn:warehouse:workforce-management:analytics:<EventName>:v1).
CloudEvent for the creation of an associate's shift roster entry.
A certification was added to an associate's roster entry.
Raised by the AssociateShift aggregate when a named qualification
(for example pack, pick or hazmat) is added to an associate.
Certifications gate assignment: AssignLabor rejects an associate
who does not hold the path's required certification.
Not on the integration topic. Published only to the internal
analytics topic warehouse.workforce.analytics (dataschema
urn:warehouse:workforce-management:analytics:<EventName>:v1).
CloudEvent for adding one certification to an associate.
An associate began a logged break and is no longer assignable.
Raised by the AssociateShift aggregate when an associate begins a
logged break. While a break is active the associate cannot be given a
new LaborAssignment — AssignLabor rejects the attempt.
Not on the integration topic. Published only to the internal
analytics topic warehouse.workforce.analytics (dataschema
urn:warehouse:workforce-management:analytics:<EventName>:v1).
CloudEvent for the start of an associate's logged break.
An associate ended a logged break and is assignable again.
Raised by the AssociateShift aggregate when an associate's logged
break ends. The associate becomes eligible for a new
LaborAssignment again, subject to the certification gate.
Not on the integration topic. Published only to the internal
analytics topic warehouse.workforce.analytics (dataschema
urn:warehouse:workforce-management:analytics:<EventName>:v1).
CloudEvent for the end of an associate's logged break.
An associate's shift closed, ending all of their active assignments.
Raised by the AssociateShift aggregate when an associate's shift
closes. Closing a shift ends every active LaborAssignment for that
associate, so downstream consumers should treat this as a terminal
signal for the associate's labor picture on the shift.
Not on the integration topic. Published only to the internal
analytics topic warehouse.workforce.analytics (dataschema
urn:warehouse:workforce-management:analytics:<EventName>:v1).
CloudEvent for the close of an associate's shift.
An associate was placed on a process path for an interval.
Raised by the LaborAssignment aggregate when an associate is
assigned to a process path. The domain enforces two hard invariants
before this event exists: the associate holds the path's required
certification, and the associate has no other ACTIVE assignment (no
double-booking across paths).
Note the path boundary: this places an associate on a path, never on a specific task. Dispatching individual tasks belongs to Fulfillment Execution.
Attribution (additive). When the assignment was requested through
the MCP assign_labor tool or the A2A assign_labor skill, data
also carries initiated_by (via = mcp or a2a, set by the
adapter, plus the caller's optional proposal_id, approved_by and
agent_id). It is absent for REST and every other caller: absence
means "not agent-initiated". It is event data only; no CloudEvents
extension attribute is added, and the v1 dataschema is unchanged.
Not on the integration topic. Published only to the internal
analytics topic warehouse.workforce.analytics (dataschema
urn:warehouse:workforce-management:analytics:<EventName>:v1).
CloudEvent for placing an associate on a process path.
An associate's active assignment was ended in favour of another path.
Raised by the LaborAssignment aggregate when an associate's prior
active assignment is closed and a new one opened on a different path
— the intra-shift move that keeps the one-ACTIVE-assignment invariant
intact. The move is always a human call recorded here; this context
never decides a rebalance on its own.
Attribution (additive). Like LaborAssigned, data carries
initiated_by when the move was requested through the MCP or A2A
assign_labor surface, and omits it otherwise (REST). An agent
reallocating an associate who is already on a path raises this event,
not LaborAssigned, so the attribution must be here too.
Not on the integration topic. Published only to the internal
analytics topic warehouse.workforce.analytics (dataschema
urn:warehouse:workforce-management:analytics:<EventName>:v1).
CloudEvent for moving an associate from one path to another.
One completed task was scored against the standard active at completion time.
CONSUMED, not produced. Pinned by labor-performance's
apis/asyncapi.yaml: type
com.warehouse.wes.labor-performance.performance.TaskPerformanceRecorded,
source=/warehouse/labor-performance, subject and Kafka key = the
associate id. efficiency_pct is NULL when the task could not be
scored (a real business fact, never coerced to 0) and
idle_seconds_before is NULL when no idle gap was observed; the
measured-rate cache (laborperformancecache) updates its
per-task_type running mean of actual_seconds and running idle
share from every message.
CloudEvents 1.0 envelope of labor-performance's
TaskPerformanceRecorded, the integration payload, as consumed here
(not composed from CloudEventBase, whose source is this service's
own).
A process path was defined.
CONSUMED, not produced. Pinned by process-path-management's
apis/asyncapi.yaml: type
com.warehouse.wes.process-path-management.processpath.ProcessPathCreated,
source=/warehouse/process-path-management, subject and Kafka key =
the path id.
CloudEvents 1.0 envelope of process-path-management's ProcessPathCreated, the integration payload, as consumed here.
A process path definition changed.
CONSUMED, not produced. Pinned by process-path-management's
apis/asyncapi.yaml: type
com.warehouse.wes.process-path-management.processpath.ProcessPathUpdated,
source=/warehouse/process-path-management, subject and Kafka key =
the path id.
CloudEvents 1.0 envelope of process-path-management's ProcessPathUpdated, the integration payload, as consumed here.
A process path was deactivated; it carries only the path id.
CONSUMED, not produced. Pinned by process-path-management's
apis/asyncapi.yaml: type
com.warehouse.wes.process-path-management.processpath.ProcessPathDeactivated,
source=/warehouse/process-path-management, subject and Kafka key =
the path id.
CloudEvents 1.0 envelope of process-path-management's ProcessPathDeactivated, the integration payload, as consumed here.
The heads the demand requires on one path for a site's shift.
CONSUMED, not produced (ADR 0043). Pinned by warehouse-planning ADR
0023 decision 2: type
com.warehouse.wes.warehouse-planning.labourplan.LabourPlanCommitted,
source=/warehouse/warehouse-planning, subject and Kafka key
site_id/shift_id/path_id, dataschema
urn:warehouse:warehouse-planning:events:LabourPlanCommitted:v1.
version grows by 1 per accepted change of the key.
CloudEvents 1.0 envelope of warehouse-planning's LabourPlanCommitted,
as consumed here (not composed from CloudEventBase, whose source is
this service's own). Snake_case data, pinned by warehouse-planning
ADR 0023 decision 2.
The CloudEvents 1.0 structured-mode context attributes shared by
every message (ADR-0026). Every attribute is REQUIRED. Each event
schema below composes this base with an allOf and pins its own
type const and dataschema const.
CloudEvent for one PathPlan line of a committed
ShiftPlan. The data fields mirror exactly what the Kafka
publisher emits per line.
CloudEvent for one shift-plan commit on the analytics topic.
CloudEvent for a proposed, not-yet-committed headcount figure for one path.
CloudEvent for the staffing-gap flag on a single path.
CloudEvent for the creation of an associate's shift roster entry.
CloudEvent for adding one certification to an associate.
CloudEvent for the start of an associate's logged break.
CloudEvent for the end of an associate's logged break.
CloudEvent for the close of an associate's shift.
Attribution of an agent-initiated assignment (additive, event data
only). Present on LaborAssigned / LaborReassigned only when the
call arrived through the MCP assign_labor tool or the A2A
assign_labor skill; absent for REST. via is stamped by the
adapter, never supplied by the caller. The other members are the
caller's optional free-form labels (trimmed, at most 128
characters); they carry no authority and are omitted when not given.
CloudEvent for placing an associate on a process path.
CloudEvent for moving an associate from one path to another.
CloudEvents 1.0 envelope of labor-performance's
TaskPerformanceRecorded, the integration payload, as consumed here
(not composed from CloudEventBase, whose source is this service's
own).
CloudEvents 1.0 envelope of process-path-management's ProcessPathCreated, the integration payload, as consumed here.
CloudEvents 1.0 envelope of process-path-management's ProcessPathUpdated, the integration payload, as consumed here.
CloudEvents 1.0 envelope of process-path-management's ProcessPathDeactivated, the integration payload, as consumed here.
CloudEvents 1.0 envelope of warehouse-planning's LabourPlanCommitted,
as consumed here (not composed from CloudEventBase, whose source is
this service's own). Snake_case data, pinned by warehouse-planning
ADR 0023 decision 2.