DSLOperationsemit_each

op: emit_each

Emit one event per element in a collection.

Allowed phases

PhaseStatus
preflight✗ forbidden
core✓ allowed
side_effects✓ allowed

Syntax

- op: emit_each
  from: "entity.cart.items"
  event_type: INVENTORY_RESERVE_REQUESTED
  target_stream: inventory_stream
  target_entity: "item.product_id"
  payload:
    order_id:   event.order_id
    product_id: "item.product_id"
    quantity:   "item.quantity"

Parameters

FieldRequiredDescription
fromyesExpression evaluating to an array
event_typeyesEvent type per item
payloadyesPayload map; use item for the current element
target_streamnoStream for each emitted event
target_entitynoPer-item entity ID expression

Behavior

  • Iterator variable is item (not it). Each emit is validated against the event schema.

emit · for_each

See also