ProductFebruary 28, 20263 min read

Branching Logic in Voice Agents: Conditionals, Variables, and State

Real conversations branch. The caller's answer to one question determines what happens next. Here's how conditional logic works in voice agent workflows.

A linear conversation flow — greet, ask, respond, end — works for the simplest use cases. Anything beyond that requires branching: if the caller is an existing customer, check their account; if new, start onboarding. If the issue is billing, route to billing flow; if technical, route to troubleshooting. If the caller is frustrated, escalate early. Branching is what turns a demo agent into a production agent.

How conditionals work in Agent Canvas

A conditional node evaluates a variable or LLM classification and routes the conversation down different paths. The variable can be explicitly collected ('Are you an existing customer?'), inferred by the LLM from context, or looked up from an external system (CRM returns customer tier). Each branch leads to a different sub-flow, with its own actions, knowledge base queries, and guardrails.

Conversation state and variables

Variables accumulate as the conversation progresses: caller_name, account_id, issue_type, sentiment_score. These variables are available to every node in the canvas — they inform conditional routing, personalize agent responses, and get passed to actions as parameters. When the agent books an appointment, it uses the caller_name and preferred_time variables collected earlier in the conversation. State makes the flow coherent rather than each node operating in isolation.

Ready to build?

See how Mazed's multimodal AI agents work for your use case.

Branching Logic in Voice Agents: Conditionals, Variables, and State | Mazed Blog | Mazed