“I have a Retell.ai voice agent that fires a call_analyzed webhook to n8n. The customer data arrives correctly in the webhook payload at this exact path:
body.call.call_analysis.custom_analysis_data._first__name
body.call.call_analysis.custom_analysis_data._last__name
body.call.call_analysis.custom_analysis_data._phone_number
body.call.call_analysis.custom_analysis_data._address
body.call.call_analysis.custom_analysis_data._email
My Code node uses $input.first().json.body.call but keeps outputting ‘Not Provided’. The workflow is active and the webhook is receiving data. Need help mapping these fields correctly and then POSTing them to the Responsibid create lead API endpoint.”
1 Like
Hi @Brian_Gilligan Welcome!
This can occur when you are not currently using the nested path from the webhook URL item into your code node, consider something similar to this:
const item = $input.first().json;
const data = item.body.call.call_analysis.custom_analysis_data;
return [{
json: {
first_name: data._first__name,
last_name: data._last__name,
phone: data._phone_number,
address: data._address,
email: data._email,
}
}];
and then you can map the fields into your HTTP node directly