Academy

Decision Tree: Branching Guidance Rules and Examples

Use a decision tree to turn genuine dependencies into exclusive, terminating branches that readers and machines can follow to one justified next action.

16 min read

A decision tree is a sequence of questions in which each answer selects the next question or a final recommendation. Use it when the right action genuinely changes according to facts the reader can identify—not as decoration for advice that is the same for everyone.

Choose the first response to a failed data export

1. Does the export show an error message?
Yes → Copy the exact message, then go to question 2.
No → Check whether the job still appears as “Processing”. If it does, wait for the stated processing window; if it does not, restart the export once.

2. Does the message say that permission is denied?
Yes → Ask an administrator for export permission. Stop.
No → Reduce the date range and retry once. If it fails again, send the message and export ID to support. Stop.

The rendered element demonstrates the essential contract: every choice is distinguishable, every path advances, and every path ends with a next action or escalation.

Why this element matters

“It depends” is honest but incomplete. A reader encountering that phrase must discover what the answer depends on, decide which conditions apply, and reconstruct the recommendation from prose. A decision tree makes those dependencies explicit. It turns a vague qualification into a bounded sequence: observe a fact, choose one branch, then act on the endpoint.

This reduces working-memory load. The reader evaluates only the current choices instead of holding every exception in mind. It also makes uncertainty visible. If a person cannot answer a node, the tree can route them to a check, measurement, or expert rather than inviting a guess. That is especially important for troubleshooting, eligibility, purchase selection, and policy interpretation, where a confident but wrong branch can cost time or create risk.

Machine extractability means that a crawler, search system, AI answer system, or content transformation tool can recover each question, its permitted answers, and the next node or endpoint. Continuous “if this, perhaps that, unless…” prose hides those relationships in grammar. A typed tree exposes them as records with stable identifiers and explicit targets. A machine can preserve the route start → has-error → permission-denied → request-access without inferring which paragraph modifies which condition.

Follow the element writing rules before applying the pattern. Purpose takes precedence over appearance: a sequence remains a step list when everyone performs the same actions in order, and a comparison remains a comparison when readers need to inspect options side by side. Use a decision tree only when a prior answer changes what should happen next.

When to use it

Use a decision tree when all of these conditions hold:

  1. At least one meaningful recommendation depends on an answer supplied by the reader or their situation.
  2. Each decision can be expressed with observable, mutually exclusive choices.
  3. Following a branch removes irrelevant choices rather than merely hiding useful context.
  4. Every route terminates in an action, conclusion, named fallback, or escalation.
  5. The author can explain why each condition changes the recommendation.

Strong uses include diagnosing a known symptom, choosing among product categories, checking policy applicability, selecting an implementation route, and deciding when a routine process must be escalated.

Near misses should stay in simpler forms:

  • One recommendation with several reasons: use ordinary explanatory prose. No answer changes the outcome.
  • A fixed procedure: use ordered steps. Branches inside every step make the primary route harder to see.
  • Options readers must compare across shared criteria: use a comparison table. A tree may recommend an option after the comparison, but it cannot replace evidence.
  • A personality quiz: preferences can overlap and scoring may be cumulative. That is an assessment model, not an exclusive tree.
  • A list of audience segments: use a persona switcher when readers simply choose their role and receive parallel content.
  • A complex calculation: use a calculator when several numeric inputs combine. Converting ranges into dozens of branches loses precision.
  • A disguised sales funnel: if every path recommends the same product, the tree creates an illusion of diagnosis. State the recommendation and its limits directly.
Logo

Ready to Monitor Your AI Visibility?

Track how AI chatbots mention your brand across ChatGPT, Perplexity, and other platforms.

Where to place it

Place the tree immediately after the reader understands the decision, its scope, and any facts they need to answer the first node. In a troubleshooting article, put shared safety checks and the exact symptom before the tree. In a buying guide, define the criteria and eligible option set before routing readers to a category. In policy content, state the authoritative rule and jurisdiction before branching through exceptions.

Exact position rules:

  • Introduce the tree with an H2 and one sentence naming the decision it resolves.
  • Put definitions, measurements, and prerequisites before the first node; never make a branch label depend on an undefined term.
  • Keep supporting evidence close to the endpoint it justifies, or link each endpoint to a visible evidence section on the same page.
  • Put a summary after a long tree so readers can confirm the selected endpoint and understand what to do next.
  • Keep the tree before the final call to action. The action should follow a conclusion, not interrupt the diagnosis.

A decision tree may not sit directly beside another decision tree, a persona tab set, or an accordion that hides information needed to choose a branch. It must not split a warning from the hazardous condition it qualifies, interrupt an ordered procedure without an explicit “return to step” endpoint, or appear before a comparison that supplies the evidence for its recommendations. Do not place promotional cards inside nodes; commercial pressure makes neutral routing difficult to trust.

