Building decision models

Decision models help you capture business decisions in a decision diagram, a representation that includes the data that is needed to make the decisions.

Each decision model contains a decision diagram. Diagrams provide an abstract, high-level representation of how decisions and the data that is required to make the decisions are structured and related to each other.

Diagrams are composed of a set of nodes that are used as building blocks to represent decisions in a graphical way:

Decision diagram
Figure 1. An example of a decision diagram

  • Decision nodes

    Decision nodes represent the decision that you want to automate and its supporting subdecisions. Each decision in the diagram is associated with a logic. The decision logic is implemented as a set of rules that generate a result based on one or several input data. In other words, the decision logic precisely defines how a particular decision is made:

    1. It evaluates the data available as input against a set of conditions that you define.
    2. It produces the output of the decision, depending on whether these conditions are satisfied.
  • Input nodes

    Input nodes represent the data that decisions depend on to determine their output.

  • Function nodes

    Function nodes represent values that are computed from other decision models.

  • Prediction nodes

    Prediction nodes represent values that are computed from predictions.

  • Generative AI nodes

    Generative AI nodes represent generative AI components.

  • Links

    Links represent:

    • The dependency relationship between the end decision and the subdecisions and input data it depends on.
    • The invocation of a function node or prediction node by a decision node.

When you create a decision model, you start with a default diagram that is made of a decision node and an input node. From there, you can start adding nodes to build your diagram.

Building diagrams is an iterative process: you start with the decision that needs to be made and ask what data is needed for this decision. For example, a seller might want to determine the amount of discount they can offer a loyal customer. Starting from the decision "how much discount to offer", they then add node-by-node all of the data and other influencing decisions that they need to automate this decision. By breaking the end decision into smaller decisions, you end up with a simpler model that is easier to understand.

Adding nodes

As you build the diagram and add nodes, you can preview your decision model to make sure that it works as expected. For more information, see Previewing models.

Decision nodes

  1. Click the Add decision icon Add decision icon in the diagram toolbar.

  2. Create a link between the decision node and at least one input node:

    1. Hover over the input node and click the Connect to another node Connect to another node icon icon.
    2. Click the decision node to select it.

    You can also create a link between this decision node and another one.

  3. Edit the details of the node:

Field Description
Node name A unique name for the decision node.
Output type The output type assigned to the decision node determines:
- What information the node can store and send.
- The possibilities when authoring the decision logic.

Output types are derived from data types. By default, only simple types, such as Boolean or string, are available as output types. You can define more complex data types in the Data tab. For more information, see Modeling data.

If you check the Ouput is a list option, the decision can have multiple outputs.
Description (optional) A description of the decision node.
Output variable name (optional) A variable that can be used in business rules and decision tables to reference the decision node. By default, the output variable name is the same as the node name.
  1. Open the Logic view to start defining decision of the node.
  2. Click the + button and select the type of rule that you want to create. The following table describes the available rule types:
Rule type Description
Business rule An if-then statement where the if is the condition and the then is the action of the rule. If the condition is met, the action is performed.
Decision table A tabular representation of related rules, where each row forms a rule and each column represents one condition or one action.
Default rule A fallback value that is used when no decision is made by the decision logic.
  1. Choose an interaction policy. Interaction policies define how rules interact with each other by governing their order of execution, and ensure that the decision logic produces a consistent result. The following table describes the available interaction policies:
Interaction policy Description
Sequential Rules run in the order in which they are listed in the decision node. A rule can modify or overwrite decisions that were previously made by other rules. As a consequence, several rules might apply for a decision.

This is the default interaction policy.
First rule applies Rules run in the order in which they are listed in the decision node. As soon as a rule applies and returns a decision, this decision is final for the impacted attributes, and the decision node stops running. If a rule might apply several times, and is the first applicable rule, it only applies once. Therefore, you should not use this policy if the decision is a list that results from multiple instances of one or more rules.
Smallest and greatest value All applicable rules run. If you use the smallest value policy, the value of the decision is set to the minimum value available among the values that are obtained by the applicable rules. If you use the greatest value policy, it is set to the maximum value available.

You can use these policies for decisions of type number and integer, and that use the set decision to construct.
Collect All applicable rules run. If you use the collect policy, the values of all applicable rules are collected and returned as a list. The order in which rules run does not influence which values are collected, but it impacts the order in which the collected values appear in the list.

You can use the collect policy for decisions that are multi-valued, and that use the add ... to decision construct.
Sum All applicable rules run. If you use the sum policy, the values of all applicable rules are summed up.

You can use the sum policy for decisions of type number and integer, and that use the add ... to decision construct.

Input nodes

  1. Click the Add input icon Add input icon in the diagram toolbar.
  2. Create a link between the input node and the decision node it is going to send data to:
    1. Hover over the input node and click the Connect to another node icon Connect to another node icon.
    2. Click the decision node to select it.
  3. Edit the details of the node:
Field Description
Node name A unique name for the input node.
Output type The output type assigned to the input node determines the value type that the node can store.

Output types are derived from data types. By default, only simple types, such as Boolean or string, are available as output types. You can define more complex data types in the Data tab. For more information, see Modeling data.

If you check the Ouput is a list option, the input node can pass multiple values.
Description (optional) A description of the input node.
Output variable name (optional) A variable that can be used in business rules and decision tables to reference the input node. By default, the output variable name is the same as the node name.
  1. Open the Default value view to create a default value for the input node. This step is optional. A default value provides a fallback value if no value is available when previewing or calling the decision model.

Function nodes

  1. Click the Add function icon Add function icon in the diagram toolbar.
  2. Open the Decision models drop-down menu in the details pane of the function node and select the decision model that you want to use.
  3. In the diagram, create a link between this node and the decision node that will use the result of the function:
    1. Hover over the function node and click the Connect to another node icon Connect to another node icon.
    2. Click the decision node to select it.
  4. Write the decision logic of the decision node using the output of the function node. You can use the invocation example available in the details pane of the function node.

Prediction nodes

  1. Click the Add prediction icon Add prediction icon in the diagram toolbar.
  2. Open the Predictions drop-down menu in the details pane of the prediction node and select the prediction model that you want to use.
  3. In the diagram, create a link between this node and the decision node that will use the result of the prediction:
    1. Hover over the prediction node and click the Connect to another node icon Connect to another node icon.
    2. Click the decision node to select it.
  4. Write the decision logic of the decision node using the output of the prediction node. You can use the invocation example that is displayed in the details pane of the prediction node.

Generative AI nodes

  1. In the Diagram tab, click the Add Generative AI icon Add generative AI icon in the diagram toolbar.
  2. Open the Generative AIs drop-down menu in the details pane of the generative AI node, and select the generative AI component that you want to use. Sample rules are displayed in Invocation example.
  3. In the diagram, create a link between this node and the decision node that will use the result of the generative AI component:
    1. Hover over the generative AI node and click the Connect to another node icon Connect to another node icon.
    2. Click the decision node to select it.
  4. Write the decision logic of the decision node using the output of the generative AI node. You can use the invocation example that is displayed in the details pane of the generative AI node.

What to do next

When you're finished building your decision model, you can create an operation to expose your components to other users to use in their automations or to train as skills. For more information, see Creating operations.


Parent topic:

Creating decisions