{% policy %}
Attributes
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | β | Unique kebab-case policy id (e.g., 'rate-limit') |
source | string | β | Bare name of the action or event that triggers this policy (e.g., 'add-bookmark') |
reaction | string | β | Bare name of the action triggered as a result (e.g., 'bookmark-added') |
outcome | string | β | Optional path outcome that must match for the policy to fire (e.g., 'success') |
Valid Parent Contexts
This tag is valid inside: {% domain %}
Defines reactive business logic: βWhen [Source] happens [on Outcome], then perform [Reaction]β. Policies bridge domains by chaining actions and events together.
Flow diagram integration
When a flow stepβs action and a path outcome match a policyβs source and outcome, the compiler automatically appends an implicit system step to the Mermaid diagram showing the reaction action name. This makes event-driven reactive behaviour visible directly on the flow chart without requiring authors to document it manually.
Reactive business rule triggered by action/event pair
{% policy source="add-bookmark" outcome="success" reaction="bookmark-added" %}Every successful save must emit a notification event.{% /policy %}