Anatomy

The anatomy has eight parts:

  1. Title: names the decision as a reader goal, such as “Choose an export recovery route”.
  2. Scope statement: states which situation the tree covers and which situations it excludes.
  3. Start node: supplies one unambiguous entry point.
  4. Question node: asks for one observable fact, not an opinion containing several conditions.
  5. Branch labels: provide mutually exclusive answers in the same logical category.
  6. Connectors: map each answer to one next node or one endpoint through stable IDs.
  7. Terminal endpoint: gives a conclusion, action, evidence link, or safe escalation and visibly marks the route complete.
  8. Fallback: handles “unknown”, “none applies”, missing data, or an unsafe situation without forcing a guess.

A visual arrow is presentation, not the relationship itself. Source data must identify the target of every branch even when the renderer lays the tree out vertically on a narrow screen.

Design examples

Every design variant uses the same node-and-target contract. Choose according to the reasoning structure and viewport, not visual novelty.

Binary diagnostic tree

Each node has “yes” and “no” branches. Use it when a fact is genuinely boolean: a status exists, a test passed, or a permission is present. Avoid negative questions because “No” becomes hard to interpret.

Multi-choice selection tree

A node offers three or four non-overlapping categories, such as contract term, environment, or primary constraint. Define category boundaries in the labels; “small”, “medium”, and “large” are unusable without ranges.

Staged qualification tree

Early nodes remove ineligible routes; later nodes refine among eligible choices. Use it for policy, service, or integration applicability. Put disqualifying safety and legal conditions first because later preferences cannot override them.

Linear tree with exception exits

The main path continues through a normal sequence while occasional branches exit to recovery or escalation. Use it when most readers follow one route and exceptions are uncommon. Label return points precisely if an exception rejoins the procedure.

Interactive one-question view

Show one current node at a time only when the full tree is too dense for the viewport. Include progress context, Back, Start over, a textual result summary, and a noninteractive accessible view. The complete source tree must remain available without client-side fetching.

Parameters

The parent owns the tree identity and start point. Repeated nodes own their prompt or endpoint content, while branch records own answer labels and targets.

NameTypeRequiredMin/maxDefaultSource
titlePlain stringYes3–12 words; 100 charactersFirst heading in bodyFirst heading
idLowercase identifierYes after publication2–8 hyphenated words; unique on pageGenerated from title, then pinnedParent attribute
variantEnumNobinary, multiple, staged, exception, or interactivebinaryParent attribute
startNode IDYesMust match exactly one nodeFirst node in source orderParent attribute
nodeRepeated recordYes2–15 nodes; maximum depth 5NoneNested body item
node.idLowercase identifierYes1–6 hyphenated words; unique in treeNoneItem attribute
node.kindEnumYesquestion or endpointquestionItem attribute
node.titlePlain textYesQuestion: 5–18 words; endpoint: 2–10 wordsFirst heading in item bodyFirst heading
node.contentRestricted MarkdownNo0–80 wordsContent after first headingBody
branchRepeated recordQuestion nodes only2–4 per questionNoneItem attribute or nested branch record
branch.labelPlain textYes per branch1–12 words; 80 charactersNoneBranch attribute
branch.targetNode IDYes per branchMust resolve within the same treeNoneBranch attribute
restartBooleanNotrue or falsetrue for interactive variantParent attribute

An endpoint has no branches. A question has at least two, and each target resolves to a node in the same tree. The data must be acyclic: no branch may lead back to an ancestor. A recovery route that rejoins a procedure should terminate with “Return to step 3” rather than creating a loop inside the tree.

Syntax and code examples

All three forms describe the same canonical records. Renderers may change layout, but they must preserve source order, labels, targets, endpoints, and the complete noninteractive reading path.

Portable Markdown directive

:::decision-tree{id=export-recovery variant=binary start=has-error}
## Choose an export recovery route

::item{id=has-error kind=question branches="yes:permission-error|no:still-processing"}
### Does the export show an error message?
Choose from the status shown in the export history.
::

::item{id=permission-error kind=question branches="yes:request-access|no:retry-smaller"}
### Does the message say permission is denied?
::

::item{id=still-processing kind=endpoint}
### Check the processing window
Wait until the stated window ends, then restart the export once.
::

::item{id=request-access kind=endpoint}
### Request export permission
Ask an administrator for access before trying again.
::

::item{id=retry-smaller kind=endpoint}
### Retry a smaller export
Reduce the date range once; if it fails, send the error and export ID to support.
::
:::

