op: emit
Emit a domain event to the ledger and projection pipeline.
Allowed phases
| Phase | Status |
|---|---|
preflight | ✗ forbidden |
core | ✓ allowed |
side_effects | ✓ allowed |
Syntax
- op: emit
event_type: SHOW_CHECK_IN_CREATED
payload:
user_id: event.user_id
show_id: event.show_id
venue_id: event.venue_idParameters
| Field | Required | Description |
|---|---|---|
event_type | yes | Declared event type under events: |
payload | yes | Key-value map; values are literals or expressions |
target_stream | no | Emit on a different stream |
target_entity | no | Target entity ID expression |
Behavior
- In core, the emit participates in the same ledger commit as state mutations.
- In side_effects, the emit runs after commit — failures do not roll back core.
- Never declare payload fields named
type,ts, orentity_id— they are reserved on the envelope.
Related operations
See also
- Operations index — all ops by phase
- actions — rule structure and phases
- Intents: Rules — narrative examples