<event>

<event> subscribes a workflow to an exact event name published internally or through an authenticated public endpoint.

Why use it

Use it to decouple publishers from workflow consumers and fan one fact out to every loaded subscriber.

Common use cases

  • React to a domain event emitted by another workflow.
  • Expose authenticated event publication to an application.
  • Validate event data independently for each subscriber.

Syntax

WOML
<event
  id="orderCreated"
  name="order.created"
  secret="{{secrets.EVENT_CONTROL_TOKEN}}"
>
  <schema>{ "type": "object", "required": ["orderId"] }</schema>
</event>

Rules and behavior

  • id and name are required.
  • The name has at least two lowercase segments separated by dot, underscore, or hyphen and is at most 256 characters.
  • The optional secret opens authenticated POST /_woml/events/{eventName}; without it, publication remains internal.
  • Public publication requires a bearer token and Event-ID.
  • One publication fans out to every exact-name subscriber, and each subscriber validates and admits independently.