Skip to course content
Free agentic AI fundamentals course

Introduction to Agentic AI and Workflow Automation

Unit 05.02: Routing on a value, not on a paragraph

Branching on prose produces a branch you cannot test.

Fields versus a summary

The same routing decision made from validated fields and from a paragraph of the agent's own text.

The example below runs both.

ROUTING ON NAMED VALUES
  category      billing
  amount        240.00
  has_contract  true
                 ->  no contract?      escalate
                 ->  amount under 500? handle automatically
                 ->  otherwise         send for approval

ROUTING ON A PARAGRAPH
  "The customer seems to have a billing issue involving roughly 240
   dollars, and I think there is a contract."
                 ->  contains the word "billing"?  handle as billing

  The second works until the summary says "invoicing", or hedges, or says
  it is NOT a billing issue. The first is a truth table over three fields.

The prose router works until the summary says "invoicing" instead of "billing", or hedges with "seems to be", or puts the word in a sentence saying it is *not* a billing issue. Each of those is a normal thing for generated text to do.

The field-based router is a truth table over three named values. Every combination can be constructed in a test, and the branch behaves the same way for the same inputs forever.

The mistake this prevents

The mistake is having the agent produce prose and then parsing it. Have it produce validated fields instead - the judgement still belongs to the agent, and the branch becomes something you can reason about.

Takeaway

Have the agent emit validated fields and route on those. Judgement stays with the agent; the branch becomes a truth table you can test exhaustively.