Deleted User
03/20/2025, 1:41 PMAI Evy
03/20/2025, 1:41 PMAI Evy
03/20/2025, 1:41 PMAI Evy
03/20/2025, 1:42 PM{{current_time}} - Shows current time in America/Los_Angeles timezone
- {{current_time_[timezone]}} - Shows current time in a specified timezone (e.g. {{current_time_Australia/Sydney}})
However, there have been some reported issues with time accuracy [(2)]() [(3)]() [(4)]() . As a workaround, you can send your own date/time using dynamic variables through the inbound webhook or API call for outbound calls [(5)]() .
To use these variables, you can include them in your prompts like:
json
"Hello, today is {{current_time}}"
[(1)]()AI Evy
03/20/2025, 1:42 PMDeleted User
03/20/2025, 2:03 PMDeleted User
03/20/2025, 2:04 PMAI Evy
03/20/2025, 2:04 PMAI Evy
03/20/2025, 2:04 PMAI Evy
03/20/2025, 2:04 PMX-Retell-Signature header
2. Ensure your endpoint can handle the request format:
- Headers include X-Retell-Signature and Content-Type: application/json
- Body contains name, call, and args fields
3. Check that your response format is valid - it can be a string, buffer, JSON object, or blob
4. Note that failed requests will be retried up to 2 times with a default timeout of 2 minutes
If you need additional help, I recommend:
1. Checking your server logs for more detailed error information
2. Verifying your GHL (Go High Level) API credentials and endpoint configuration
3. Testing the endpoint directly to ensure it's responding correctly
Would you like me to provide a general response about implementing custom functions in Retell AI?AI Evy
03/20/2025, 2:04 PMDeleted User
03/20/2025, 2:07 PMAI Evy
03/20/2025, 2:07 PMAI Evy
03/20/2025, 2:08 PM[{"message":"1"},"Error in workflow"] suggests this is coming from your application's error handling logic rather than Retell AI's system.
Would you like me to provide information about the proper response format for custom functions in Retell AI?AI Evy
03/20/2025, 2:08 PMDeleted User
03/21/2025, 11:49 AMAI Evy
03/21/2025, 11:49 AMAI Evy
03/21/2025, 11:49 AMjavascript
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");
}
});
[(2)]()
Or using Python with FastAPI:AI Evy
03/21/2025, 11:49 AMpython
from fastapi import FastAPI, Request
from fastapi.responses import JSONResponse
from retell import Retell
retell = Retell(api_key=os.environ["RETELL_API_KEY"])
@app.post("/check-weather")
async def check-weather(request: Request):
try:
post_data = await request.json()
valid_signature = retell.verify(
json.dumps(post_data, separators=(",", ":"), ensure_ascii=False),
api_key=str(os.environ["RETELL_API_KEY"]),
signature=str(request.headers.get("X-Retell-Signature")),
)
if not valid_signature:
print(
"Received Unauthorized",
post_data["event"],
post_data["data"]["call_id"],
)
return JSONResponse(status_code=401, content={"message": "Unauthorized"})
args = post_data["args"]
if args["city"] == "New York":
return JSONResponse(status_code=200, content={"result": "25f and sunny"})
else:
return JSONResponse(status_code=200, content={"result": "20f and cloudy"})
except Exception as err:
print(f"Error in webhook: {err}")
return JSONResponse(
status_code=500, content={"message": "Internal Server Error"}
)
Important notes:
- The function result is capped at 4000 characters to prevent overloading LLM context window [(1)]()
- All response formats will be converted to string before sending to LLM for further processing
- Failed requests will be retried up to 2 times with a default timeout of 2 minutes if not specifiedAI Evy
03/21/2025, 11:49 AMDeleted User
03/21/2025, 11:55 AMAI Evy
03/21/2025, 11:55 AMAI Evy
03/21/2025, 11:55 AMAI Evy
03/21/2025, 11:55 AMX-Retell-Signature header which contains an encrypted request body using your secret key [(1)]() [(2)]() .
Here's how to implement the verification in JavaScript:
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;
}
// Rest of your code...
});
[(1)]()
Or in Python with FastAPI:
python
from fastapi import FastAPI, Request
from fastapi.responses import JSONResponse
from retell import Retell
retell = Retell(api_key=os.environ["RETELL_API_KEY"])
@app.post("/check-weather")
async def check-weather(request: Request):
try:
post_data = await request.json()
valid_signature = retell.verify(
json.dumps(post_data, separators=(",", ":"), ensure_ascii=False),
api_key=str(os.environ["RETELL_API_KEY"]),
signature=str(request.headers.get("X-Retell-Signature")),
)
if not valid_signature:
print(
"Received Unauthorized",
post_data["event"],
post_data["data"]["call_id"],
)
return JSONResponse(status_code=401, content={"message": "Unauthorized"})
# Rest of your code...AI Evy
03/21/2025, 11:55 AMAI Evy
03/21/2025, 11:55 AM