State machine against LLM-driven flows

LLMs, RAG & Orchestrationalso: state machine vs LLM-driven flowsalso: authored flow vs model-driven flow

In one sentence

A state machine follows an authored path with defined states and transitions, an LLM-driven flow lets the model decide what happens next, and the choice between them sets how predictable and how flexible a voice agent is.

under 35% to 70 to 80% Industry-reported ranges, 2026Last reviewed 3 August 2026

Definition

A state machine is a script with defined steps and defined moves between them. An LLM-driven flow lets the model work out what to do next from the conversation.

One is predictable and reproducible. The other is flexible and handles the unexpected. Treating it as an either-or is the mistake.

This is one of the foundational architectural decisions in a voice agent, and the error is treating it as binary. The two approaches are correct for different parts of the same conversation, and the production answer uses both.

State machine characteristics

  • Every state and every transition is defined in advance.
  • The system always knows where it is and what can happen next.
  • Behavior is reproducible and auditable.
  • Coverage requires anticipating the paths, and unanticipated input has nowhere to go.
  • Testing is tractable, because the state space is enumerable.

LLM-driven flow characteristics

  • The model determines the next step from context.
  • Handles unanticipated input gracefully.
  • Behavior is not fully reproducible, and the path taken may differ between identical conversations.
  • Testing is harder, because the space of behaviors is not enumerable.
  • Regulated content is difficult to guarantee.

Where each is correct

  • State machine: identity verification, payment capture, regulated disclosures, consent collection, anything where every utterance must be controlled and every path audited.
  • LLM-driven: open question answering, troubleshooting, anything where the space of possible inputs cannot be enumerated.
  • These map cleanly onto different parts of the same conversation.

The hybrid pattern, which is the production answer

  • Authored flows for transactional and regulated segments.
  • Model-driven handling for open segments.
  • Explicit transitions between them, so the system knows when it has entered a controlled flow.
  • The transition points are where implementations get this wrong: entering a state machine from an open conversation requires carrying context in, and leaving it requires re-establishing conversational continuity.

The testing consequence

  • A state machine can be tested exhaustively against its state space.
  • An LLM-driven flow requires behavioral testing against representative inputs, which is sampling rather than proof.
  • A hybrid requires both, and the transition points need particular attention because they are where each testing approach ends.

Common misconception

That LLM-driven flows have made state machines obsolete. Regulated and transactional segments still require controlled utterances, and authoring them is not a legacy practice but the correct engineering choice.

Why it matters commercially

This determines whether an agent can be deployed in regulated contexts and how much testing it requires. It is also the honest answer to a buyer asking how they can be sure the agent will say the right thing at the critical moment.

Where AsqVox fits

Open question answering from uploaded documents is inherently model-driven. Lead capture, where specific information has to be collected reliably, benefits from more structure.

Visual

One conversation, two architectures

One conversation, two architectures01Open question answeringmodel-driven02Identity verificationstate machine, defined states and transitions03Open follow-upmodel-driven04Consent and confirmationstate machineOne conversationTransition: carry context in, then re-establish continuity onexit. Every gate between segments is a place implementationslose the thread.Which architecture goes whereState machineIdentity verification, payment capture, regulated disclosures, consent.Model-drivenOpen questions, troubleshooting, anything unanticipated.TestingState machine, exhaustive against an enumerable state space. Model-driven, behavioral sampling against representative inputs. Hybrid, both, plus particular attention at the transitions.

The transitions are where implementations get this wrong.

Not a legacy choice. Authored flows are the correct engineering choice wherever every word must be controlled, and the segments above map onto the same call.

Statistics

Every figure carries its source and year. Vendor numbers are labelled as vendor numbers, and where no reliable figure exists this page says so rather than borrowing one.

Containment rates run under 35 percent for rule-based systems, 40 to 55 percent for average deployments, and 70 to 80 percent for mature deployments.

under 35% to 70 to 80%industry range

Industry-reported ranges, 2026 - These figures describe fully rule-based systems. A hybrid that uses authored flows only for controlled segments is not comparable to a wholly rule-based deployment, so do not read the low end as an argument against authoring.

PCI DSS prohibits retention of sensitive authentication data after authorization, which is why payment capture is an authored, controlled flow rather than an open one.

no retention after authorizationindustry range

PCI DSS v4.0, 2022 - A compliance rule of this shape is exactly why the payment segment of a conversation is scripted. An open model-driven flow cannot guarantee it.

EU AI Act Article 50 transparency obligations become enforceable on 2 August 2026, and the required disclosures are exactly the kind of utterance that benefits from authoring.

2 August 2026industry range

EU AI Act, Article 50, 2026 - A mandated disclosure has to be said the same way every time. That is a state machine, not a model-driven flow.

There is no published benchmark comparing state machine, LLM-driven and hybrid architectures on identical task sets.

-no reliable figure

This is the comparison a buyer most needs and the one nobody has run. Naming the hole is more credible than picking a side with a vendor figure.

Examples

In practice

A financial services agent handles open questions through a model-driven path and switches to an authored flow for identity verification. The transition initially loses the context of what the caller was originally asking, so after verification the agent starts over. Carrying the original intent through the authored segment and restoring it on exit resolves it. The architecture was right; the transition handling was not.

The everyday version

A state machine is a script with defined steps. An LLM-driven flow lets the AI work out what to do next. You want the script for the parts that must always happen the same way, like taking consent or verifying who someone is. You want the flexible version for actual questions, because you cannot predict those.

Usage

Who says it

  • Conversation designers, engineers and architects.
  • Appears in design documentation and platform capability comparisons.

Where it turns up

  • In an RFP it sits next to flow design, regulated content handling, auditability, testing methodology and escalation.

Common misuse

  • Treating authored flows as obsolete.
  • Using model-driven handling for regulated utterances.
  • Underestimating transition handling between the two, which is where context is lost.

Questions people ask

Are state machines obsolete now that LLMs can drive conversations?

No. Regulated and transactional segments, like consent, identity verification and payment capture, still require controlled utterances that say the same thing every time. Authoring those is not a legacy practice but the correct engineering choice. The production answer is a hybrid that authors the controlled parts and lets the model drive the open ones.

When should I use a state machine and when should I use an LLM-driven flow?

Use a state machine wherever every utterance must be controlled and every path audited: identity verification, payment capture, regulated disclosures, consent. Use an LLM-driven flow where the space of inputs cannot be enumerated: open question answering and troubleshooting. Most real conversations contain both, in different segments.

What is the hybrid pattern, and where does it go wrong?

The hybrid authors the transactional and regulated segments, lets the model handle the open ones, and marks explicit transitions between them. It goes wrong at those transitions: entering an authored flow from an open conversation requires carrying the context in, and leaving it requires re-establishing conversational continuity. Lose either and the agent starts over or forgets what the visitor was asking.

How do you test each architecture?

A state machine can be tested exhaustively against its enumerable state space, which is proof. An LLM-driven flow can only be sampled with behavioral testing against representative inputs, which is evidence rather than proof. A hybrid needs both, with particular attention at the transition points, because that is where each testing method ends.

Share this definition

Last reviewed 3 August 2026. Written and reviewed by Dhruv Dholakia, founder of AsqVox.