Call Handling & Routing
Call Flow
By Vadim Kouznetsov, Founder of BubblyPhone · Last updated April 5, 2026
A call flow is the sequence of steps and decisions that a phone system takes between the moment a call is answered and the moment it ends — including greetings, routing logic, data collection, transfers, and outcomes. For the past thirty years, call flows were drawn as boxes-and-arrows decision trees for Interactive Voice Response systems. AI phone agents have changed what the word actually means.
The old meaning: a decision tree
Before 2023, designing a call flow meant sitting down with a whiteboard or a tool like Genesys Composer, Twilio Studio, or Amazon Connect’s flow designer and building a state machine. Each box was a prompt (“Press 1 for sales, 2 for support”), each arrow was a branch driven by DTMF input or a narrow intent classification. The flow was rigid: if the caller said something you had not anticipated, you fell back to a default branch, usually “I did not understand that, please try again”.
This worked, in the sense that it got callers to the right department most of the time. It did not work in the sense that everyone hated it. Callers shortcut menus by mashing zero. Agents wasted time re-asking questions the IVR had already asked. Changing a flow required editing the state machine and redeploying, which is why most IVRs are ten years out of date.
The new meaning: a prompt and a set of tools
In an AI phone agent, there is no graphical flow diagram. The call flow is expressed as a system prompt plus a set of tools the agent is allowed to call. That is it. The flow is whatever the language model decides to do at each turn, guided by the instructions and constrained by the available actions.
A call flow for an AI receptionist might look like this:
That is the entire call flow. There is no diagram, no state, no explicit branches. The model decides how to handle anything the caller says, including things nobody anticipated.
What has not changed
The goals of call flow design are the same as they were in 1995. A good flow still needs to:
- Greet the caller and identify the business
- Understand what the caller wants
- Collect any information needed to help them
- Take an action, or route to someone who can
- Confirm what happened and end cleanly
What has changed is who handles these steps. In an IVR, a developer designed every transition. In an LLM-driven flow, the developer writes the goal as instructions and lets the model handle the transitions itself. This is faster to build but harder to debug.
Testing a call flow you did not explicitly design
The main engineering challenge with AI-driven call flows is that you cannot cover every branch by hand, because there are no explicit branches. Testing becomes a sampling problem: run the agent through many realistic conversations, observe what it does, and patch the system prompt when it goes off-track.
- Use a sandbox. Most telephony APIs provide a test environment where you can simulate calls without paying per minute or hitting real phone numbers.
- Replay real calls. Once you have production traffic, the call logs and transcripts become your regression test suite. Pull the last 100 calls, identify the ones with poor outcomes, and use them as test cases.
- Adversarial testing. Have a colleague or a separate LLM try to confuse the agent. The failure modes you see here tell you what to put in the system prompt.
- Monitor for scope creep. LLMs will happily answer questions outside their scope. Watch for the agent giving legal, medical, or financial advice it should not, and tighten the prompt accordingly.
Hybrid flows
Some teams are not ready to let an LLM handle the entire flow from greeting to hangup. A common middle ground is the hybrid flow: traditional branching logic for identity verification, PCI-DSS payment capture, and anything else with strict compliance requirements, with an LLM stage in the middle for open-ended conversation. The AI handles the parts where flexibility matters, and deterministic code handles the parts where it cannot afford to go off-script.
Call flow in BubblyPhone Agents
A call flow in BubblyPhone Agents is defined at the phone-number level: the mode (webhook or streaming), the model, the system prompt, and the tools. Inbound calls automatically run through this configuration. Outbound calls can override the prompt per call for dynamic campaigns. See the API reference for the full configuration schema.
Further reading
- Bill Scholz, Tracy Powell, and others (2010). VoiceXML 3.0 — the dialect that defined traditional IVR call flow design for two decades.
- OpenAI Cookbook, Prompting Guide — practical guidance on writing system prompts that function as call flows.