Data Flow

Pass-by-Edge and Passthrough Modes

The GoRules engine processes data using a flow of nodes connected like a graph. There are two ways these nodes handle data:

1. Pass-by-edge mode

Each node processes data and only passes along what it changes or adds.

Example:

  • Input/Request: { country: 'US' }
  • Decision Table 1 sets fee: 10 based on the country and outputs { fee: 10 }.
  • Decision Table 2 sets discount: 5 based on the same criteria and outputs { discount: 5 }.
  • If both tables are connected directly to a Response Node in parallel, the engine will aggregate their outputs, resulting in { fee: 10, discount: 5 }.

  • However, if the data flows sequentially (Input > Table 1 > Table 2 > Response), the final output will only contain what Table 2 sets, which is { discount: 5 }. The data from Table 1 (fee: 10) will not be carried forward.

2. Passthrough Mode

Each node not only processes data but also passes along the original input data.

Example:

  • Input/Request: { country: 'US' }
  • Decision Table 1 sets fee: 10 and passes { country: 'US', fee: 10 } to Table 2.
  • Decision Table 2 receives { country: 'US', fee: 10 }, adds discount: 5, and outputs { country: 'US', fee: 10, discount: 5 }.
  • Even in a sequential chain, the final output will combine all the data it processed, resulting in { country: 'US', fee: 10, discount: 5 }.

📘

The Passthrough mode is default mode when dropping node into canvas. To turn it off after drop, open node Settings and then turn off Passthrough.

📘

The Passthrough is indicated by a right arrow icon located at the top right, just above the node.

Node behavior in different modes

  • Switch Nodes: Always work in Passthrough mode. They control the flow based on conditions and pass along the original input data while making decisions.
  • Expression Nodes, Decision Table Nodes, Sub-Decision Nodes: Support both Passthrough and Pass-by-Edge modes. You can choose how data should be handled depending on your use case. For example, if you need to keep original inputs while adding new data, use Passthrough; otherwise, stick with Pass-by-Edge for isolated processing.
  • Function Nodes: Operate in Pass-by-Edge mode but provide flexibility by allowing you to modify the entire response. This is useful when you need to reshape or transform data completely before passing it to the next step.

Passthrough availability

Passthrough mode is available from:

BRMSAGENTRustNode.jsPythonGo
1.35.01.8.00.33.00.32.00.31.0v0.11.0

Summary

In short, Pass-by-Edge passes only the output of each node, while Passthrough retains the original input, merging results along the way. By connecting nodes strategically and understanding their modes, you can design flexible, efficient decision graphs that fit your processing needs.