The compact branches attribute uses label:target pairs separated by |. Labels may not contain either delimiter. A platform with nested branch records may store the same values structurally, but export must reproduce the explicit label-to-target mapping.

Hugo shortcode

{{< decision-tree title="Choose an export recovery route" id="export-recovery" variant="binary" start="has-error" >}}
  {{< decision-node id="has-error" kind="question" title="Does the export show an error message?" branches="Yes:permission-error|No:still-processing" >}}
  Choose from the status shown in the export history.
  {{< /decision-node >}}
  {{< decision-node id="permission-error" kind="question" title="Does the message say permission is denied?" branches="Yes:request-access|No:retry-smaller" >}}{{< /decision-node >}}
  {{< decision-node id="still-processing" kind="endpoint" title="Check the processing window" >}}
  Wait until the stated window ends, then restart the export once.
  {{< /decision-node >}}
  {{< decision-node id="request-access" kind="endpoint" title="Request export permission" >}}
  Ask an administrator for access before trying again.
  {{< /decision-node >}}
  {{< decision-node id="retry-smaller" kind="endpoint" title="Retry a smaller export" >}}
  Reduce the date range once; if it fails, send the error and export ID to support.
  {{< /decision-node >}}
{{< /decision-tree >}}

This is the Hugo adapter specification, not an instruction to imitate the tree with arbitrary nested lists. It uses named parameters only and requires the renderer to reject missing targets, duplicate IDs, cycles, and question nodes without enough branches.

WordPress block

<!-- wp:amicited/decision-tree {"title":"Choose an export recovery route","id":"export-recovery","variant":"binary","start":"has-error"} -->
  <!-- wp:amicited/decision-node {"id":"has-error","kind":"question","title":"Does the export show an error message?","branches":[{"label":"Yes","target":"permission-error"},{"label":"No","target":"still-processing"}]} -->
  <p>Choose from the status shown in the export history.</p>
  <!-- /wp:amicited/decision-node -->
  <!-- wp:amicited/decision-node {"id":"permission-error","kind":"question","title":"Does the message say permission is denied?","branches":[{"label":"Yes","target":"request-access"},{"label":"No","target":"retry-smaller"}]} /-->
  <!-- wp:amicited/decision-node {"id":"still-processing","kind":"endpoint","title":"Check the processing window"} -->
  <p>Wait until the stated window ends, then restart the export once.</p>
  <!-- /wp:amicited/decision-node -->
  <!-- wp:amicited/decision-node {"id":"request-access","kind":"endpoint","title":"Request export permission"} -->
  <p>Ask an administrator for access before trying again.</p>
  <!-- /wp:amicited/decision-node -->
  <!-- wp:amicited/decision-node {"id":"retry-smaller","kind":"endpoint","title":"Retry a smaller export"} -->
  <p>Reduce the date range once; if it fails, send the error and export ID to support.</p>
  <!-- /wp:amicited/decision-node -->
<!-- /wp:amicited/decision-tree -->

The WordPress parent block limits inner blocks to decision nodes, validates targets before publication, and server-renders a complete list or equivalent accessible structure. Editor-only connecting lines are not the source of truth.

Examples

Good example

A buying guide asks, “Must the device operate without mains power?” Yes routes to battery-powered options; No asks, “Will it remain in one fixed location?” That answer routes either to installed or portable options. Each endpoint names a category, explains the decisive constraint, and sends the reader to a visible comparison of eligible products. “Not sure” routes to measuring the intended location and checking outlet access.

This works because the questions concern facts a reader can observe, the branches do not overlap, and each answer removes unsuitable categories. The tree recommends a category rather than pretending to select a specific product without price, feature, and evidence comparisons.

Bad example

A software page asks, “Do you want better results?” Both Yes and Not yet route to “Book a demo.” The next question asks whether the visitor values speed, quality, or savings, although most buyers value all three. Every endpoint repeats the same product claim.

This fails because the choices are neither mutually exclusive nor decision-changing. The questions collect agreement rather than diagnose needs, and the branches conceal a single call to action. Replace it with a direct value proposition and evidence. If different implementations truly fit different constraints, ask about those measurable constraints and allow an honest endpoint such as “This product is not a fit.”

Schema markup and accessibility

Schema.org has no DecisionTree type. Do not label the element HowTo unless the page independently contains one ordered procedure, and do not label question nodes FAQPage when their answers are merely branch controls. The tree may help generate internal content data—nodes, choices, targets, and endpoint recommendations—but it feeds no public schema property by default.

