Install the SDK
Add the GoRules engine to your project using npm, yarn, or pnpm.
npm install @gorules/zen-engineLoad a Decision
Create an engine instance and load your decision graph from a JSON file.
import { ZenEngine } from '@gorules/zen-engine';
import fs from 'fs/promises';
const engine = new ZenEngine();
const content = await fs.readFile('./decision.json');
const decision = engine.createDecision(content);Evaluate Rules
Pass your input data and get the decision result in milliseconds.
const result = await decision.evaluate({
customer: { tier: 'premium', country: 'US' },
cart: { total: 150, items: 3 }
});
console.log(result.result); // { discount: 15, freeShipping: true }Why Node.js?
Built for performance and developer experience
Rust-Powered Performance
Native bindings to our Rust engine deliver near-native speed. Process thousands of rules in milliseconds.
Full Async Support
Built for modern Node.js with full async/await support. Non-blocking evaluation for high-throughput applications.
Zero Dependencies
Minimal footprint with no external runtime dependencies. Just install and start evaluating rules.
About the Node.js SDK
GoRules provides a high-performance business rules engine for JavaScript applications. Built with a Rust core and native Node.js bindings, it delivers exceptional speed without sacrificing the developer experience JavaScript developers expect.
The engine supports decision tables, expression evaluation, and complex rule graphs - all manageable through a visual editor or programmatically via the SDK. Whether you're building pricing engines, eligibility checkers, or approval workflows, GoRules handles the complexity while keeping your code clean.
Unlike traditional rule engines that require a separate server, GoRules embeds directly into your Node.js application. This means zero network latency for rule evaluation, offline capability, and no per-evaluation fees. The same decision graphs created in the GoRules editor work seamlessly in your JavaScript runtime.