A Singapore Government Agency Website

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:

  1. Select Start from Template from the project view.
  2. Browse templates tagged with Decision.
  3. Select Use Template to create the decision with a pre-configured blueprint.

From scratch:

  1. From the project view, select Add New File.
  2. Select Decision as the artifact type.
  3. Enter a descriptive name (e.g., “Loan Eligibility Check”, “Credit Scoring”).
  4. Select Add, then open the new decision.

Step 2: Configure the decision input

The input defines the data structure the decision evaluates.

  1. Select the input node on the canvas.
  2. 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
  1. Drag a rule node onto the canvas.
  2. Connect it to the input node (or a preceding rule node).
  3. Configure the node’s rules, conditions, or logic in the settings panel.
  4. 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.

Chat with me!
Bot Launcher