https://retellai.com/?utm_source=discord&utm_medium=seo logo
why is custom function call taking alot of time in...
# ❓・ai-evy-support
d
@AI Evy why is custom function call taking alot of time in one component?
a
Thanks for tagging me @diddy345_63419. I'll look through relevant sources and get back to you shortly.
​ To learn more, see the sources I considered: [[1] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[2] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[3] Function Call Issues](https://discord.com/channels/1186424376300679209/1289083506781192213) ​
Copy code
javascript
import { Retell } from "retell-sdk";
this.app.post("/check-weather", async (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 content = req.body;
 if (content.args.city === "New York") {
 return res.json("25f and sunny") ;
 } else {
 return res.json("20f and cloudy") ;
 }
}) ;
[(1) ]() If you continue experiencing slow custom function calls, I'd recommend checking your server logs and response times to identify where the bottleneck might be occurring.
### Answer Based on the documentation, there are several factors that could affect custom function call timing in Retell AI: The request timeout period is configurable - requests will timeout in your specified timeout period, or 2 minutes if not specified [(1) ]() [(2) ]() . When requests fail, they will be retried up to 2 times . From the community discussions, some users have reported intermittent issues where custom functions sometimes work as expected but other times experience delays or don't trigger properly [(3) ]() . One user mentioned that sometimes the function triggers as per prompt, but other times it checks availability, goes silent, and then repeats before working . To troubleshoot custom function performance issues, you should: 1. Check your endpoint's response time - ensure your server responds quickly within the timeout period [(1) ]() [(2) ]() 2. Verify your function is configured correctly with proper HTTP method (GET, POST, PATCH, PUT, DELETE) 3. Ensure your endpoint URL is valid and accessible 4. Review your function description and parameters to make sure they're clear for the LLM You can verify requests are coming from Retell by checking the
X-Retell-Signature
header :
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.