Inbound Call Variables in workflow
# support
j
How do you access the inbound phone number in a workflow as a variable? It doesn't seem to work with the normal liquid js templating the way it does in a prompt.
v
Hi there! 👋 I understand you're having trouble accessing the inbound phone number in a workflow using LiquidJS templating. While I can't explain exactly why LiquidJS templating works differently in workflows compared to prompts, I can definitely help with how to access the inbound phone number in a workflow! Here are several ways to access the inbound phone number in a Vapi workflow: 1. **Using the
{{customer.number}}
variable**: This variable returns the E.164 formatted number (with the + prefix) and is commonly used to access the caller's phone number. According to [information I found](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1344558158349209675), this variable might work for inbound requests as well. 2. **Extracting from request body**: You can access inbound call parameters directly from the request body using:
Copy code
javascript
   const caller = req.body.Caller;
This method is mentioned in the [documentation for on-hold specialist transfers](https://docs.vapi.ai/phone-calling/on-hold-specialist-transfer). 3. **Accessing call parameters**: According to [information in Discord](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1343574701909344297), you can extract parameters like this:
Copy code
javascript
   Caller = request_body.get("Caller", "")
   CallSid = request_body.get("CallSid", "")
   To = request_body.get("To", "")
   From = request_body.get("From", "")
4. **Using variable values**: You might be able to access variables using
message.variableValues.variable_name
or
messages.assistantOverrides.variableValues.variable_name
as mentioned in [this Discord thread](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1329772290497318973). If you're still having trouble with accessing the inbound number, would you like me to help troubleshoot your specific implementation or provide more details on any of these methods? Sources:
j
The customer.number variable is not working within the liquid js in the workflow . How would you access it within a workflow prompt block?
@Vapi pls help more?
k
Hey! To help track down this issue, could you share: - The call ID - What response you expected to get - What response you actually got instead This would really help us figure out what went wrong!
j
@Shubham Bajaj I wasn't expecting a specific response, it just doesnt accept the templated customer.number like it does in a normal template within the workflow. I can build an echo endpoint to return that info out of the toolcall it makes as part of the flow, but i dont feel that should be necessary, and it limits its accessibility to non-devs. when i template {{customer.number}} in to the workflow say block, it skips past it as though it were empty. In your docs for workflow the ui shown is different as well.. Is there some way to get the inbound call vars that doesnt involve an echo endpoint in a workflow?
k
Hey, could you share the call ID because the dynamic variables work for workflows as well? Sharing the call ID will help me debug, what would have went wrong for you
Lastly, apologies for the delay. I was out of office for couple of days.
o
same issue
k
Hey out higher please ping me to your supporting.
Hey @jsieber-eip, a gentle reminder to continue the statement.
ticket -> statement.
j
@Shubham Bajaj we are moving to telnyx flow for our IVR development since its a little more mature and purpose built, and using vapi for our outbound flows still. I tried to reproduce it on this call id right now : 90b02bfa-ffb2-4ffb-82f4-ebc4236a3c12
@Shubham Bajaj For outbound vapi has been great with the basic prompt based interactions, but for the more business critical use cases we are shifting away for now ( inbound support flows with high traffic)
s
@jsieber-eip please check your DM.
d
we have same problem with {{customer.number}}. Any suggestions on how to fix it?
k
Please provide details of your issue and steps taken to resolve it. This will help me understand your challenges and tailor suggestions. I can propose new solutions or enhance existing approaches. 
d
We prepare solution for inbound call. When customer calls, we want to find information about them in our DB. (Case is about unpaid invoice) So we have prepared API request for it, but we have a problem with default variable customer.number. It does not work. I tried using it in "Say prompt" but it did not work (others default variables are fine). WE use Twilio number. So I tried to check if it's working without workflow, and there are no problems. Vapi can provide number. Then I tried to use this assistant that can say callers telephone number in workflow, but same problem customer.number did not work
k
To utilize the customer number in your prompt or workflow, please adhere to the following syntax within your prompt.
Copy code
{{customer.number}}
I suggest you check out this documentation; it will help with your use case.
j
@Shubham Bajaj that was not working in the workflow and was not available when testing the inbound calls previously. @defichk seems to be having the same problem.
s
@jsieber-eip @defichk @outhire Thanks for highlighting the problem that call personalization doesn't work with workflows. I will Make sure this gets added to the workflows quickly within a week.
g
Hello! Has anyone been able to figure this out? I read a lot of questions on the same topic but there doesn't seem to be a definitive answer. Only links to the docs @Shubham Bajaj
Have you figured this out?
s
@geramalagon @jsieber-eip @defichk @outhire Hello everyone call personalization with workflows is coming by week’s end. We’re adding support for workflow overrides through Assistant Request server messages, with the update landing in the weekly channel by Friday. To test immediately, move to the daily channel tomorrow, or wait for the weekend release on weekly. I’d love your feedback once you’ve given it a spin.
22 Views