Dynamic Transfers
In some situations, you may not know in advance which phone number you need to transfer a call to, or what message should be played to the user during the transfer. Custom variables let you handle these dynamic scenarios easily.
Learn more about how custom variables work here: https://docs.synthflow.ai/custom-variables
Creating custom variables
Custom variables can be created in different situations:
-
Injected before the call starts using a pre-call webhook
-
Collected during the call as a result of a custom action.
Returning Phone Numbers from Custom Actions
Custom actions can now return phone numbers dynamically that can be used for call transfers. When your custom action returns a response containing a phone number, you can reference it in your transfer action using template syntax.
How it works:
- Your custom action makes an API call which returns a list of potential transfer targets.
- The action response is available to the agent, which prompts the user to select their desired transfer target.
- The agent triggers a transfer to the target using the target variable.
Custom Action API Response Format Example:
Using the Returned Phone Number:
When your custom action returns an array of potential transfer targets, the agent can intelligently select the appropriate one based on the conversation context.
Setting up the Actions:
In the Custom Action:
- Configure your custom action to call your API endpoint
- In the “Available Action Results” section of the custom action, select the following fields:
- Enable
status
(the action status) - Enable
results
(the results object) - Enable
results.data
(the array containing your transfer targets)
- Enable
In the Transfer Action:
- In the transfer action’s phone number field, enter a variable name like
phone_number
The agent will have access to the full array of transfer options from the custom action and will intelligently select the appropriate phone number based on the user’s request during the conversation. The selected phone number will be passed as the phone_number
argument to the transfer tool.
For example, if the user says “transfer me to sales”, the agent will look through the results.data
array, identify the sales department entry, and use that phone number for the transfer.
The system will automatically detect this as a dynamic transfer and extract the phone number at runtime.
Using a custom variable to route the call
Method 1: Using Pre-defined Variables
-
Create a new transfers action
-
Instead of entering a phone number to transfer, click variables and select the variable you created which represents a phone number.
Method 2: Using Custom Action Results (Dynamic Transfer)
-
Create a custom action that returns a phone number
-
In your transfer action, reference the returned value using template syntax:
- For example:
{results.data.phone_number}
- The system automatically detects this pattern and configures the transfer as dynamic
- The phone number is extracted and normalized at runtime
- For example:
Using Custom Variables in Spoken Messages during the transfer
You can also use custom variables to control what is spoken to the transfer target or the customer during the transfer.
Within a Call Transfer action:
-
Open the text fields for the messages you want to customize.
-
Insert your variables using curly braces
{ }
— for example:
This will dynamically replace {team_name}
with the value of your variable during the call.
Example Use Cases:
-
Route calls to a different team based on real-time data.
-
Announce personalized information (like order numbers or account balances).
-
Pass custom context into a transfer so the receiving agent knows who’s calling and why
-
Fetch phone numbers from CRM systems during the call to route to the assigned account manager
-
Route to on-call staff by querying your scheduling system for the current on-call phone number
-
Dynamic escalation paths based on customer tier or issue severity
-
Location-based routing by determining the nearest office or agent based on caller’s location
Practical Example: Dynamic Customer Support Routing
Here’s a complete example of using a custom action to dynamically route calls:
Step 1: Custom Action Configuration
Create a custom action that queries your CRM or routing system for available agents:
Endpoint: https://api.yourcompany.com/get-available-agents
Request:
Response:
Step 2: Action Configuration
Custom Action:
- Configure the custom action to call the API endpoint above
- In the custom action’s “Available Action Results” section:
- Select
status
,results
, andresults.data
- Select
Transfer Action:
- In the transfer action’s phone number field, enter
phone_number
as the variable name
Step 3: How It Works
During the call, when a customer requests a transfer:
- If they say “I need help with my bill”, the agent will select Sarah Johnson
- If they say “I can’t log in”, the agent will select Mike Chen
- If they say “I want to upgrade my plan”, the agent will select Lisa Park
The agent intelligently matches the customer’s request to the appropriate agent based on their specialty and department, then passes the selected phone number to the transfer action.