How to build decisions
What this feature does
The Decision Editor is a drag-and-drop interface for defining business rules and logic. You connect rule nodes (Decision Table, Expression, Function, Switch) to evaluate input data and return an outcome. Decisions separate business logic from code, allowing rules to be updated independently.
Scope: This guide covers creating a decision, configuring inputs, and adding rule nodes. It does not cover testing (refer to How to test decisions) or publishing (refer to How to publish and release).
Who this applies to
- Audience: Developers building business rule automations in Opus
- Access required: Editor or Administrator role on a project
- Assumed knowledge: You have an Opus workspace and project. Refer to Get started with Opus for initial setup.
Steps
Step 1: Create a decision
From a template:
- Select Start from Template from the project view.
- Browse templates tagged with Decision.
- Select Use Template to create the decision with a pre-configured blueprint.
From scratch:
- From the project view, select Add New File.
- Select Decision as the artifact type.
- Enter a descriptive name (e.g., “Loan Eligibility Check”, “Credit Scoring”).
- Select Add, then open the new decision.
Step 2: Configure the decision input
The input defines the data structure the decision evaluates.
- Select the input node on the canvas.
- Define the input schema — the fields and data types the decision expects (e.g.,
applicantAge,requestedAmount).
Step 3: Add and configure rule nodes
Drag rule nodes from the palette onto the canvas and connect them.
| Node type | When to use |
|---|---|
| Decision Table | Rule-based tables with multiple conditions and outcomes |
| Expression | Rule-based expressions and conditions |
| Function | Custom JavaScript logic |
| Switch | Conditional branching based on input values |
| Decision | Reuse an existing decision entity from the same project |
- Drag a rule node onto the canvas.
- Connect it to the input node (or a preceding rule node).
- Configure the node’s rules, conditions, or logic in the settings panel.
- Repeat for each rule in your decision.
For detailed configuration of each node type, refer to Node reference.
Step 4: Configure advanced settings (optional)
| Setting | What it does |
|---|---|
| Additional input | Reference data from upstream nodes not directly connected |
| Output path | Customise where the node’s output is stored |
| Schema validation | Define a JSON schema to validate the node’s output |
Constraints and limitations
| Constraint | Limit |
|---|---|
| Nesting depth | 5 levels (decisions referencing other decisions) |
| Rule nodes available | Decision Table, Expression, Function, Switch, Decision |
For the full limits table, refer to Limits and constraints.
Related features
- How to test decisions — test with sample data, run regression tests, monitor execution.
- How to publish and release — commit changes and create releases.
- Expression syntax reference — operators, functions, and data types for Expression nodes.