https://retellai.com/?utm_source=discord&utm_medium=seo logo
r
Any help team? @AI Evy ?
a
Thanks for tagging me @rob.lee.333. I'll look through relevant sources and get back to you shortly.
### Answer Based on the webhook documentation, the
call_analyzed
webhook should trigger once when call analysis is complete [(1) ]() . However, duplicate webhook events can occur due to several factors. For duplicate
call_analyzed
events specifically, you should check your conversation flow for duplicate triggers, including nested or reused nodes [(2) ]() . Additionally, ensure only one webhook listener is tied to that event . The webhook system has a retry mechanism - if your endpoint doesn't return a success status (2xx) within 10 seconds, the webhook will be retried up to 3 times [(1) ]() . This could cause duplicates if your endpoint is slow to respond or returns non-2xx status codes. To prevent duplicates in your workflow: 1. Implement idempotency - Use the
call_id
from the webhook payload to deduplicate events on your end 2. Ensure fast response - Return a 2xx status code quickly from your webhook endpoint 3. Review your conversation flow - Check for duplicate call_analyzed triggers in your agent configuration [(2) ]() The webhook payload includes a unique
call_id
that you can use to track whether you've already processed that specific call analysis [(1) ]() . If you continue experiencing this issue after checking these factors, you may need to review your Retell dashboard or logs to identify which parts of your flow are triggering each event [(2) ]() .
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] I am seeing call_started and call_analyzed events doubling up](https://discord.com/channels/1186424376300679209/1347766292278411284) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
r
I only have one listener. It was sent twice from Retell
I just attached the last node to the respond to webhook so it sends a notification back to Retell after the call_analyzed webhook. I never had to do this before, but I'll see if it helps.
what do you think @AI Evy
a
Thanks for the follow-up, @rob.lee.333. I'll get back to you soon.
### Answer Based on the documentation, your approach of ensuring a proper webhook response is correct. The webhook system has specific retry behavior that could explain the duplicate events you're experiencing [(1) ]() . According to the webhook specification, if your endpoint doesn't return a success status (2xx) within 10 seconds, the webhook will be retried up to 3 times . This retry mechanism is designed to ensure reliable delivery, but it can cause duplicates if your endpoint isn't responding properly. Your solution of attaching a response node to send a notification back to Retell after processing the
call_analyzed
webhook should help. The key is ensuring your webhook endpoint returns a successful status code (2xx) promptly . A few additional considerations: 1. Response timing - Make sure your endpoint responds within the 10-second timeout window 2. Status codes - Ensure you're returning a 2xx status code, not just any response 3. Idempotency - Even with proper responses, consider implementing deduplication using the unique
call_id
from the webhook payload as a safety measure The fact that you're seeing exactly 2 events 10 seconds apart suggests the retry mechanism is likely the cause. Your webhook response fix should resolve this issue by preventing the retry attempts.
​ To learn more, see the sources I considered: [[1] 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.
r
what is the 2xx status and how should it be formatted? @AI Evy
a
Thanks for the follow-up, @rob.lee.333. I'll get back to you soon.
### Answer Based on the Retell AI webhook documentation, a 2xx status is an HTTP success status code [(1) ]() . For webhook responses, Retell expects a successful status code (2xx) to be returned, and no body is expected . Here's how it should be formatted in different programming languages: Node.js/Express:
Copy code
javascript
app.post("/webhook", (req: Request, res: Response) => {
 if (
 !Retell.verify(
 JSON.stringify(req.body) ,
 process.env.RETELL_API_KEY,
 req.headers["x-retell-signature"] as string,
 )
 ) {
 console.error("Invalid signature") ;
 return;
 }
 const {event, call} = req.body;
 // process the webhook
 // Acknowledge the receipt of the event
 res.status(204) .send() ;
}) ;
[(2) ]() For inbound call webhooks, you can return a 200 status code with JSON content when you want to accept the call:
Copy code
json
{
 "call_inbound": {
 "override_agent_id": "agent_12345"
 }
}
[(3) ]() Or return a 200 status code without the
override_agent_id
to reject the call . The key points are: - Return any 2xx status code (200, 201, 204, etc.) [(1) ]() - For call event webhooks, no response body is needed - just the status code - Respond within 10 seconds to avoid retries - Status 204 (No Content) is commonly used since no body is expected [(2) ]()
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] Secure the webhook](https://docs.retellai.com/features/secure-webhook) [[3] Inbound call 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.