Decision Nodes and Conditional Content
Use decision nodes to branch your document projection flow. Configure conditions, label branches, and produce different outputs based on entity attributes.
Decision nodes let you branch the flow based on conditions evaluated against the current context. They appear as diamond shapes on the canvas and have two or more outgoing paths. During publishing, the flow engine evaluates the conditions and follows the matching branch, producing different content for different data.
How Decision Nodes Work
A decision node evaluates a condition and routes data down one of its outgoing branches. The most common pattern is a two-branch decision with a "yes" path and a "no" path, but you can add more branches for multi-way decisions.
Adding a Decision Node
Condition Configuration
Decision conditions use the same type-aware operator system as filter nodes:
Branch Labels
Clear branch labels make flows easier to understand at a glance. The labels appear on the edges leaving the decision node. Some examples of effective labelling:
| Condition | True Branch Label | False Branch Label |
|---|---|---|
| Entity has description | Has Description | No Description |
| Property count > 0 | Has Properties | Empty Entity |
| Status equals deprecated | Deprecated | Active |
| Type equals enum | Enum Entity | Standard Entity |
Common Patterns
Conditional Sections
Place a decision node inside a loop to conditionally include content for certain entities. For example, loop over all entities, then use a decision to check whether each entity has a description. The "Has Description" branch renders a rich text block, while the "No Description" branch renders a callout noting that documentation is missing.
Format Switching
Use a decision to choose between different output formats. For entities with many properties, render a table. For entities with few properties, render a simple definition list. The decision checks whether the property count exceeds a threshold and routes to the appropriate output node.
Multi-Way Branching
For more than two outcomes, chain decision nodes together. The first decision handles one condition, and each branch can lead to another decision. This lets you build multi-way routing without a dedicated switch node.
Decision Nodes and Context
Both branches of a decision node receive the same context from the upstream node. The decision does not alter the data - it only chooses which path to follow. This means all fields available before the decision are still available in both branches.