Event model
This page defines ION’s event vocabulary: the authoritative event and command naming convention, the published CloudEvents envelope, the stored event and stream specification, and schema versioning.
Event and command naming convention
Every published event and command uses one dotted type string. This is the
authoritative wire convention for the ION platform and is governed by
ADR-0005.
<platform>.<type>.<aggregateroot>.<name>.<version>
| Segment | Rule |
|---|---|
platform | ion for ION-produced messages. Only externally sourced facts (for example from Sentinel) carry a different platform. |
type | event or command. Prefix with domain — domainevent or domaincommand — for internal/private messages that stay inside one bounded context. Few new-store events are private; many escalation and response-action messages are. |
aggregateroot | The aggregate the message belongs to: securityincident, securityticket, investigation, etc. Drop the ion prefix — the platform segment already carries it. |
name | Events: [subject]<pasttenseverb>. Commands: <verb>[subject]. subject is optional and is usually a field; when omitted, the message is for the aggregate root itself. |
version | v<#> major version only. Bump only on a breaking change, following the Schema Evolution pattern. |
Authoritative examples:
Wire type | Meaning |
|---|---|
ion.command.securityincident.upsert.v1 | Command to upsert a security incident aggregate. |
ion.command.securityincident.updatestatus.v1 | Command to update the incident status field. |
ion.event.securityincident.updated.v1 | The incident aggregate was updated. |
ion.event.securityincident.statusupdated.v1 | The incident status field was updated. |
Payload style is independent of the type string
The type string names what happened. How much state the payload carries is a
separate design choice that does not change the type string:
| Payload style | Carries | Trade-off |
|---|---|---|
| Notification | Identifiers only | Low coupling; consumers call back for detail. |
| Fact (ECST) | Accepted state at the time of the event | Consumers avoid callbacks; higher data coupling. |
| Delta | Old-vs-new difference | Consumers see exactly what changed. |
Event-carried state transfer (the fact style) is the default for cross-context
integration events so consumers avoid callbacks; see
ADR-0004. Messages
that stay inside one bounded context use the domainevent / domaincommand type
prefix regardless of payload style.
CloudEvents envelope
Published events use CloudEvents 1.0 JSON. AsyncAPI describes channels, operations, and payload schemas.
{
"specversion": "1.0",
"id": "3ba0a70e-9523-4fb0-83e7-43f54d72915b",
"type": "ion.event.securityincident.ownerassigned.v1",
"source": "urn:io:ontinue:ion:watchtower",
"subject": "a7c3f2e1-incident-id",
"tenantId": "8f1d9b24-customer-tenant-id",
"time": "2026-09-28T12:04:31Z",
"datacontenttype": "application/json",
"correlationid": "d226a3be-04fb-426c-929a-673e02c2013a",
"causationid": "a1f0...",
"traceparent": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"data": {}
}
| Field | Meaning |
|---|---|
id | Globally unique event identity (UUID, or an external id such as a Sentinel incident or device id). source + id is unique per event and used for consumer deduplication. |
type | The dotted <platform>.<type>.<aggregateroot>.<name>.<version> name; a breaking change creates a new major version. |
source | Producing microservice in URN format, e.g. urn:io:ontinue:ion:watchtower. |
subject | Resource identity — the aggregate id (for example the incident id). |
tenantId | Extension attribute carrying the customer tenant id the payload belongs to. |
time | Business occurrence time supplied by the application — not a store timestamp. |
correlationid | End-to-end business-operation identity. |
causationid | The event or command that directly caused this one. |
traceparent | W3C trace context for operational tracing. |
data | Versioned JSON payload carrying the state consumers require. |
Stored event specification
Each persisted event document carries the fact plus the metadata that enforces ordering, concurrency, deduplication, and tenant scope.
| Attribute | Type | Purpose |
|---|---|---|
Id | GUID | Unique over the store; used for append deduplication. |
EventType | string | Business fact name, e.g. securityincident.statusupdated (the aggregateroot.name portion of the dotted type). |
Version | string | Major schema version, e.g. v1. |
Revision / Sequence | number | Position in the stream; drives optimistic concurrency. Strictly increasing per stream. |
Timestamp | timestamp | Store-recorded time — never used for application logic. |
CorrelationId | GUID | Supplied by the application; enables “all events in this operation” queries. |
CausationId | GUID | Supplied by the application; enables “all events caused by X” queries. |
CustomerId | GUID | Ontinue customer identity. |
CustomerShort | string | Short customer identifier. |
Data | JSON | Event payload. |
Stream specification
| Attribute | Type | Purpose |
|---|---|---|
Id | GUID | Uniquely identifies a stream instance (one aggregate). |
Category | string | Entity type in the store, e.g. IonSecurityIncident. |
Schema | string | Stream schema, analogous to a relational table schema. |
Metadata.System | object | System controls — TimeToLive (max event age) and MaxCount (max events in the stream). |
Metadata.Application | dictionary | Application-defined stream metadata. |
Payload design
- Describe what happened in domain language — prefer
owner assigned,incident scoped,ticket closedover a genericentity updated. - Carry enough accepted state for the intended consumers so normal handling needs no callback, but do not copy an entire mutable aggregate by default.
- Include tenant and external-version identities needed for authorization, idempotency, and reconciliation.
- Put large binary content in Blob storage and carry an authorized reference.
- Exclude secrets; minimize and classify personal data per the data-protection rules.
- Represent corrections and synchronization outcomes as new facts — never rewrite a committed payload.
Versioning and schema evolution
- AsyncAPI and JSON Schema are versioned together with producer code.
- Additive optional fields are the default compatible change.
- A breaking change creates a new major event type and a consumer migration path; the old type keeps a reader for retained history.
- Replayers keep a reader or upcaster for every schema present in hot or cold retention. Introducing TTL does not relax this — archive readers must exist before a hot event is removed.
- Contract tests verify producer output and consumer handling against the declared schema.
Broker binding
Azure Service Bus carries internal ION events. Native fields are populated from CloudEvents rather than replacing the envelope:
MessageIdcomes from eventid;- correlation metadata comes from
correlationid; - routing, partition, and session metadata derive from the tenant-scoped
subject; - each subscriber owns its retry, dead-letter, checkpoint, and idempotency behavior.
Per ADR-0008, commands use queues and sessions where per-aggregate FIFO is required; domain-event fan-out uses topics and per-consumer subscriptions.