Inbound Call
Automate inbound calls with AI Agents
This example shows how to listen to inbound calls to a phone number and have an AI Agent handle the call.
The following image shows a typical workflow for an inbound call.
Inbound to number trigger
It all starts with a trigger that listens to inbound calls to a phone number. You can find this event in Phone calls > Inbound to number.
The To number field in the configuration defines what phone number you want to listen to. You can manage your phone numbers in your organization’s numbers settings. You can get there if you click on the organization’s name at the top of the left sidebar. Then, click on “Organization settings” to open the settings. Once there, go to the Number’s section on the sidebar. You can Buy a new number, rename existing numbers, or delete numbers.
You can also get to the numbers settings by opening the “To number” dropdown and clicking on the “numbers page” blue link at the bottom of the dropdown.
You can learn more about the other configuration options in the Inbound to number trigger reference page.
Once configured, make a call to the number and refetch the testing records in the Test tab.
Inbound Voice Agent
After we get a new call, we want to have an AI Agent handle it. You can add an AI Agent > Inbound Voice Agent action right after the trigger.
Configure the agent with a name, voice, and other options. Learn more about the options in the Inbound Voice Agent reference page.
Remember to test it before continuing.
Every agent consists of what we call modules. A module consists of a prompt and tools. The agents come with a root module, which is the first module that the agent will start at. Tools are the actions that the agent can perform, such as sending an email, sending a text, or transfering a call.
If you add a prompt as child to a tool, you’re creating a new module. This means the agent will transition to that prompt and set of tools.
If the agent transitioned, it no longer sees the prompts or tools of the previous modules.
Modules are a good way to structure your agents and keep the prompts short and concise. This helps the agent to focus on the sub-task at hand.
Prompt
You can edit the prompt for the module by clicking on the prompt node and editing the text. You can of course use variables to make your prompt more dynamic.
You can also congure the prompt to define it’s initial message or model. The initial message is the first message that the agent will say when the module starts.
Following is an example of a prompt:
Note that we’re using variables in the prompt as well. Consider putting those towards the end of the prompt, as it might make the agent faster to respond.
Tools
You can add tools to the module by clicking on the plus button below the prompt node.
Every tool consists of a tool node and a list of actions. The tool node is always the first action in the tool sequence.
When configuring the tool function, you’ll need to provide:
-
Description: A description of the tool and when it should be used.
-
Message: Whether the agent should say something before executing the tool. There’s 3 modes:
- AI: let the agent decide what to say based on the prompt and example you provide.
- Fixed: The agent will say the fixed message you provide.
- None: The agent will not say anything, just call the tool.
-
Parameters: List of parameters the agent will try to provide when calling the tool. Each parameter has a name, an example, and a description. Also, each parameter can be required or optional. If you need the agent to always try to provide a value of the parameter, mark it as required by clicking on the asterisk button ”*”.
-
On hold music: Whether the agent should play music while waiting for the tool to finish.
After the tool node, you can add a sequence of actions. These actions will be executed in order and are configured in the same way as actions outside of the agent.
AI Classification
The execution of the run will block until the agent has finished. After that, anything below the agent node will continue it’s execution.
After the call we add an AI > Classify node to classify the call. This node requires a prompt, an input and a set of tags.
-
Prompt: The prompt to use for the classification. Try to add as much context as possible, like what the conversation was about.
-
Input: The input to use for the classification. This will typically be the transcript of the call. You can access the “Transcript” variable from the Agent’s output.
-
Tags: The tags to use for the classification. This is the set of tags that the agent will use to classify the call.
AI Extract
After the classification, we add an AI > Extract node to extract information from the call. This node requires a prompt, an input and a set of tags.
-
Prompt: The prompt to use for the extraction. Try to add as much context as possible, like what the conversation was about.
-
Input: The input to use for the extraction. This will typically be the transcript of the call. You can access the “Transcript” variable from the Agent’s output.
-
Parameters: The parameters to extract. Similar to the parameters in the tool node, you can define a name, an example, and a description, as well as if it’s required or optional.
POST
After the extraction, you might want to send the extracted information to your system. You can do this by adding a Webhook > POST node.
This node will send a POST request to the URL you provide. You can configure the request by adding a URL, Body and Headers.
You can send back any variable, such as the transcript, the classification, or the extracted information.
Was this page helpful?