Skip to main content
The JDM Editor is an open-source React component that provides a full-featured visual editor for creating and editing decision models. Embed it in your application to give users the ability to build rules without leaving your product.

GitHub Repository

View source, report issues, and contribute

Installation

Quick start

The DecisionGraph component requires a JdmConfigProvider wrapper:

Loading WASM for code extensions

The editor uses WebAssembly for syntax highlighting, autocomplete, and expression validation. Load the WASM module at application startup using top-level await:
WASM requires these headers on your server for SharedArrayBuffer support:

Features

The decision graph canvas lets you drag and drop nodes onto the canvas, connect nodes to define data flow, pan and zoom to navigate large graphs, and select and delete nodes. The spreadsheet-like decision table editor supports adding input and output columns, defining conditions with unary operators, reordering rows by drag and drop, and hit policy configuration (first, collect). The expression editor provides syntax highlighting for ZEN expressions, autocomplete for functions and fields, inline validation and error messages, and field path suggestions from input schema. The JavaScript function editor includes Monaco editor with syntax highlighting, TypeScript type checking, built-in library support (dayjs, big.js, zod), and async/await support.

Configuration

Read-only mode

Display decisions without allowing edits:

Simulator integration

Add a simulator panel to test decisions directly in the editor. You can evaluate rules via your backend API or entirely in the browser using WASM.
Call your backend to evaluate the decision:

Standalone components

Use individual editor components outside of the decision graph for custom integrations.

Code editor

The CodeEditor component provides standalone expression editing with syntax highlighting and validation:

Editor types

Type hints

Pass variableType and expectedVariableType to enable type checking and improved autocomplete. Types use the VariableTypeJson format:
Available type variants:

Decision table

The DecisionTable component renders a standalone spreadsheet-style table editor:

Schema-driven autocomplete

Pass inputsSchema and outputsSchema to provide field suggestions in the expression editor:

Permission levels

Control editing capabilities with the permission prop:

Schema validation

Validate JDM files before loading them into the editor using the exported Zod schema:

TypeScript support

The editor is fully typed. Import types for your integration:

Extracting JDM output

The editor produces JDM (JSON Decision Model) format that the ZEN Engine can execute:

Standalone editor

For non-React applications, use the Standalone Editor — a self-hosted Docker image with the full visual editor.