Prerequisites
- A LexQ account (sign up free)
- An API key (created in Console → Management → API Keys)
Step 1: Create a Policy Group
Open the Console
Navigate to console.lexq.io and sign in.
Create a Group
Go to Policy Groups → Create Group.
- Name:
discount-policy - Priority:
0 - Execution Mode: Allow All (
NONE)
Step 2: Define a Rule
payment_amount and user_id are system facts — pre-registered and ready to use. Need custom variables like customer_tier? See Fact Definitions.Step 3: Test with Dry Run
Before deploying, validate your rule with a dry run:discount_amount: 15000 in the outputVariables.
Step 4: Publish and Deploy
Publish
Click Publish Version. The version transitions from DRAFT to ACTIVE and is now locked — no further edits allowed.
Step 5: Execute via API
Call the execution endpoint from your application:What’s Next?
Fact Definitions
Add custom variables like
customer_tier or order_region.Batch Simulation
Test policies against bulk data before deploying.
Policy Execution
Learn about all 4 execution modes (single, version, batch, composite).
CLI & MCP
Manage policies from the terminal or via AI agents.

