https://retellai.com/?utm_source=discord&utm_medium=seo logo
# GoalHandle calls efficiently through structured ...
# ❓・ai-evy-support
a
@AI Evy # Goal Handle calls efficiently through structured flow: 1. Start the call (CRITICAL): - Check the
{{customer_name}}
variable immediately. - IF
{{customer_name}}
contains a name (e.g., "Alex"): You MUST start with: "Hi {{customer_name}}! Welcome to King Nails! How can I help you today?" - ELSE (if
{{customer_name}}
is empty, missing, or "unknown"): Start with: "Hi! Welcome to King Nails! How can I help you today?" - Do NOT ask for the name if you just used it in the greeting. 2. Gather necessary details (service, date/time preferences, stylist preference) using the slot rules below. 3. Use tools to check availability, book, reschedule, or cancel. 4. Confirm all details clearly before finalizing. 5. Provide clear next steps (reminders, prep instructions, promotions). 2025-12-30 00:04:06.873 call_1a2a3fe5db952b7b05039940850 info: inbound call_inbound webhook response: { call_inbound: { dynamic_variables: { customer_name: ‘Jake’, n8n_number: '+11234567891, phone: '11234567891', phone_last4: ’7891’, customer_exists: true }, agent_override: { retell_llm: [Object] } } } Agent: Hi! Welcome to King Nails! How can I help you today? 
Why does ai not recognize name from dynamic variables from n8n payload?
a
Thanks for tagging me @alexh_revanov. I'll look through relevant sources and get back to you shortly.
### Answer Based on your log, the dynamic variables are being received correctly by Retell (
customer_name: 'Jake'
) , but the agent isn't using them in the greeting. Here are a few things to check: 1. Verify the variable syntax in your prompt Make sure you're using the exact syntax
{{customer_name}}
in your begin message or prompt. [(1) ]() 2. Check where you're setting the begin message If your greeting is configured in the Begin message field, dynamic variables should work there. 3. Potential timing/evaluation issue There's a known pattern where dynamic variables passed via the inbound webhook may not always be picked up by the agent. Community members have reported success using this exact response format from their n8n webhook: [(2) ]() , [(3) ]()
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
      "customer_name": "Jake"
    }
  }
}
Your log shows this structure is correct. However, ensure: - The response is returned synchronously before the call connects - The webhook is responding with the correct content-type (
application/json
) - There are no extra wrappers around the response (some n8n nodes add array brackets) 4. Test with a simple agent Create a minimal test agent where the only instruction is to speak the dynamic variable value (e.g., "Say: The customer name is {{customer_name}}") . This helps isolate whether the issue is with variable passing or prompt logic. [(2) ]() 5. Check the Data tab in Call History In the Retell dashboard, under the call's Data tab, verify that
customer_name
appears in the dynamic variables section. If it's missing there, the webhook response isn't being processed correctly. [(3) ]()
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Dynamic Variables](https://discord.com/channels/1186424376300679209/1356680357084135558) [[3] Dynamic Variable and n8n](https://discord.com/channels/1186424376300679209/1357551375416037469) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
In the Retell dashboard, under the call's Data tab, verify that customer_name appears in the dynamic variables section. If it's missing there, the webhook response isn't being processed correctly. ( it dodsn't show up, why?
@AI Evy it doesn't show up under Data why?
a
Thanks for the follow-up, @alexh_revanov. I'll get back to you soon.
### Answer If the dynamic variables don't appear in the Data tab of your call history, the inbound webhook response isn't being processed correctly by Retell. Here are the most likely causes: 1. Webhook response structure For inbound calls, you need to set the webhook at the phone number level, not the agent level. The inbound webhook is called before the call starts, and you respond with the variables you want to set. [(1) ]() 2. Response timing The inbound webhook must return a response synchronously before the call connects. If your n8n workflow takes too long or returns asynchronously, Retell may not receive the variables in time. 3. Incorrect response format Ensure your webhook response uses the exact structure expected. Based on your log, the structure looks correct, but verify: - Content-Type header is
application/json
- No extra array wrappers (some n8n nodes add
[]
around responses) - The response body is returned directly, not nested in additional objects 4. Variable names must match exactly Dynamic variables must be sent as strings and match the exact names (case-sensitive) used in your prompt. [(2) ]() 5. Check webhook configuration Confirm the inbound webhook URL is configured on the phone number settings, and that Retell is actually calling your webhook. You can verify this by checking your n8n execution logs to see if the webhook was triggered. If metadata and
retell_llm_dynamic_variables
are not provided correctly, they will be omitted from the call data entirely. [(1) ]()
​ To learn more, see the sources I considered: [[1] Webhook response different from docs](https://discord.com/channels/1186424376300679209/1420598719224746095) [[2] dynamic variables are not being used even though in data tab it was captured](https://discord.com/channels/1186424376300679209/1380529470468919320) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@AI Evy well i told you this was the response { call_inbound: { dynamic_variables: { customer_name: ‘Jake’, n8n_number: '+11234567891, phone: '11234567891', phone_last4: ’7891’, customer_exists: true }, agent_override: { retell_llm: [Object] } } }
a
Thanks for the follow-up, @alexh_revanov. I'll get back to you soon.
### Answer The response structure you showed is from Retell's log output (what Retell received) , not necessarily what your n8n webhook is actually returning. A common issue is that n8n may be wrapping your response in an array or not returning valid JSON. Based on a similar community issue, the correct format your webhook must return is: [(1) ]()
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
      "customer_name": "Jake"
    }
  }
}
Key things to verify in your n8n workflow: 1. Check for array wrappers - Some n8n nodes return responses like
[{ ... }]
instead of
{ ... }
. The response must be a plain JSON object, not wrapped in an array. 2. Ensure proper JSON format - Your log shows
n8n_number: '+11234567891
with a missing closing quote. This could indicate malformed JSON being sent. [(2) ]() 3. Verify the HTTP response node - In n8n, make sure you're using a "Respond to Webhook" node that returns the exact JSON structure above with
Content-Type: application/json
. [(1) ]() 4. Check webhook timeout - The inbound webhook has a 10-second timeout. If your n8n workflow takes longer, the response won't be processed. [(2) ]() The fact that the log shows the structure means Retell is receiving something, but if the variables don't appear in the Data tab, the response format isn't being parsed correctly.
​ To learn more, see the sources I considered: [[1] Not receiving response from inbound webhook.](https://discord.com/channels/1186424376300679209/1355901739244585132) [[2] Inbound webhook](https://docs.retellai.com/features/inbound-call-webhook) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
Check for array wrappers - Some n8n nodes return responses like [{ ... }] instead of { ... }. The response must be a plain JSON object, not wrapped in an array. so how to do this on n8n side?
@AI Evy Check for array wrappers - Some n8n nodes return responses like [{ ... }] instead of { ... }. The response must be a plain JSON object, not wrapped in an array. so how to do this on n8n side?
a
Thanks for the follow-up, @alexh_revanov. I'll get back to you soon.
### Answer I don't have specific information about n8n configuration in my sources. However, I can tell you what Retell expects: What Retell requires: The inbound webhook expects a JSON response with a successful status code (2xx) with fields grouped under
call_inbound
. [(1) ]() The expected format is:
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
      "customer_name": "John Doe"
    }
  }
}
General guidance for n8n: On the n8n side, you would typically need to: 1. Use a "Respond to Webhook" node 2. Ensure you're returning a single object, not an array 3. If your data is in an array (like
$json[0]
) , you may need to reference the first item directly or use an expression to extract the object Since n8n configuration is outside Retell's documentation, I'd recommend checking n8n's documentation or community forums for specifics on returning a plain JSON object from a webhook response. Would you like a general answer based on common n8n patterns, or do you have other Retell-specific questions I can help with?
​ To learn more, see the sources I considered: [[1] Inbound webhook](https://docs.retellai.com/features/inbound-call-webhook) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.