activity-core/schemas/event-envelope.json

58 lines
1.6 KiB
JSON
Raw Normal View History

{
"description": "Standard internal event envelope. Every event, whether time-fired or\nbroker-delivered, is normalised into this shape before processing.",
"properties": {
"event_id": {
"description": "Stable unique ID. Used for deduplication: if an event with this ID has already been processed, the router skips it.",
"title": "Event Id",
"type": "string"
},
"type": {
"description": "Dot-namespaced event type, e.g. 'user.created'.",
"title": "Type",
"type": "string"
},
"source": {
"description": "Originating service or component, e.g. 'user-service'.",
"title": "Source",
"type": "string"
},
"occurred_at": {
"description": "When the event occurred (UTC).",
"format": "date-time",
"title": "Occurred At",
"type": "string"
},
"subject": {
"description": "Primary resource affected, e.g. 'user/123'.",
"title": "Subject",
"type": "string"
},
"trace_id": {
"description": "Distributed tracing correlation ID.",
"title": "Trace Id",
"type": "string"
},
"schema_version": {
"default": "1.0",
"description": "Schema version string for forward-compatibility.",
"title": "Schema Version",
"type": "string"
},
"payload": {
"additionalProperties": true,
"description": "Event-specific data; structure varies by event type.",
"title": "Payload",
"type": "object"
}
},
"required": [
"event_id",
"type",
"source",
"occurred_at",
"subject",
"trace_id"
],
"title": "EventEnvelope",
"type": "object"
}