kartik_72139
10/30/2025, 5:44 AMAI Evy
10/30/2025, 5:44 AMAI Evy
10/30/2025, 5:44 AMexecution_message parameter in your custom function definition [(1) ]() . This message is what the agent says to the user while the function is executing [(3) ]() . For example, you can configure your function to say "One moment, I'm booking your appointment" while waiting for the n8n workflow to complete .
Here's how to structure this in your function definition - the parameter should include a message field:
json
{
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "The message you will say while setting up the appointments"
}
}
}AI Evy
10/30/2025, 5:44 AMexecution_message parameter to keep users informed during the wait [(1) ]() [(3) ]()
If you need more specific guidance on preventing AI interruptions during function execution, you may want to reach out to support:
- Visit [Contact Sales]()
- Visit [)
Would you like me to provide a general answer based on common conversational AI patterns for handling this scenario?AI Evy
10/30/2025, 5:44 AMAI Evy
10/30/2025, 5:44 AMkartik_72139
10/30/2025, 5:01 PMAI Evy
10/30/2025, 5:01 PMAI Evy
10/30/2025, 5:01 PMAI Evy
10/30/2025, 5:01 PMAI Evy
10/30/2025, 5:01 PMkartik_72139
11/02/2025, 11:15 AMAI Evy
11/02/2025, 11:15 AMAI Evy
11/02/2025, 11:15 AMcall_started, call_ended, and call_analyzed [(1) ]() .
To filter for only the call_ended event, you need to handle this filtering in your webhook endpoint code. Here's how to implement this:
javascript
app.post("/webhook", (req: Request, res: Response) => {
const {event, call} = req.body;
switch (event) {
case "call_started":
console.log("Call started event received", call.call_id) ;
break;
case "call_ended":
console.log("Call ended event received", call.call_id) ;
break;
case "call_analyzed":
console.log("Call analyzed event received", call.call_id) ;
break;
default:
console.log("Received an unknown event:", event) ;
}
// Acknowledge the receipt of the event
res.status(204) .send() ;
}) ;
[(2) ]()
In this code, you can see the webhook receives all events, and you use a switch statement to handle each event type differently . To process only call_ended events, you would modify this to only execute your logic when event === "call_ended".
The webhook URL you set at the agent level will receive all call events [(3) ]() [(4) ]() [(5) ]() . Retell AI expects a successful status code (2xx) to be returned, with no body expected [(1) ]() .
If you want to completely avoid receiving the other events at your endpoint, the documentation doesn't provide a way to configure the webhook to send only specific event types. The filtering must be done in your webhook handler code.
**AI Evy
11/02/2025, 11:15 AMAI Evy
11/02/2025, 11:15 AMkartik_72139
11/02/2025, 11:17 AMkartik_72139
11/02/2025, 11:17 AMAI Evy
11/02/2025, 11:17 AMAI Evy
11/02/2025, 11:18 AMcall_ended events. Here's how to set this up:
1. Add a Webhook node in n8n and use its production URL in your Retell AI agent-level webhook configuration [(3) ]()
2. Add a Switch node or IF node after the Webhook node
3. Configure the condition to check if the event type equals "call_ended"
The condition should check:
- **Field**: {{ $json.event }}
- **Operation**: Equal to
- **Value**: call_ended
This filters the webhook payload so that only when event equals "call_ended" will the workflow continue to your next nodes [(1) ]() .
Remember that Retell AI will still send all three event types (call_started, call_ended, and call_analyzed) to your webhook URL . The webhook has a timeout of 10 seconds and will retry up to 3 times if no success status (2xx) is received . Your n8n webhook must return a 2xx status code for all events, even if you're only processing call_ended .
Make sure you're using the production webhook URL from n8n (not the test URL) , as the test URL only catches the first webhook [(3) ]() .
**AI Evy
11/02/2025, 11:18 AMAI Evy
11/02/2025, 11:18 AM