Skip to content
{% policy %}
AutoXXS (320px)XS (375px)SM (640px)MD (768px)LG (1024px)XL (1280px)XXL (1536px)
SketchMaterialiOSTamagui
DataInjectionKeyPatternsServiceTransactionProcessResearchProductQualityPerformanceSpecDomainFunctionTechnologyArchitectureConfigMiddlewareDataDatabaseDrizzleMigrationModelop-sqliteSchemaSQLState ManagementDraftKeystoneMergePatchPatchesPersistenceReactiveRedoStoreUndoTestingDeviceFactoryIsolationTypeScriptZodTopicsCommunicationBidsNVCDesignDesign ImplicationsEducationPedagogyFoundationsPsychologyAttachmentFloodingRelatingAuthentic RelatingUIEditorReact Native

{% 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
tagpolicyactionevent policy-tag-reactive
{% policy source="add-bookmark" outcome="success" reaction="bookmark-added" %}
Every successful save must emit a notification event.
{% /policy %}