https://retellai.com/?utm_source=discord&utm_medium=seo logo
What is wrong with syntaxis here in n8n node Respo...
# ❓・ai-evy-support
d
@AI Evy What is wrong with syntaxis here in n8n node Respond to Webhook {{ { call_inbound: { dynamic_variables: { phone_number: "", full_name: $json.full_name, amount_eur: $json.amount_eur, email: $json.email, car_model: $json.car_model, country: $json.country, start_dt: $json.start_dt, end_dt: $json.end_dt, rental_company: $json.rental_company, reason: $json.reason, current_date_plus_3_days: $json.current_date_plus_3_days, status: "", region_of_person: "", voicemail: "", timezone: "", crm_id: "", current_time: $json.current_time, position: "", invoice_count: "", success_manager: "", owner: "" }, metadata: { random_id: "12345" } } } }}
a
Thanks for tagging me @dropsofsteel. I'll look through relevant sources and get back to you shortly.
### Answer The syntax issues in your n8n webhook response are: 1. **Missing quotes around property values**: All
$json.*
references need to be wrapped in quotes when used as JSON values 2. **Invalid JSON structure**: The n8n expression syntax
{{ }}
expects valid JSON, but your property values aren't properly quoted Here's the corrected syntax:
Copy code
json
{{
{
  "call_inbound": {
    "dynamic_variables": {
      "phone_number": "",
      "full_name": "{{$json.full_name}}",
      "amount_eur": "{{$json.amount_eur}}",
      "email": "{{$json.email}}",
      "car_model": "{{$json.car_model}}",
      "country": "{{$json.country}}",
      "start_dt": "{{$json.start_dt}}",
      "end_dt": "{{$json.end_dt}}",
      "rental_company": "{{$json.rental_company}}",
      "reason": "{{$json.reason}}",
      "current_date_plus_3_days": "{{$json.current_date_plus_3_days}}",
      "status": "",
      "region_of_person": "",
      "voicemail": "",
      "timezone": "",
      "crm_id": "",
      "current_time": "{{$json.current_time}}",
      "position": "",
      "invoice_count": "",
      "success_manager": "",
      "owner": ""
    },
    "metadata": {
      "random_id": "12345"
    }
  }
}
}}
Key changes: - Added quotes around all property names - Wrapped each
$json.*
reference in its own
{{ }}
expression delimiters - Each dynamic value is now a string containing the expression This ensures n8n properly evaluates each expression and constructs valid JSON for your webhook response.
message has been deleted
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy что то нетак в твоем варианте. Я справшивал про респонс на инбанд вебхук
a
Thanks for the follow-up, @dropsofsteel. I'll get back to you soon.
### Answer Извините за путаницу. Для ответа на inbound webhook от Retell AI в n8n правильный формат должен быть таким:
Copy code
json
{
  "company_name": "{{$json.company_name}}",
  "agent_phone": "{{$json.agent_phone}}",
  "agent_email": "{{$json.agent_email}}",
  "customer_phone": "{{$json.customer_phone}}",
  "full_name": "{{$json.full_name}}",
  "amount_eur": "{{$json.amount_eur}}",
  "email": "{{$json.email}}",
  "car_model": "{{$json.car_model}}",
  "country": "{{$json.country}}",
  "start_dt": "{{$json.start_dt}}",
  "end_dt": "{{$json.end_dt}}",
  "rental_company": "{{$json.rental_company}}",
  "reason": "{{$json.reason}}",
  "current_date_plus_3_days": "{{$json.current_date_plus_3_days}}",
  "current_time": "{{$json.current_time}}"
}
[(1) ]() Ключевые моменты: - Ответ на inbound webhook должен содержать простой JSON объект с dynamic variables на верхнем уровне, а не вложенный в
call_inbound.dynamic_variables
- Не нужно включать
metadata
или другие структуры - только сами переменные - Каждая переменная должна быть в формате
"имя_переменной": "значение"
- Убедитесь, что webhook возвращает статус 200 и Content-Type: application/json [(2) ]()
​ To learn more, see the sources I considered: [[1] Dynamic variables populating in multi-prompt agent but not conversation flow](https://discord.com/channels/1186424376300679209/1352134741377417329) [[2] Webhook Overview](https://docs.retellai.com/features/webhook-overview) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
все равно Invalid JSON in 'Response Body' field Check that the syntax of the JSON in the 'Response Body' parameter is valid Error details Other info Node type n8n-nodes-base.respondToWebhook Node version 1.2 (Latest version: 1.5) n8n version 2.13.2 (Self Hosted) Time 21/05/2026, 11:55:35 Stack trace NodeOperationError: Invalid JSON in 'Response Body' field at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/RespondToWebhook/RespondToWebhook.node.ts:424:14) at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_9f358c3eeaef0d2736f54ac9757ada43/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1043:31) at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_9f358c3eeaef0d2736f54ac9757ada43/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1222:22) at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_9f358c3eeaef0d2736f54ac9757ada43/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1668:38 at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_9f358c3eeaef0d2736f54ac9757ada43/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2313:11
@AI Evy все равно Invalid JSON in 'Response Body' field Check that the syntax of the JSON in the 'Response Body' parameter is valid Error details Other info Node type n8n-nodes-base.respondToWebhook Node version 1.2 (Latest version: 1.5) n8n version 2.13.2 (Self Hosted) Time 21/05/2026, 11:55:35 Stack trace NodeOperationError: Invalid JSON in 'Response Body' field at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/RespondToWebhook/RespondToWebhook.node.ts:424:14) at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_9f358c3eeaef0d2736f54ac9757ada43/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1043:31) at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_9f358c3eeaef0d2736f54ac9757ada43/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1222:22) at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_9f358c3eeaef0d2736f54ac9757ada43/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1668:38 at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_9f358c3eeaef0d2736f54ac9757ada43/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2313:11
a
Thanks for the follow-up, @dropsofsteel. I'll get back to you soon.
### Answer [(1) ]() Извините за путаницу. Для ответа на inbound webhook Retell AI правильный формат должен быть:
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
      "phone_number": "",
      "full_name": "{{$json.full_name}}",
      "amount_eur": "{{$json.amount_eur}}",
      "email": "{{$json.email}}",
      "car_model": "{{$json.car_model}}",
      "country": "{{$json.country}}",
      "start_dt": "{{$json.start_dt}}",
      "end_dt": "{{$json.end_dt}}",
      "rental_company": "{{$json.rental_company}}",
      "reason": "{{$json.reason}}",
      "current_date_plus_3_days": "{{$json.current_date_plus_3_days}}",
      "status": "",
      "region_of_person": "",
      "voicemail": "",
      "timezone": "",
      "crm_id": "",
      "current_time": "{{$json.current_time}}",
      "position": "",
      "invoice_count": "",
      "success_manager": "",
      "owner": ""
    },
    "metadata": {
      "random_id": "12345"
    }
  }
}
Ключевые моменты для n8n: 1. В n8n узле "Respond to Webhook" используйте поле "Response Body" в режиме "JSON" 2. НЕ используйте двойные фигурные скобки
{{ }}
вокруг всего объекта - это было ошибкой в вашем первоначальном коде 3. Используйте выражения n8n только внутри значений строк:
"{{$json.field_name}}"
4. Убедитесь, что все ключи и значения правильно заключены в кавычки Структура ответа должна содержать объект
call_inbound
с вложенными
dynamic_variables
и опционально
metadata
​ 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.
d
почему агент получая в ответ на инбанд вебхук вот такой ответ не распознает переменные? " { "full_name": "Новый контакт по звонку с +35722030827 из CallGear", "amount_eur": null, "email": null, "car_model": null, "country": null, "start_dt": null, "end_dt": null, "rental_company": null, "reason": "Damage \nFines \nToll Gates \nExtra Milage \nOther \nNot specified (maybe internal fines of a rental company) \nRent Extensions ", "current_date_plus_3_days": "05.24.2026", "crm_id": 30558801, "current_time": "" }"
@AI Evy почему агент получая в ответ на инбанд вебхук вот такой ответ не распознает переменные? " { "full_name": "Новый контакт по звонку с +35722030827 из CallGear", "amount_eur": null, "email": null, "car_model": null, "country": null, "start_dt": null, "end_dt": null, "rental_company": null, "reason": "Damage \nFines \nToll Gates \nExtra Milage \nOther \nNot specified (maybe internal fines of a rental company) \nRent Extensions ", "current_date_plus_3_days": "05.24.2026", "crm_id": 30558801, "current_time": "" }"
a
Thanks for the follow-up, @dropsofsteel. I'll get back to you soon.
### Answer Проблема в том, что ваш ответ на inbound webhook имеет неправильную структуру. Вам нужно обернуть переменные в объект
call_inbound
с вложенным
dynamic_variables
[(1) ]() . Ваш текущий ответ (неправильный) :
Copy code
json
{
  "full_name": "Новый контакт...",
  "amount_eur": null,
  ...
}
Правильный формат для inbound webhook:
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
      "full_name": "Новый контакт по звонку с +35722030827 из CallGear",
      "amount_eur": "",
      "email": "",
      "car_model": "",
      "country": "",
      "start_dt": "",
      "end_dt": "",
      "rental_company": "",
      "reason": "Damage \nFines \nToll Gates \nExtra Milage \nOther \nNot specified (maybe internal fines of a rental company) \nRent Extensions",
      "current_date_plus_3_days": "05.24.2026",
      "crm_id": "30558801",
      "current_time": ""
    },
    "metadata": {
      "random_id": "12345"
    }
  }
}
Важные моменты: 1. Не используйте
null
- вместо этого используйте пустые строки
""
[(2) ]() 2. Все значения должны быть строками - включая числа как
crm_id
, преобразуйте в
"30558801"
[(1) ]() 3. Структура должна быть
call_inbound.dynamic_variables
, а не просто плоский объект [(1) ]() [(3) ]() Если какие-то переменные отсутствуют, просто не включайте их в ответ вообще, вместо того чтобы отправлять
null
или пустые строки [(2) ]() .
​ To learn more, see the sources I considered: [[1] Inbound webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] JSON payload inbound webhook](https://discord.com/channels/1186424376300679209/1329371840472289300) [[3] Discord message from @fyodor2572 on 2025-01-13](https://discord.com/channels/1186424376300679209/1186462578310910112/1328501633172377620) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy почему агент не смог подтянуть переменную reason из этого ответа, но full name успешно подтянул? 2026-05-21 10:07:42.736 call_dc990de5456292d699900b7e1a2 info: inbound call_inbound webhook response: { call_inbound: { dynamic_variables: { phone_number: '', full_name: 'Новый контакт по звонку с +35722030827 из CallGear', reason: 'Damage \n' + 'Fines \n' + 'Toll Gates \n' + 'Extra Milage \n' + 'Other \n' + 'Not specified (maybe internal fines of a rental company) \n' + 'Rent Extensions ', current_date_plus_3_days: '05.24.2026', status: '', region_of_person: '', voicemail: '', timezone: '', crm_id: '30558801', current_time: '', position: '', invoice_count: '', success_manager: '', owner: '' } } }
a
Thanks for the follow-up, @dropsofsteel. I'll get back to you soon.
d
@AI Evy почему агент не смог подтянуть переменную reason из этого ответа, но full name успешно подтянул? 2026-05-21 10:07:42.736 call_dc990de5456292d699900b7e1a2 info: inbound call_inbound webhook response: { call_inbound: { dynamic_variables: { phone_number: '', full_name: 'Новый контакт по звонку с +35722030827 из CallGear', reason: 'Damage \n' + 'Fines \n' + 'Toll Gates \n' + 'Extra Milage \n' + 'Other \n' + 'Not specified (maybe internal fines of a rental company) \n' + 'Rent Extensions ', current_date_plus_3_days: '05.24.2026', status: '', region_of_person: '', voicemail: '', timezone: '', crm_id: '30558801', current_time: '', position: '', invoice_count: '', success_manager: '', owner: '' } } }
a
Thanks for the follow-up, @dropsofsteel. I'll get back to you soon.
Hmm.. Seems there was an issue processing this question. Please try again or tag a team member.
Hmm.. Seems there was an issue processing this question. Please try again or tag a team member.