Call flow XML reference
Write a phone line's call flow by hand: every XML element and attribute, fill-ins, function steps, limits, Twilio and Plivo differences, and examples.
A call flow decides what happens when someone calls one of your phone lines: what they hear, which keys they can press, who rings, and what happens when nobody answers. Every phone line has exactly one. This page is the complete reference for writing a call flow by hand, as XML.
Open Phone & Messages › Call flows, choose the line, and switch from Visual to XML. The visual builder and the XML are two views of the same call flow: build in Visual and switch to XML to see exactly what it wrote, which is a good place to start. See Call flows for the visual builder.
Before you start: changing a call flow needs Full control on Phone & Messages. Anyone who can view the app can read it.
The editor checks the document as you type. Problems are marked in the margin and listed under the editor with their line number. Choose one to jump to that line.
- Errors must be fixed before Save works.
- Warnings never stop a save. Some are about the flow itself, such as a block nothing goes to. Others name your provider (Twilio or Plivo) and say what it can't do, or does differently, with this flow. See Twilio and Plivo.
Insert adds a ready-made piece (a menu, opening hours, a queue and so on) where your cursor is.
A saved call flow applies straight away, also to calls already in progress, from their next step. If a live call was on a step that no longer exists, that caller goes to voicemail (when the flow has a <Voicemail> anywhere), or hears an apology and the call ends.
Note: switching between Visual and XML never changes your document. Comments, formatting and anything the visual builder doesn't draw stay exactly as you wrote them; a change in Visual rewrites only the part it touches.
A first call flow
<CallFlow lang="en-IN">
<Say>Thanks for calling Example Retail.</Say>
<Ring/>
<Voicemail/>
</CallFlow>
This greets the caller, rings everyone who can take calls on the line (up to 10 phones at once) for 25 seconds, and takes a message if nobody answers.
How a call flow runs
- The document is one
<CallFlow>element. The steps directly inside it are what every call runs, from the top, in order. - Each step runs and then the next one does, until a step ends the call or the steps run out. When the steps run out, the call ends.
- Some steps wait.
<Menu>and<Gather>wait for the caller to press keys or speak.<Ring>,<Queue>and<Forward>ring someone: if they answer, the call is theirs and the flow is done. If nobody answers, the flow carries on with the next step. - Steps can sit inside other steps: an
<Option>of a menu, an<If>or its<Else>, a function's<Fallback>. When those inner steps run out, the flow carries on after the step that holds them. For example, after a menu option's steps comes the step after the<Menu>. - A
<Block id="…">is a named group of steps placed directly inside<CallFlow>. It runs only when something sends the call there: a<Goto block="…"/>, the closed hours of an<Hours>step, a function, or someone on the call choosing Transfer › Flow step. A<Goto>never comes back: when the block's steps run out, the call ends. <OnEnd>runs after the call is over, to text the caller.
The XML itself:
- Element and attribute names are case-sensitive, exactly as on this page. An unknown element or attribute is an error.
- Write
&,<and"for&,<and"inside text and attributes. Comments (<!-- … -->) are fine. Namespaces, DTDs and custom entities are not allowed.
The CallFlow element
<CallFlow> is the whole document. It takes no text. Inside it go the steps, up to 50 <Block>s and up to five <OnEnd>s, in any order.
| Attribute | Values | Default | What it does |
|---|---|---|---|
lang |
A language code, like en-IN, hi-IN or en-US |
en-IN on an Indian (+91) line, else en-US |
The language every prompt is spoken in and speech is listened for. A step's own lang overrides it. |
voice |
female, male, or a provider voice like Polly.Aditi or Google.hi-IN-Standard-A |
Your provider's default voice | The voice of every prompt. A <Say> can set its own. |
record |
true or false |
false |
Records answered calls on this line, both sides, including the calls your team makes from it. Play recordings in the call log; they count toward your workspace's storage. |
notice |
Text | None | Said once to an incoming caller just before anyone is first rung for them, when record is on. On calls your team makes, it is said to the person called when they answer. |
transcribe |
true or false |
false |
Your provider writes down what was said. Twilio transcribes during the call; Plivo transcribes the recording after the call. Voicemails follow this unless the <Voicemail> says otherwise. |
international |
true or false |
false |
Lets the flow ring or forward to numbers in other countries. See Outside numbers. |
Tip: tell callers when they are recorded. In many places it is the law. With
record="true"and nonotice, the editor warns you.
Steps at a glance
| Step | What it does | What happens next |
|---|---|---|
<Say> |
Speaks text | The next step |
<Play> |
Plays an audio file | The next step |
<Pause> |
Silence | The next step |
<Goto> |
Jumps to a block | The block's steps; no return |
<If> |
Runs its steps only when a test holds, else its <Else> |
The step after the <If> |
<Hours> |
Checks your opening hours | Open: the next step. Closed: the closed block |
<Menu> |
Asks the caller to press a key or say a word | The chosen option's steps, then the step after the menu |
<Gather> |
Collects digits or speech into a value | The next step |
<Ring> |
Rings people on your team, and outside phones | Answered: the call is theirs. Otherwise the next step |
<Queue> |
Holds the caller with music until someone is free | Answered: the call is theirs. Time up: the next step |
<Forward> |
Rings one outside number or SIP address | Answered: the call is theirs. Otherwise the next step |
<Voicemail> |
Takes a message | The call ends |
<Hangup> |
Ends the call | — |
<Reject> |
Refuses the call without answering it | — |
<Message> |
Texts the caller by SMS or WhatsApp | The next step, at once |
<Function> |
Runs one of your functions, which can choose what happens | The steps it returns (or its <Fallback>), then the next step |
Each step is described below. Attributes marked required must be there; every other attribute can be left out and takes its default.
Say
Speaks the text inside it: required, up to 600 characters, plain text. It can use fill-ins like {{caller.name}}.
| Attribute | Values | Default |
|---|---|---|
voice |
As on <CallFlow> |
The flow's voice |
lang |
A language code | The flow's language |
loop |
How many times to say it, 1 to 10 | 1 |
<Say loop="2">Thanks for calling Example Retail.</Say>
Play
Plays an audio file. Your provider fetches the file from the address you give, so it must be publicly reachable over https and in a format your provider plays, such as MP3 or WAV.
| Attribute | Values | Default |
|---|---|---|
url |
An https:// address (required) |
— |
loop |
1 to 10 | 1 |
Pause
Silence for a moment.
| Attribute | Values | Default |
|---|---|---|
seconds |
1 to 30 | 1 |
Goto
Sends the call to a block. It never comes back to the step after the <Goto>.
| Attribute | Values | Default |
|---|---|---|
block |
The id of a <Block> in this flow (required) |
— |
If and Else
Runs the steps inside it only when its test holds. An optional <Else>, which must be the last thing inside the <If>, holds the steps for when it doesn't. Either way the flow then carries on after the <If>.
Give exactly one test:
| Attribute | Values | True when |
|---|---|---|
known |
true or false |
known="true": the caller's number matched a record in your workspace, such as a customer. known="false": it didn't. |
online |
A phone team key, or * |
At least one person in that team (anyone, for *) could be rung on this line right now: they are Available, not on another call, and still allowed to take calls on the line. |
<If online="support">
<Ring team="support"/>
<Else>
<Say>Our support team is away right now.</Say>
</Else>
</If>
Hours, Days and Closed
Checks the time against your opening hours. When you are open, the flow carries on with the next step. When you are closed, the call goes to the block named in closed.
<Hours> attribute |
Values |
|---|---|
zone |
A time zone like Asia/Kolkata or America/New_York (required) |
closed |
The id of the block to run when closed (required) |
Inside <Hours> put one or more <Days> and up to 100 <Closed>, nothing else.
<Days> attribute |
Values |
|---|---|
on |
Days, comma-separated: sun mon tue wed thu fri sat, ranges like mon-fri (fri-mon wraps over the weekend), or weekdays, weekend, all (required) |
from |
Opening time, 24-hour, like 09:30 (required) |
to |
Closing time, like 18:30, or 24:00 for midnight (required) |
- You are open from
fromup to (not including)to, on the listed days, on the zone's clock. - When
fromis later thanto, the hours run overnight: open fromfromon the listed day untiltothe next morning. fromandtocan't be the same time. For a whole day, use00:00to24:00.
<Closed date="2026-12-25"/> closes a date, written YYYY-MM-DD. It closes the hours that start that day; overnight hours that began the evening before still run into that morning.
<Hours zone="Asia/Kolkata" closed="closed">
<Days on="mon-fri" from="09:30" to="18:30"/>
<Days on="sat" from="10:00" to="14:00"/>
<Closed date="2026-12-25"/>
</Hours>
Menu and Option
Asks the caller to choose. A <Menu> holds 1 to 12 <Option>s and nothing else.
<Menu> attribute |
Values | Default |
|---|---|---|
prompt |
What the caller hears; can use fill-ins (required) | — |
input |
dtmf (keys), speech (spoken words) or both |
dtmf |
retries |
How many more times to ask after a wrong or missing answer, 0 to 3 | 1 |
timeout |
Seconds to wait for an answer, 3 to 15 | 6 |
lang |
The language of the prompt and of the speech it listens for | The flow's language |
hints |
Words and phrases that help the provider recognise speech, comma-separated (up to 50, each up to 100 characters) | Every option's words |
invalid |
Said after a wrong answer, before asking again; can use fill-ins | Sorry, that is not an option. |
<Option> attribute |
Values | Default |
|---|---|---|
key |
0 to 9, * or #, different for each option (required) |
— |
words |
Words or phrases a caller can say for this option, comma-separated (up to 20, each up to 100 characters) | None |
label |
A name for the choice, up to 60 characters | The key |
How a choice is made:
- A pressed key picks the option with that
key(not withinput="speech"). - Speech picks the first option, in the order written, with a word or phrase the caller said as whole words. Upper and lower case and punctuation don't matter (not with
input="dtmf"). - A wrong answer hears
invalidand the prompt again, while retries remain. A caller who says or presses nothing hears the prompt again, while retries remain. - When the retries are used up, the flow carries on with the step after the
<Menu>. - After the chosen option's steps, the flow carries on after the
<Menu>. An option with no steps goes straight there. - The option's
labelis kept on the call: it shows as Menu choice in the call log and during the call, and as{{route}}.
The prompt is what tells callers what each key does, so write it to match your options, for example "Press 1 for sales, 2 for support."
Gather
Collects digits or speech into a value you can use later in the call, as {{vars.<name>}} in text or in a function's input.
| Attribute | Values | Default |
|---|---|---|
var |
A name like order_no: lower-case letters, digits and _, starting with a letter, up to 32 characters (required) |
— |
prompt |
What the caller hears; can use fill-ins (required) | — |
input |
dtmf, speech or both |
dtmf |
digits |
Stop after this many digits, 0 to 32. 0 = until the finish key or the wait ends |
0 |
finish |
The key that ends typing: #, *, or "" for none |
# |
timeout |
Seconds to wait, 3 to 15 | 6 |
retries |
How many more times to ask when nothing was entered, 0 to 3 | 1 |
lang |
Language of the prompt and of the speech it listens for | The flow's language |
hints |
As on <Menu> |
None |
The value kept is the digits typed, or what was said when the input is speech or nothing was typed. A gather has no wrong answers. If the caller gives nothing after the retries, the value is empty and the flow carries on. Up to 200 characters are kept, and a call flow can gather at most 20 different names.
Note: values passed to a function are kept in its run history — never collect card numbers or PINs.
Ring
Rings people on your team, and outside phones if you list them. If someone answers, the call is theirs: when they hang up, the call ends. If nobody answers, the flow carries on with the next step.
Who rings:
| Attribute | Values | Default |
|---|---|---|
team |
A phone team's key | — |
members |
People's user ids, comma-separated, up to 50 | — |
numbers |
Outside numbers in international format, comma-separated, up to 5 | — |
skills |
Skills, comma-separated, up to 5: only team members with every one ring | — |
- With
team, the team's members ring in their priority order. Withmembers, those people ring in the order listed. With neither, everyone who can take calls on the line may ring. - Use
teamormembers, not both.skillsneeds ateam. numberswork only withstrategy="all"(they ring at the same time as the people) or"sequential"(they ring together, after the people). They must follow the outside numbers rules.- People are rung only while they are Available on this line, not on another call, and still allowed to take calls on the line. This is checked again before every ring, so someone who picks up another call drops out. When nobody can be rung, the step is skipped at once.
Tip: phone teams are the easiest way to name people. If you need
members, pick the people on the step in Visual and switch to XML: the builder writes their ids for you.
How it rings:
| Attribute | Values | Default |
|---|---|---|
strategy |
all, round_robin, sequential, longest_idle, least_calls or random |
all |
timeout |
Seconds each ring lasts, 10 to 60 | 25 |
max |
1 to 10. With all: how many phones ring at once. Otherwise: how many people are tried, one after another |
10 |
sticky |
assignee, last_agent, or both in the order to try |
None |
sticky-timeout |
Seconds the sticky ring lasts, 10 to 60 | 15 |
| Strategy | Who rings |
|---|---|
all |
Everyone at once, up to max phones (outside numbers first). The first to answer takes the call. |
round_robin |
One at a time: whoever was rung longest ago on this line goes first. |
sequential |
One at a time, in order: team priority, or the members list. Outside numbers ring together after the people. |
longest_idle |
One at a time: whoever finished their last call longest ago goes first. |
least_calls |
One at a time: whoever answered the fewest calls today (UTC) goes first; ties go to the longest idle. |
random |
One at a time, in random order. |
Sticky rings the caller's own person first, alone, for sticky-timeout seconds, then the strategy carries on as usual without them:
assignee— the person the caller's conversation in the Inbox is assigned to.last_agent— the person who last answered a call from this number, on any line.
The first of them who can be rung right now gets the sticky ring. They don't have to be in the team.
<Ring team="sales" strategy="round_robin" max="4" timeout="20" sticky="assignee,last_agent"/>
Queue
Holds the caller with music and rings someone as soon as anyone is free. If someone answers, the call is theirs. When the wait is over, the flow carries on with the next step.
| Attribute | Values | Default |
|---|---|---|
max-wait |
Seconds this caller waits here, 10 to 1800 | 120 |
music |
default (AxisIQ's hold music), none (silence) or an https:// address of your own audio file |
default |
say |
Said once, when the caller joins; can use fill-ins | None |
team, members, strategy, timeout, max, skills |
As on <Ring> |
Copied from the <Ring> before the queue when the queue names no team or members; otherwise as on <Ring> (all, 25, 10) |
- The caller hears
sayonce, then music. After each stretch of music (about 20 seconds fordefaultandnone, or the length of your own file — 15 to 30 seconds works best) the queue looks for someone who can be rung and rings them: up tomaxphones withall, one person otherwise. Nobody free, or no answer, means more music. - Without its own
teamormembers, a queue rings whoever the nearest<Ring>before it, in the same list of steps, rings, with that ring'sstrategy,timeout,maxandskills. Any of those four the queue sets itself win. With neither a<Ring>before it nor its ownteamormembers, it's an error. - A queue never rings outside numbers and has no sticky ring.
- A caller spends at most 30 minutes in queues in total on one call, even if a
<Goto>sends them back to a queue.
<Ring team="support" strategy="longest_idle" max="3"/>
<Queue max-wait="300" say="All our agents are busy. Please hold."/>
Forward
Rings one outside number or SIP address. If it's answered, the call is theirs. If it isn't answered, is busy, or is refused, the flow carries on with the next step.
| Attribute | Values | Default |
|---|---|---|
number |
A phone number in international format, like +919812345678 |
— |
sip |
A SIP address, like sip:desk@pbx.example.com |
— |
timeout |
Seconds to ring, 5 to 120 | 30 |
caller-id |
line (the person you forward to sees your line's number) or caller (they see the caller's number) |
line |
Give exactly one of number and sip. Both must follow the outside numbers rules.
Voicemail
Asks the caller to leave a message, records it, then ends the call. The message appears in the Inbox and the call log, and whoever the caller's conversation is assigned to is notified (or, if nobody is, the people who were rung).
| Attribute | Values | Default |
|---|---|---|
prompt |
What the caller hears before the tone; can use fill-ins | Nobody can take your call right now. Please leave a message after the tone. |
max |
The longest message, in seconds, 10 to 300 | 120 |
transcribe |
inherit (follow the flow's transcribe), true or false |
inherit |
Hangup
<Hangup/> ends the call. It has no attributes.
Reject
Refuses the call without answering it. Use it before anything is said or played: once the caller has heard something, the call is already answered and the editor warns you.
| Attribute | Values | Default |
|---|---|---|
reason |
rejected or busy (the caller hears a busy line) |
rejected |
Message
Sends the caller a text by SMS or WhatsApp. The call carries on at once; the text is sent just after, so it never holds the caller up.
| Attribute | Values | Default |
|---|---|---|
via |
The key of an SMS or WhatsApp channel you can send on, as shown under Key on the channel (required) | — |
template |
The key of a message template for that channel | None |
to |
{{caller}}, or one phone number in international format |
{{caller}} |
vars |
The template's values, in order, comma-separated (up to 10); can use fill-ins | None |
The text inside is the message: up to 600 characters, with fill-ins. It's required unless you give a template. A WhatsApp message outside a 24-hour reply window must use a template, and the editor warns when one has none. Template values are separated by commas, so a value can't contain one.
Texts are sent as the person who last saved the call flow, through the same path as every other message: the do-not-contact list applies, the text is threaded in the Inbox under the caller's number, and it's linked to the caller's record. Saving a flow with a <Message> needs permission to send on that channel (Can call and send or higher).
A text is skipped, and the call carries on as normal, when:
- the caller's number is withheld, or isn't a phone number;
- the number is in a different country from the SMS or WhatsApp channel's own number (or from the phone line's number, when the channel has none), or AxisIQ doesn't recognise its country (see Outside numbers);
- this step already texted that number in the last 24 hours — a caller who rings five times gets one text a day from each step, not five;
- the line has already sent 30 automatic texts in the last hour;
- the person who last saved the flow has left the workspace or can no longer send on the channel, or the channel or template no longer exists;
- your workspace is read-only because its trial ended without a plan.
Function
Runs one of your functions during the call. The function decides what happens next: say something, ring a team, go to a block, and so on. See Function steps.
| Attribute | Values | Default |
|---|---|---|
name |
The function's name, up to 100 characters; exactly one function may have it | — |
id |
The function's id | — |
timeout |
Seconds to wait for it, 1 to 5 | 3 |
Give exactly one of name and id. Inside a <Function> you may put one <Fallback> holding the steps to run when the function can't be used. Without one, the flow carries on with the next step. Saving a flow with a <Function> needs Can run on Custom code.
Block
A named group of steps, placed directly inside <CallFlow>. Up to 50 per flow.
| Attribute | Values |
|---|---|
id |
Starts with a lower-case letter, then lower-case letters, digits, _ or -; up to 32 characters; different for each block (required) |
Someone on a call can also send it to a block: Transfer › Flow step lists this line's blocks. When the block's steps run out, the call ends.
The editor warns about a block that nothing in the flow goes to, except in flows with a <Function>, which can send a call to any block. A block kept only for transfers gets this warning too; it does no harm.
OnEnd
Runs after an incoming call is over, to text the caller. Placed directly inside <CallFlow>, up to 5 per flow. It runs once per call, never for calls your team makes.
| Attribute | Values |
|---|---|
status |
Which calls it runs for, comma-separated: missed (nobody answered and no message was left), voicemail (the caller left a message), answered (required) |
An <OnEnd> holds only <Message>s and <If known="…"> (with <Else>) around them. The texts follow every <Message> rule above.
Fill-ins
Text can include {{name}} fill-ins, replaced during the call. They work in the text of <Say> and <Message>, in the prompt of <Menu>, <Gather> and <Voicemail>, in <Menu>'s invalid, <Queue>'s say, <Message>'s vars, and in the say a function returns. They don't work anywhere else: not in numbers, addresses or the recording notice.
| Fill-in | Value |
|---|---|
{{caller}} |
The caller's number in international format; empty when it's withheld |
{{caller.name}} or {{contact.name}} |
The caller's name, when AxisIQ knows it (for example from a matching record) |
{{caller.known}} |
true when the caller's number matched a record, else false |
{{contact.record_type}} and {{contact.record_id}} |
The type and id of that record |
{{line}} or {{line.number}} |
This line's number |
{{line.name}} and {{line.key}} |
This line's name and key |
{{route}} |
The label of the last menu option chosen (or the route a function set) |
{{digits}} and {{speech}} |
The last keys pressed and the last words heard, in a menu or a gather |
{{vars.<name>}} |
A value from a <Gather> or a function, like {{vars.order_no}} |
{{call.id}} |
The call's id |
A fill-in that has no value, or that isn't on this list, is left empty. Spaces inside the braces are fine. Each value is cut to 200 characters, and braces and control characters are removed from it.
Function steps
A function step lets your own code decide where a call goes, from anything in your workspace: who the caller is, what they bought, who is free. Write the function in Functions like any other (Write and run a function); it receives the call as its input and returns what to do.
What the function receives
{
"event": "phone.call",
"step": "m/1",
"call": { "id": "019a…", "direction": "in", "started_at": "2026-11-11T09:30:00Z", "route": "Sales" },
"caller": { "number": "+919812345678", "known": true, "record_type": "customers", "record_id": "019a…" },
"line": { "key": "front-desk", "name": "Front desk", "number": "+918047182290" },
"input": { "digits": "1", "speech": "", "confidence": 0 },
"vars": { "order_no": "48213907" }
}
stepsays where the step is in the flow. Treat it as a label.caller.numberis empty when the number is withheld;record_typeandrecord_idare empty when no record matched.inputholds the last keys pressed and words heard in a menu or gather, with the provider's speechconfidencefrom 0 to 1.varsholds every value gathered or set so far on this call.
What it returns
Return an object. Every field is optional:
| Field | Value | What it does |
|---|---|---|
say |
Text | Said first |
vars |
An object of names to text, numbers or true/false, like { "tier": "gold" } |
Stored for the rest of the call as {{vars.<name>}} (names as on <Gather>, up to 20) |
route |
Text, up to 60 characters | Kept on the call as its Menu choice |
Then at most one action. When several are present, the first in this list wins:
| Field | Value | What it does |
|---|---|---|
hangup |
true |
Ends the call |
voicemail |
true |
Takes a message, with the default prompt |
forward |
A number in international format | Forwards the call, under the outside numbers rules |
ring |
{ team, members, numbers, strategy, timeout, sticky } |
Rings, as <Ring> does. members and numbers can be a list or comma-separated text |
goto |
A block's id | Sends the call to that block |
The steps it returns run in place of the function step, and then the flow carries on with the step after the <Function> (unless they ended the call, someone answered, or goto sent the call to a block, which never comes back). Returning nothing, null or {} carries straight on with the next step. Any other field in the object is ignored.
When the fallback runs
The <Fallback> steps run instead, followed by the step after the <Function>, when:
- the function throws an error or runs out of time;
- it returns something that isn't an object or is larger than 16 KB, or an action that would be an error in the call flow itself: a block or phone team that doesn't exist, a number not in international format, an unknown strategy, or a
timeoutoutside 10 to 60; - the function has been deleted or switched off, or Functions is off for your workspace (the editor warns about this);
- the person who last saved the call flow has left the workspace or can no longer run functions;
- the function's author has left the workspace, or neither that person nor the person who last saved the flow can do everything the other can (see Whose permissions it uses);
- your workspace is read-only because its trial ended without a plan;
- the function steps between two moments the caller waits have used up their 5 seconds (see Time);
- the call has already used 8 function results and transfers.
A number the function returns that is in international format but breaks another outside numbers rule doesn't take the fallback: it is skipped, and the flow carries on after the <Function>.
Time
timeout gives a function step 1 to 5 seconds (3 by default), within the function's own time limit. All the function steps that run between two moments the caller waits (a menu, a gather, a ring) share 5 seconds, so a second function there may get less time; the editor warns when two can run back to back. Keep these functions quick: a record search or two.
Your provider may repeat a request, so a function step can run twice for the same moment of a call. Make it safe to run again.
Whose permissions it uses
The function runs as the person who last saved the call flow, with the fewer permissions of that person and the function's author, the same rule as for flows (Limits and permissions). If neither can do everything the other can, the run is refused and the step takes its fallback. Each run appears in the function's run history, with its input.
Phone helpers
Besides the usual axis toolkit, a function can ask about your phone lines. These need Can view or Can take calls on the line.
| Call | Returns |
|---|---|
axis.phone.lines() |
[{ key, name, number, provider, enabled }] — the lines you can see |
axis.phone.online(line, { team }) |
[{ user_id }] — exactly who would ring on that line right now, optionally only from one team. line is the line's key |
axis.phone.teams() |
[{ key, name, members: [{ user_id, priority, skills }] }] |
Example
This function is the router used in Example 4. It looks the caller up in a customers record type and sends gold customers to their account team when someone there is free:
function handler(input) {
// A withheld number has nothing to look up: carry on with the next step.
if (!input.caller.number) return null;
const found = axis.records.search("customers", {
filters: [{ field: "phone", op: "eq", value: input.caller.number }],
limit: 1,
});
const customer = found.records[0];
if (!customer) return null;
const tier = customer.values.tier || "standard";
if (tier === "gold") {
// Only go to the account team if someone there can take the call now.
const free = axis.phone.online(input.line.key, { team: "key-accounts" });
if (free.length > 0) {
return { route: "Gold", vars: { tier: tier }, goto: "gold" };
}
}
return { vars: { tier: tier } };
}
Outside numbers
These rules apply to every number or SIP address outside your team: <Forward>, <Ring numbers>, and a function's forward and ring.numbers.
- A phone number must be in international format, with
+and the country code. A SIP address starts withsip:. - A phone number must be in the same country as the line, unless
<CallFlow>hasinternational="true". If AxisIQ doesn't recognise the country of the line or the number, it counts as a different country. - It can't be one of your workspace's own phone lines, so calls can't loop between lines.
- It can't be on the do-not-call list.
- Saving a flow that calls outside numbers needs Can take calls (or higher) on the line.
Numbers are checked when you save (an error on that line) and again on every call. A number that fails during a call is skipped and the flow carries on, and so is every outside number when the person who last saved the flow can no longer take calls on the line.
Numbers in a call flow are written as they are: fill-ins can't be used in them. For a number that depends on the caller, return it from a function.
AxisIQ recognises the country of numbers starting with +1, +27, +31, +32, +33, +34, +39, +41, +43, +44, +45, +46, +47, +48, +49, +52, +55, +60, +61, +62, +63, +64, +65, +81, +91, +351, +353, +358, +420, +852, +971 and +972. All +1 numbers (the US, Canada and the Caribbean) count as one country. A line elsewhere needs international="true" to ring or forward to any outside number. Automatic texts go only to a number in one of these countries, and the same one as the messaging channel's number; international doesn't change that.
Limits
| What | Limit |
|---|---|
| Size of the call flow | 64 KB |
| Elements | 500 |
| Blocks | 50 |
| Steps inside steps | 8 levels deep |
| Text of one element | 600 characters |
| One attribute | 500 characters |
| Options in a menu | 12 |
<OnEnd> elements |
5 |
Closed dates in one <Hours> |
100 |
| Different gathered names | 20; each value up to 200 characters |
| Phones ringing at once | 10 |
| Automatic texts per line | 30 an hour, and one a day per number from each step |
Each call is also protected from flows that go round in circles:
- Between two moments the caller waits, a call can run up to 64 steps and 16
<Goto>s. A call can run up to 400 steps in all. Past either limit the caller hears "Sorry, we cannot take your call right now." and the call ends. - A call that has been in the call flow for an hour without being put through to someone goes to voicemail (when the flow has a
<Voicemail>) or hears an apology and ends. - A connected call lasts at most 4 hours.
- A caller waits at most 30 minutes in queues in total.
- Function steps share 5 seconds between two moments the caller waits, and a call can use up to 8 function results and transfers.
Twilio and Plivo
The same call flow runs on both providers. Where your line's provider can't do something, or does it differently, the editor shows a warning naming the provider, and calls behave as the warning says. Warnings never stop a save.
| Provider | When | What happens |
|---|---|---|
| Twilio | The line is an Indian (+91) number | Twilio can't carry domestic calls inside India. Use a Plivo line for Indian numbers. |
| Twilio | voice="female" or "male" in a language with no standard Twilio voice |
Twilio's default voice is used. Set a Polly.* or Google.* voice instead. |
| Twilio | <Queue> |
While someone is being rung, the caller hears ringing, not music. |
| Twilio | A voicemail is transcribed in a language other than US English | Twilio transcribes voicemail in US English only. |
| Twilio | A transcribed <Voicemail max> over 120 seconds |
Messages over 2 minutes aren't transcribed. |
| Plivo | A Google.* voice |
Plivo has no Google voices; its default voice is used. |
| Plivo | Speaking a language Plivo can't speak | The prompt is read in US English. |
| Plivo | female or male where Plivo has only the other one |
The other voice is used. |
| Plivo | A <Menu> or <Gather> timeout under 5 |
Plivo waits at least 5 seconds. |
| Plivo | Speech input in a language Plivo may not recognise | Test a call; keys still work. |
| Plivo | <Forward caller-id="caller"> |
The person you forward to sees your line's number, unless your Plivo account allows caller ID pass-through (never for Indian numbers). |
| Plivo | transcribe="true" without record="true" |
No transcript: Plivo transcribes only recorded calls. |
| Plivo | transcribe="true" with record="true" |
The recording is transcribed after the call, not during it. |
| Plivo | Transcribing a call or voicemail in a language other than English | Plivo transcribes English only. |
| Both | record="true" |
Recording stops when a call is put on hold, transferred with a consult, or joined by a third person. |
Languages each provider speaks with voice="female" and voice="male":
- Twilio:
en-US,en-GB,en-AU,en-IN,hi-IN,bn-IN,te-IN,mr-IN,gu-IN,kn-IN,ml-IN,ta-IN,es-ES,fr-FR,de-DE,ar-AE. Other languages use Twilio's default voice, or aPolly.*orGoogle.*voice you name. - Plivo:
en-US,en-GB,en-AU,es-ES,es-US,fr-FR,de-DE,it-IT,nl-NL,da-DK,pl-PL,pt-BR; female only inen-IN,hi-IN,fr-CA,ru-RUandsv-SE; male only inpt-PT. Other languages are read in US English. - Plivo speech recognition:
en-US,en-GB,en-AU,es-US,es-ES,fr-FR,de-DE,it-IT,pt-BR,ja-JP,zh-CN. Speech in other languages may not be recognised.
The editor also warns, for every provider, when:
- callers can reach the end of the main steps or of a block, where they are hung up on — end with
<Voicemail/>,<Hangup/>,<Forward>or<Goto>; - nothing goes to a block;
- a
<Reject>comes after the caller has heard something; - a team has no members, or more than 10 with
strategy="all"(only the first 10 available ring); - a person listed in
membersisn't in the workspace; record="true"has nonotice;- a WhatsApp
<Message>has no template; - Functions is off, so a
<Function>always takes its fallback; - two function steps can run back to back and share their 5 seconds.
If calls on a line arrive without a valid signature from your provider, the call flow page says so. Calls still ring, but for those calls no texts are sent, function steps take their fallback, and call controls don't work. This usually means the auth token in the line's settings is no longer your provider's current one: edit the phone line and enter the current token.
Examples
Each example is a complete call flow. They use phone teams called sales, support, billing, key-accounts and delivery, an SMS channel with the key example-sms and a WhatsApp channel example-wa; replace them with your own.
1. Office hours, a menu and voicemail
Closed outside office hours and on Christmas. During hours, callers choose sales, support or the address. If nobody in the chosen team answers, everyone available is rung, then the caller can leave a message. Calls are recorded, with a notice.
<CallFlow lang="en-IN" voice="female" record="true" notice="This call may be recorded for quality and training.">
<Hours zone="Asia/Kolkata" closed="closed">
<Days on="mon-fri" from="09:30" to="18:30"/>
<Days on="sat" from="10:00" to="14:00"/>
<Closed date="2026-12-25"/>
</Hours>
<Say>Thanks for calling Example Retail.</Say>
<Menu prompt="Press 1 for sales, 2 for support, or 9 to hear our address." retries="2">
<Option key="1" label="Sales">
<Ring team="sales" strategy="longest_idle" max="3" timeout="20"/>
</Option>
<Option key="2" label="Support">
<Ring team="support" strategy="round_robin" max="3" timeout="20"/>
</Option>
<Option key="9" label="Address">
<Say>We are at 12 MG Road, Pune. We are open Monday to Friday, 9:30 to 6:30, and Saturday 10 to 2.</Say>
<Hangup/>
</Option>
</Menu>
<Ring/>
<Voicemail/>
<Block id="closed">
<Say>We are closed right now.</Say>
<Voicemail prompt="Leave your name and number after the tone, and we will call you back."/>
</Block>
</CallFlow>
2. A spoken menu in Hindi, on Plivo
Callers can press a key or say what they want, in Hindi or English. Plivo may not recognise Hindi speech well, and the editor says so: test a call, and keep the keys in the prompt so they always work.
<CallFlow lang="hi-IN" voice="female">
<Say>Example Retail में कॉल करने के लिए धन्यवाद।</Say>
<Menu prompt="बिक्री के लिए 1 दबाएँ या सेल्स बोलें। सहायता के लिए 2 दबाएँ या सपोर्ट बोलें।"
input="both" retries="2" timeout="8" invalid="माफ़ कीजिए, समझ नहीं आया। फिर से बोलिए।">
<Option key="1" label="Sales" words="सेल्स,बिक्री,खरीद,sales">
<Ring team="sales"/>
</Option>
<Option key="2" label="Support" words="सपोर्ट,सहायता,शिकायत,support">
<Ring team="support"/>
</Option>
</Menu>
<Ring/>
<Voicemail prompt="अभी कोई उपलब्ध नहीं है। बीप के बाद अपना संदेश छोड़ें।"/>
</CallFlow>
3. A queue with your own hold music
Up to three support agents are tried one at a time. If none answers, the caller holds with your music for up to five minutes while the queue keeps looking for someone free. After that, the billing team rings if anyone there is available, then voicemail.
<CallFlow lang="en-US">
<Say>Thanks for calling Example Retail support.</Say>
<Ring team="support" strategy="longest_idle" max="3" timeout="20"/>
<Queue max-wait="300" music="https://example.com/audio/hold-30s.mp3"
say="All our agents are busy. Please stay on the line and we will be with you shortly."/>
<If online="billing">
<Say>Connecting you to our billing team.</Say>
<Ring team="billing"/>
</If>
<Voicemail prompt="Sorry for the wait. Leave a message and we will call you back today."/>
</CallFlow>
4. A function picks the route
The router function from Function steps sends gold customers to the gold block. Everyone else rings support. If the function fails, the fallback rings support too, then goes to voicemail, so nobody is rung twice.
<CallFlow lang="en-IN">
<Say>Thanks for calling Example Retail.</Say>
<Function name="router" timeout="3">
<Fallback>
<Ring team="support"/>
<Goto block="message"/>
</Fallback>
</Function>
<Ring team="support"/>
<Goto block="message"/>
<Block id="gold">
<Say>Welcome back. Connecting you to your account team.</Say>
<Ring team="key-accounts" strategy="sequential" sticky="assignee,last_agent"/>
<Goto block="message"/>
</Block>
<Block id="message">
<Voicemail/>
</Block>
</CallFlow>
5. Forward to an on-call phone outside hours
During office hours, up to five people are rung one at a time. Outside them, the call goes to the on-call technician's mobile, with voicemail if they don't pick up.
<CallFlow lang="en-US" voice="male">
<Hours zone="America/New_York" closed="after-hours">
<Days on="mon-fri" from="08:00" to="20:00"/>
</Hours>
<Ring strategy="round_robin" max="5"/>
<Voicemail/>
<Block id="after-hours">
<Say>Our office is closed. Connecting you to our on-call technician.</Say>
<Forward number="+14155550123" timeout="25"/>
<Voicemail prompt="Our on-call technician could not answer. Please leave a message and we will call you back."/>
</Block>
</CallFlow>
6. Ask for an order number, then ring
The caller types their order number. A function, order-status, reads it from vars.order_no, tells the caller where the order is, and labels the call. Then the delivery team rings.
<CallFlow lang="en-IN">
<Say>Thanks for calling Example Retail deliveries.</Say>
<Gather var="order_no" prompt="Please type your order number, then press the hash key." retries="2"/>
<Function name="order-status">
<Fallback>
<Say>Sorry, we can't look up orders right now.</Say>
</Fallback>
</Function>
<Say>Connecting you to our delivery team.</Say>
<Ring team="delivery" strategy="longest_idle" max="3"/>
<Voicemail prompt="Please leave your order number and a message after the tone."/>
</CallFlow>
The function, for an orders record type with order_no and status fields:
function handler(input) {
const no = input.vars.order_no;
if (!no) return null; // nothing typed: carry on
const found = axis.records.search("orders", {
filters: [{ field: "order_no", op: "eq", value: no }],
limit: 1,
});
const order = found.records[0];
if (!order) return { say: "We could not find that order number.", route: "Order not found" };
if (order.values.status === "delivered") {
return { say: "Our records show this order was delivered. Thank you for calling.", route: "Delivered", hangup: true };
}
return { say: "Your order is " + order.values.status + ".", route: "Order " + order.values.status };
}
7. Text callers you missed
A caller nobody answers who hangs up without leaving a message gets a text. Callers who match a record are greeted by name. A caller who leaves a voicemail gets a WhatsApp thank-you from an approved template (voicemail-thanks, with the line's name as its one value).
<CallFlow lang="en-IN">
<Say>Thanks for calling Example Retail.</Say>
<Ring timeout="30"/>
<Voicemail/>
<OnEnd status="missed">
<If known="true">
<Message via="example-sms">Hi {{caller.name}}, sorry we missed your call. We will ring you back within the hour.</Message>
<Else>
<Message via="example-sms">Sorry we missed your call to Example Retail. Reply here with what you need and we will get back to you.</Message>
</Else>
</If>
</OnEnd>
<OnEnd status="voicemail">
<Message via="example-wa" template="voicemail-thanks" vars="{{line.name}}"/>
</OnEnd>
</CallFlow>