NR
12/17/2025, 12:43 PMAI Evy
12/17/2025, 12:43 PMAI Evy
12/17/2025, 12:44 PMcall object with a unique call_id. [(1) ]() , [(2) ]() You can use this call_id to track whether the function has already been executed for that session and return a cached response for subsequent requests.
2. Use dynamic variables to track state
You can extract a response variable from your first function call and save it as a dynamic variable. [(1) ]() , [(2) ]() Then, update your prompt to instruct the agent to only call the function if that variable hasn't been set yet.
3. Adjust your prompt
Include explicit instructions in your prompt about when to invoke the custom function—for example: "Only call your_function_name once at the beginning of the conversation" or "Do not call your_function_name if you have already retrieved the information." [(1) ]()
Note on retries: When a request fails, Retell will retry up to 2 times. , [(2) ]() If you're seeing multiple requests, ensure your endpoint is returning a 200-299 status code to indicate success.
Would you like more details on impleAI Evy
12/17/2025, 12:44 PMAI Evy
12/17/2025, 12:44 PMAI Evy
12/17/2025, 12:44 PMNR
12/17/2025, 12:45 PMNR
12/17/2025, 12:45 PMAI Evy
12/17/2025, 12:45 PMAI Evy
12/17/2025, 12:46 PMjavascript
return res.json("25f and sunny") ;
Or in Python:
python
return JSONResponse(status_code=200, content={"result": "25f and sunny"})
Note: The function result is capped at 15,000 characters to prevent overloading the LLM context window.AI Evy
12/17/2025, 12:46 PMAI Evy
12/17/2025, 12:46 PM