The pattern
- Call connects. DialNexa has
{{caller_number}}(the caller’s phone number in E.164 format). - A function call queries your CRM/database with
{{caller_number}}as the lookup key. - The CRM returns the customer record (or signals no record found).
- Variables populate from the response:
{{customer_name}},{{account_tier}},{{last_service}}, etc. - The agent’s greeting and subsequent turns use these variables.
Implementation: single-prompt agents
In a single-prompt agent, caller lookup is implemented by defining a CRM lookup function in the agent’s Tools and instructing the agent to call it at the start of every conversation. Step 1: Define the lookup function In Settings > Tools, add a function:lookup_caller function. Your endpoint receives:
Instruct the LLM to call the function before its first verbal response. Without this instruction, the LLM may greet the caller first and then call the function, causing the personalization to appear mid-conversation rather than at the start.
Implementation: conversational flow agents
In a conversational flow agent, implement the lookup as a Function Node at the very start of the flow, before any greeting node.Add a Function Node as the first node
Place a Function Node at the start of your flow, connected from the call start trigger. Do not put a greeting node before it.
Configure the function call
Set the function to
lookup_caller (or your equivalent). Pass {{caller_number}} as the phone number parameter.Map response fields to variables
In the Function Node’s response mapping, map each returned field to a variable:
| Response field | Variable |
|---|---|
customer.name | {{customer_name}} |
customer.tier | {{account_tier}} |
customer.last_service_type | {{last_service}} |
found | {{caller_found}} |
Branch on lookup result
Connect two branches from the Function Node:
- Caller found (condition:
{{caller_found}} == true) → personalized greeting node - Caller not found / error → generic greeting node that asks for the caller’s name
CRM query examples
REST API (typical CRM):Handling lookup failures
Your CRM lookup can fail in three ways:- No record found: caller is new. Proceed without personalization or ask for their name.
- Function call timeout: your endpoint did not respond within the timeout window. Default to no personalization; log the error for investigation.
- Function call error: your endpoint returned an error status. Treat the same as timeout.
| default: guards on all variables that come from the lookup:
Privacy considerations
The caller’s phone number ({{caller_number}}) is available by default. If your data handling policy restricts phone number use for lookup purposes, do not implement this pattern without confirming compliance. The phone number passed to your function endpoint is subject to your privacy policy and any applicable regulations (GDPR, PDPA, DPDPA).