NodeFox logoNodeFox

Decision Node

What Decision is and why it matters

Decision is the control node that determines where execution goes next. It exists so routing logic is visible in the graph instead of hidden in prompts or custom scripts. In mature NodeFox workflows, Decision nodes define the policy boundaries for confidence thresholds, quality acceptance, risk handling, retries, and escalation.

When teams struggle with explainability, Decision placement is usually the fastest way to restore control. If a branch cannot be explained by deterministic rules or clear options, that branch should be redesigned.

Execution behavior

Decision evaluates configured conditions or options and routes output through explicit branches. It can be used as a one-time gate or as part of a loop cycle with iteration bounds. Because routing is explicit, Decision outcomes are easy to inspect in run history and post-incident analysis.

For loop designs, Decision should own the convergence contract: what counts as pass, what counts as retry, and what happens when retries are exhausted.

Variants and configuration details

Basic variant

Basic is rule-driven deterministic routing and should be your default for policy logic.

FieldWhat it controlsPractical guidance
RulesOrdered condition list (LHS / evaluator / RHS)Keep rule order intentional because first-match behavior determines branch priority.
OnPassRoute mapping for matching ruleUse explicit route names that encode intent, not generic pass/fail labels.
MaxMaximum decision cycles before fallbackAlways set for loop scenarios to prevent unbounded retries.
DefaultBranch used when no rule matches or max is hitDefault should be deterministic and safe, not ambiguous.
SlotPrimary slot context for rule evaluationNormalize payload shape upstream so slot references remain stable.

Rule shape and evaluator behavior

Each Basic rule is effectively:

LHS + Evaluator + RHS + OnPass

  • LHS: value to test (supports slot references like $1.status, $1.score)
  • Evaluator: comparison operator
  • RHS: expected value (literal value or slot reference)
  • OnPass: route mapping for the matching condition

Evaluator reference

Decision Basic supports these evaluators:

EvaluatorTypical use
equalsexact equality checks (status == "approved")
not equalsexplicit inequality checks
containssubstring or membership-style checks
not containsexplicit absence checks
greater thannumeric threshold gates (score > 7)
less thannumeric lower-bound checks
greater than or equalinclusive numeric minimums
less than or equalinclusive numeric maximums
starts withprefix checks for structured string keys
ends withsuffix checks for extension or domain checks
regex matchpattern matching for advanced text validation

For reliable behavior, normalize data types before Decision evaluation (especially for numeric and boolean logic) so branches do not depend on implicit coercion.

Question variant

Question uses model-assisted evaluation for routing when deterministic rule sets are insufficient.

FieldWhat it controlsPractical guidance
QuestionNatural-language evaluation promptKeep prompts narrowly scoped and pair with fallback controls.
ToOutput slot for model answerSeparate answer output from pass-through business payloads.
Pass FromInput slot to preserveUse for payload continuity across evaluation branches.
Pass ToOutput slot for preserved payloadKeep mappings explicit to avoid silent payload loss.

Question variant should still terminate in deterministic routing semantics. For high-impact actions, use Question output as an input to a deterministic Decision/activation gate rather than directly authorizing side effects.

Use Question variant when semantic judgment is needed, but do not let it replace hard policy gates for high-impact decisions.

Options variant

Options is human-choice routing and is commonly used for approval or exception handling paths.

FieldWhat it controlsPractical guidance
OptionsHuman-selectable labels and destination routesKeep options concise and action-oriented for fast operator decisions.
fromSource slot for routed payloadPass only optional context to reduce accidental data exposure.
toDestination slot mapping per optionStandardize option-to-slot conventions across teams.

Options is most effective when each option has a clearly documented operational meaning (Approve, Reject, Escalate, etc.) and a deterministic downstream path.

Loop and retry design

A safe retry loop looks like Conversation -> Decision -> (Pass branch or Retry branch) with a bounded Max and a deterministic fallback route. This fallback route should usually trigger either a review queue, structured failure output, or escalation handling.

If Decision loops are expensive, add run/cost instrumentation and review aggregate retry distributions. High retry density usually signals either weak prompts, weak acceptance criteria, or mismatched source data quality.

Common mistakes to avoid

The most common Decision mistake is putting critical policy logic inside Conversation instructions and then treating Decision as a cosmetic layer. Decision should be the policy source of truth. Another common issue is missing defaults, which can create ambiguous end states when none of the rules match.

For regulated or customer-impacting workflows, pair Decision with explicit approval identity capture and policy version references so branch outcomes are defensible.