For accessibility, use a heading for the tree title and an ordered or nested list for the complete static form. Each question and endpoint needs visible text; connectors cannot rely on color, line direction, or spatial position alone. Repeat the answer label in the relationship, such as “If yes, continue to Permission check.” A screen reader should understand the route without interpreting a diagram.

If the tree is interactive, use native buttons for choices. Expose the current question in a labelled region, move focus to the new question or announce it through a restrained live region, and provide Back and Start over controls. Do not disable browser zoom, trap focus, or change a choice on focus. Preserve the selected route in text at the endpoint so the reader can verify how the result was reached.

All nodes and endpoints should arrive in server-rendered HTML, even if inactive nodes are visually hidden. If performance makes that impractical for a very large expert system, publish a complete accessible alternative and treat the interactive application as a separate tool rather than this content element.

Writing rules

The goal is the shortest defensible route, not the appearance of sophistication.

  • Write the title as a decision: “Choose…”, “Check whether…”, or “Find the right…”. Keep it to 3–12 words.
  • Ask one fact per question in 5–18 words. Split conditions joined by “and” or “or” unless they always have the same observable answer.
  • Use two to four branches per question and no more than five decision levels. More depth makes readers lose their route and makes mobile diagrams unwieldy.
  • Make sibling branches mutually exclusive and collectively sufficient for the intended scope. Add “Not sure” or “None of these” when uncertainty is realistic.
  • Use parallel labels from one category: all yes/no, all ranges, all environments, or all stated constraints.
  • State numeric boundaries exactly. Use “Fewer than 50 locations” instead of “small business”. Avoid overlapping ranges at boundary values.
  • Give every endpoint a 2–10-word action title and up to 80 words explaining why it follows, what to do, and when to escalate.
  • Put the safest and cheapest discriminating check early. Do not ask for specialist measurements before a visible status or permission check that already determines the route.
  • Keep evidence, limitations, and consequences visible. A tree organizes a decision; it does not prove that the recommendation is correct.
  • Test every path aloud as a sentence: “Because the answer was X, continue to Y.” If that sentence is illogical, the branch is wrong.

Never put confidential personal data, unqualified medical or legal diagnosis, a hidden price, a safety warning, a multi-field form, or an irreversible action inside a node. Never create a dead end, an unlabeled connector, an endpoint that says only “It depends”, or a cycle that makes the reader repeat questions indefinitely.

Post types that use it

The postTypes frontmatter defines the supported set. Presence in this table means the post type may use a tree when its content genuinely branches; it does not make the element mandatory on every page.

Post typeTypical decisionPlacement
Troubleshooting guidesWhich cause or recovery route fits an observed symptomAfter shared safety and cheapest-first checks
Buying guidesWhich option category fits constraints and eligibilityAfter criteria, before the detailed comparison
How-to guidesWhich alternate step applies after a result or exceptionAt the branch point, with a named return or terminal action
Documentation articlesWhich setup or permission route applies to the environmentAfter prerequisites and supported-environment definitions
Solution pagesWhich workflow fits a role, system, or operating constraintAfter fit criteria and before product proof
Use-case pagesWhich workflow variation fits the reader’s job and inputsAfter the common outcome is defined
Alternatives-to-X pagesWhich alternative category fits the reason for switchingAfter switching criteria, before vendor comparison
Policy pagesWhether a rule or exception applies to a documented caseAfter the authoritative rule and scope statement

QA checklist

  • The page contains a real dependency: at least one answer changes the next question or endpoint.
  • The title and scope state exactly which decision the tree resolves and excludes.
  • There is one start node, every question has two to four branches, and every target exists.
  • Sibling choices are mutually exclusive, use parallel labels, and cover realistic uncertainty.
  • Every path terminates in an action, conclusion, fallback, or escalation within five levels.
  • No endpoint is orphaned, no node points to itself or an ancestor, and no reader can loop indefinitely.
  • Every endpoint explains why it follows and keeps evidence or limitations available.
  • The tree does not replace a fixed procedure, side-by-side comparison, calculation, warning, or direct recommendation.
  • All text and relationships are present in server-rendered HTML and understandable without connector lines.
  • Keyboard users can choose, go back, restart, and reach the result with visible focus.
  • Focus and status changes are announced without trapping focus or repeatedly interrupting a screen reader.
  • Narrow-screen rendering preserves source order, labels every connector, and does not require horizontal panning.
  • The static fallback and interactive result produce the same endpoints for the same answers.
  • A reviewer has walked every path, tested boundary values, and challenged any branch that leads to the same outcome.

Frequently asked questions

The questions below cover implementation choices that often appear only after the tree has been drafted. The core test remains simple: branches must represent facts that change the result, and every route must end safely.

← All Academy tutorials

Ready to put it into practice?

Free check · 7-day trial · no credit card