Skip to main content

What is a Domain Template?

A Domain Template is a curated bundle of fact definitions and sample rules tailored to a specific industry. Applying a template creates:
  • A pre-defined set of facts (e.g., purchase_subtotal_usd, loyalty_tier) registered for your tenant.
  • A new policy group with sample rules, ready to publish or customize.
  • An entry in your group list — same as if you had built it manually.
Use templates to skip the blank-page problem when starting a new policy domain.
Templates are opt-in. They only run when you click Apply in the Console or call the apply endpoint. Your existing facts and policy groups are never modified.

Available Templates

E-Commerce

Loyalty tier discounts, first-purchase bonus, free shipping for high-LTV customers, and promo code handling for online retail.8 facts · 5 sample rules
More templates (Fintech, SaaS) are coming soon.

E-Commerce Template

Facts (8)

KeyTypeRequiredDescription
purchase_subtotal_usdNUMBERCart subtotal before discounts, in USD
purchase_currencySTRINGISO 4217 currency code (e.g., USD, EUR, KRW)
cart_category_tagsLIST_STRINGCategory tags of items in the cart
customer_ltv_usdNUMBERCustomer lifetime value, in USD
loyalty_tierSTRINGPLATINUM / GOLD / SILVER / BRONZE / NONE
applied_promo_codeSTRINGPromotion code entered at checkout
is_first_purchaseBOOLEANWhether this is the customer’s first purchase
loyalty_credit_usdNUMBERRedeemable store credit balance, in USD

Sample Rules (5)

PriorityNameTriggerEffect
1Platinum Tier — 20% Offloyalty_tier=PLATINUM and subtotal ≥ USD 10020% off subtotal (mutex: vip_discount)
2Gold Tier — 15% Offloyalty_tier=GOLD and subtotal ≥ USD 10015% off subtotal (mutex: vip_discount)
3Silver Tier — 10% Offloyalty_tier=SILVER and subtotal ≥ USD 10010% off subtotal (mutex: vip_discount)
4First-Purchase Bonusis_first_purchase=trueUSD 10 off subtotal
5High-LTV Free Shippingcustomer_ltv_usd ≥ 1000Add tag free_shipping
The three tier discount rules share a mutex group (vip_discount) with EXCLUSIVE / HIGHEST_PRIORITY — only the highest-priority matching rule fires. First-purchase bonus and free shipping run independently.

Applying a Template

  1. Go to Settings → Domain Templates.
  2. Click Preview on a template card to inspect the facts and rules before committing.
  3. Click Apply to create the policy group.
  4. Optionally provide a custom group name. If left blank, a default name is generated (with a date suffix if the name already exists).
After apply, you’re navigated to the new policy group where you can edit rules, set effective dates, and publish.

What Happens on Apply

ResourceBehavior
FactsCreated only if missing. Existing facts with the same key are kept as-is (your edits are preserved).
Policy GroupNew group, status=ACTIVE.
Policy VersionNew version, status=DRAFT. Edit rules before publishing.
RulesAll 5 sample rules created.
Application historyRecorded for audit.
The entire operation is transactional — if any step fails, nothing is created.
The created policy version starts as DRAFT. To make it live, publish it from the policy group page or via the deployment API.

Customizing After Apply

Templates are starting points. After applying, you can freely:
  • Edit any rule (condition, action, priority, mutex).
  • Add or remove rules in the version.
  • Delete facts you don’t need (they’re regular custom facts, not protected).
  • Rename the policy group.
  • Adjust the version’s effective dates before publishing.

FAQ

Can I apply the same template twice? Yes. Each apply creates a new policy group. Existing facts are reused (not duplicated). If the default group name is taken, a date suffix is appended automatically. Can I delete a template’s facts later? Yes. Template-applied facts are regular tenant facts — no special protection. Be aware that deleting a fact in use will cause rules referencing it to evaluate that condition as false. Can I roll back an apply? Not as a single operation. To undo, archive the policy group manually (or delete the version) and delete the facts you don’t need. The application history record remains for audit.

Next Steps

Policy Groups

Learn how policy groups and versions work.

Fact Definitions

Understand the fact model in depth.