What is the Rules Step?
The Rules step evaluates business logic using a declarative rule engine. Instead of writing code, you define facts (your data) and rules (how to process it), and the engine automatically calculates outcomes.Think of it as...
A spreadsheet formula system on steroids - where you define rules once and they automatically evaluate based on your data, handling complex logic like nested conditions, array processing, and dynamic calculations.
When to Use the Rules Step
Pricing & Discounts
Calculate dynamic pricing, volume discounts, promotional offers
Eligibility Checks
Determine qualifications, access levels, approval workflows
Data Validation
Enforce business constraints, validate forms, check data quality
Conditional Routing
Route tickets, prioritize tasks, assign based on criteria
How It Works
The Rules step takes two inputs:1
Facts
A flat JSON object containing your data. Keys are what you reference with
@fact:, values are either static data or variable mapping expressions like "$.previous_step.property"2
Rules
A JSON object defining the logic - what to calculate or decide based on the facts
3
Outcomes
The Rules step evaluates all rules and returns a flat object with outcomes for each rule
Quick Example
Here’s a simple rule that calculates if an order qualifies for free shipping: Facts (Input Data):Key Capabilities
Mathematical Operations
Mathematical Operations
Perform calculations with add, subtract, multiply, divide, round, and advanced math functions
Conditional Logic
Conditional Logic
Build complex if-then-else logic with comparison operators and boolean operations
String Manipulation
String Manipulation
Concatenate, format, search, and transform text data
Array Processing
Array Processing
Filter, sort, sum, and transform arrays of data with wildcard support
Date Operations
Date Operations
Calculate date differences, add/subtract time periods, format dates
Lookups & Mapping
Lookups & Mapping
Map values, perform lookups, create dynamic option lists
Dynamic Visibility
Dynamic Visibility
Control form field visibility based on other values
Validation Rules
Validation Rules
Enforce business constraints and data quality requirements
Real-World Example: E-commerce Pricing
Here’s how an online store uses Rules to calculate dynamic pricing with discounts:This example calculates cart total using
jPath to extract prices from the array, applies the better of tier discount or volume discount, and computes the final price. Notice how rules reference each other using @fact:ruleName.property - the .value suffix is just part of the unique rule name. Learn more about variable mapping to see how to pull data from previous steps.Rule Formats
Rules can be written in two formats:Simple Format
Direct calculation without conditions:Conditional Format
Array of condition/outcome pairs, evaluated top to bottom:Common Use Cases
E-commerce
Dynamic pricing, shipping calculations, inventory checks, promotional eligibility
CRM & Sales
Lead scoring, qualification criteria, territory assignment, commission calculations
Customer Support
Ticket routing, priority scoring, SLA calculations, escalation rules
Marketing
Campaign eligibility, audience segmentation, A/B test assignment, personalization rules
Financial Services
Transaction validation, risk scoring, approval workflows, fee calculations
Healthcare
Patient eligibility, risk assessment, appointment scheduling, treatment pathways
What’s Next?
Getting Started
Build your first rule in 5 minutes with a step-by-step tutorial
Core Concepts
Deep dive into facts, rules, operators, and how data flows through the system
Operations Reference
Complete list of all available operators organized by category
Rule Patterns
Common patterns and best practices with copy-paste examples
Examples Library
Real-world use cases with complete facts and rules
Technical Reference
Input/output schemas and advanced technical details
Quick Tips
Need Help? Visit our Help Center or join the Community for support.