Skip to main content

Decision Tree

Overview

A Decision Tree is a Logic Block that accepts one or more inputs and produces one or more outputs using a flowchart-based approach to decision-making. Decision Trees use a visual, hierarchical structure where each node represents a decision point that determines the path to the final outcome.

Decision Trees are ideal when:

  • Decisions follow a clear sequence of questions
  • The logic has a natural hierarchical structure
  • Business users think in terms of "if this, then ask that"
  • You want to visualize the decision path

Unlike Decision Tables where decisions are evaluated top-to-bottom in a flat structure, Decision Trees evaluate conditions along a path from root to leaf. Each decision node has branches leading to either another decision or a final outcome.

How Decision Trees Work

Evaluation starts at the root node and proceeds through the tree:

  1. At each decision node, evaluate the condition
  2. Follow the branch that matches the condition result
  3. Continue until reaching a leaf node (outcome)
  4. The leaf node's outputs are returned

This path-based evaluation means each input might only be evaluated once (at its decision node), unlike Decision Tables where every decision row checks all conditions.

Structure

A Decision Tree consists of:

ComponentDescription
NameUnique identifier for the Decision Tree
DescriptionWhat decision the tree makes
InputsAvailable data for decision nodes
OutputsValues produced at leaf nodes
Root NodeStarting point of the tree
Decision NodesPoints where conditions are evaluated
Leaf NodesEndpoints that produce outputs

Decision Nodes

A decision node contains:

  • Condition: What to evaluate
  • Branches: Paths to follow based on condition result

Common condition patterns:

PatternExample
Yes/NoIsVIP? → Yes branch, No branch
ComparisonAmount > 1000? → True branch, False branch
CategoriesCustomerType? → Individual branch, Business branch, Government branch
RangesScore? → 0-50 branch, 51-75 branch, 76-100 branch

Leaf Nodes

A leaf node is the end of a decision path. It specifies the outputs to return when that path is reached. Every possible path through the tree must end at a leaf node.

Example: Credit Approval Decision Tree

Name: CreditApprovalDecision

Inputs:

  • CreditScore (Integer): Applicant's credit score
  • AnnualIncome (Money): Applicant's annual income
  • ExistingDebt (Money): Current debt obligations
  • EmploymentYears (Integer): Years at current employer

Outputs:

  • Decision (String): Approved, Declined, Manual Review
  • CreditLimit (Money): Approved credit limit
  • InterestRate (Decimal): Interest rate offered
  • Reason (String): Explanation of decision

Tree Structure:

                    ┌─────────────────┐
│ Credit Score? │
└────────┬────────┘

┌─────────────────┼─────────────────┐
│ │ │
[Less than 580] [580-699] [700 or more]
│ │ │
▼ ▼ ▼
┌──────────┐ ┌──────────────┐ ┌──────────────┐
│ DECLINED │ │ Income? │ │ Income? │
│ │ └──────┬───────┘ └──────┬───────┘
│ Limit: 0 │ │ │
│ Rate: - │ ┌──────┴──────┐ ┌──────┴──────┐
│ Reason: │ [Under $50K] [Over $50K] [Under $75K] [Over $75K]
│ Poor │ │ │ │ │
│ Credit │ ▼ ▼ ▼ ▼
└──────────┘ ┌─────────┐ ┌─────────┐ ┌────────┐ ┌────────┐
│ MANUAL │ │ Debt │ │APPROVED│ │APPROVED│
│ REVIEW │ │ Ratio? │ │ │ │ │
│ │ └────┬────┘ │Limit: │ │Limit: │
│Limit: 0 │ │ │$10,000 │ │$25,000 │
│Rate: - │ ┌────┴────┐ │Rate: │ │Rate: │
│Reason: │[Over 40%] [40% or less]│ 12% │ │ 8% │
│Low Inc. │ │ │ └────────┘ └────────┘
└─────────┘ ▼ ▼
┌────────┐ ┌────────┐
│DECLINED│ │APPROVED│
│ │ │ │
│Limit: 0│ │Limit: │
│Rate: - │ │$5,000 │
│Reason: │ │Rate: │
│High │ │ 15% │
│Debt │ └────────┘
└────────┘

Evaluation Example:

For inputs: CreditScore = 650, AnnualIncome = $65,000, ExistingDebt = $15,000

  1. Root: Credit Score? → 650 is in range 580-699 → Follow middle branch
  2. Node 2: Income? → $65,000 >= $50,000 → Follow right branch
  3. Node 3: Debt Ratio? → $15,000 / $65,000 = 23% → 23% is less than or equal to 40% → Follow right branch
  4. Leaf: APPROVED, Limit: $5,000, Rate: 15%

Example: Support Ticket Routing Tree

Name: TicketRoutingDecision

Inputs:

  • TicketType (Option Set): Technical, Billing, General, Complaint
  • CustomerTier (Option Set): Enterprise, Business, Individual
  • Severity (Option Set): Critical, High, Medium, Low
  • ProductLine (String): Which product the ticket concerns

Outputs:

  • AssignedTeam (String): Which team handles the ticket
  • Priority (Integer): Priority level (1-5)
  • SLAHours (Integer): Hours to respond
  • EscalationPath (String): Who to escalate to if needed

Tree Structure:

                         ┌───────────────┐
│ Customer Tier?│
└───────┬───────┘

┌───────────────────────┼───────────────────────┐
│ │ │
[Enterprise] [Business] [Individual]
│ │ │
▼ ▼ ▼
┌───────────┐ ┌──────────┐ ┌──────────┐
│ Severity? │ │TicketType│ │TicketType│
└─────┬─────┘ └────┬─────┘ └────┬─────┘
│ │ │
┌────┴────┐ ┌──────┴──────┐ ┌──────┴──────┐
[Critical] [Other] [Technical] [Other] [Complaint] [Other]
│ │ │ │ │ │
▼ ▼ ▼ ▼ ▼ ▼
┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐
│Escalate│ │Premium │ │Tech │ │General │ │Customer│ │Self- │
│Team │ │Support │ │Support │ │Support │ │Success │ │Service │
│ │ │ │ │ │ │ │ │ │ │ │
│Pri: 1 │ │Pri: 2 │ │Pri: 3 │ │Pri: 3 │ │Pri: 2 │ │Pri: 4 │
│SLA: 1hr│ │SLA: 4hr│ │SLA: 8hr│ │SLA: 24h│ │SLA: 24h│ │SLA: 48h│
└────────┘ └────────┘ └────────┘ └────────┘ └────────┘ └────────┘

Decision Table vs. Decision Tree

AspectDecision TableDecision Tree
StructureFlat, tabularHierarchical, flowchart
EvaluationAll conditions per decisionConditions along path
Best forMany independent decisionsSequential decision-making
ReadabilityEasy to scan all decisionsEasy to follow logic path
MaintenanceAdd/remove rowsRestructure branches
VisualizationSpreadsheet-likeFlowchart

Choose Decision Table when:

  • Decisions are largely independent
  • You need to see all decisions at once
  • Business users prefer tabular format
  • Decisions can be easily expressed as condition combinations

Choose Decision Tree when:

  • Decisions naturally follow a sequence
  • Different paths require different questions
  • You want to visualize the decision flow
  • Some conditions only apply in certain contexts