https://retellai.com/?utm_source=discord&utm_medium=seo logo
why am i seeing this error Axios Error: error code...
# ❓・ai-evy-support
r
@AI Evy why am i seeing this error Axios Error: error code: ERR_BAD_RESPONSE, error message: Request failed with status code 502 response status: 502 response data: ["Internal Server Error"]
a
Thanks for tagging me @reetam5807. I'll look through relevant sources and get back to you shortly.
​ To learn more, see the sources I considered: [[1] Setup WebSocket Server](https://docs.retellai.com/integrate-llm/setup-websocket-server) [[2] Retell Node API Library](https://github.com/RetellAI/retell-typescript-sdk/blob/main/README.md) ​
### Answer A 502 "Bad Gateway" or "Internal Server Error" typically means the server your code is trying to reach is not responding correctly or is unavailable. In the context of integrating with Retell AI, this can occur if your WebSocket server or backend is not reachable, not running, or is returning errors during the communication with the Retell platform [(1) ]() [(2) ]() . You should check that your server is running, accessible from the public internet, and able to handle requests from the Retell AI service. Also, make sure your endpoint URLs are correct and your server is not crashing or returning errors internally during the handshake or message processing [(1) ]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
r
i had a custom function with a webhook to an aws lambda function. could this be why? or is this on the retell ai side that's causing it? @AI Evy
a
Thanks for the follow-up, @reetam5807. I'll get back to you soon.
### Answer A 502 error (Bad Gateway/Internal Server Error) when using a custom function webhook to an AWS Lambda is most likely related to your Lambda endpoint, not Retell AI itself. Retell AI sends the HTTP request to your specified endpoint and expects a 2xx status code in response [(1) ]() . If your Lambda returns a 502, times out, or encounters an internal error, Retell will surface that error back to you as a 502 . Common causes include: - Lambda is not reachable (wrong URL, permissions, VPC config) - Lambda times out or throws an exception - Lambda returns a non-2xx status code or malformed response You should check your Lambda logs for errors and make sure it returns a valid 2xx response with the expected payload. Retell will retry the request up to 2 times if it fails, but persistent errors will continue to result in 502s .
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
r
@AI Evy Check if Retell has: "Include function calls in conversation history" (should be OFF) "Show tool invocations to agent" (should be OFF)
a
Thanks for the follow-up, @reetam5807. I'll get back to you soon.
### Answer Based on the available documentation, there is no explicit setting documented as "Include function calls in conversation history" or "Show tool invocations to agent" that can be toggled ON or OFF within Retell AI [(1) ]() [(2) ]() [(3) ]() . However, there are options related to transcripts and tool calls: - The Retell platform allows you to include transcripts with tool calls by setting the transcript_with_tool_calls flag in the agent/config when using the LLM WebSocket API. If enabled, the transcript will include tool call invocations and their results [(1) ]() . - Tool call invocations and results can be sent and displayed as part of the transcript, and these can be configured when using custom LLM integrations [(1) ]() [(3) ]() . There is no documentation stating that you can toggle these features with a simple ON/OFF setting labeled exactly as you described. If you are looking for a specific toggle, it is not documented in the official sources.
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) [[2] Function Calling Overview](https://docs.retellai.com/build/single-multi-prompt/function-calling) [[3] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
r
@AI Evy why would my agent be outputgin {"asr_text":"jan 2 nineteen ninety","file_dob":"1/1/1950"} from my custom function in the conversation flow especially if it's a function node where a static sentence was to be said where it's appending this kind of phrasing right before the static sentence would that be due to the function node or the conversation node before when it's transitioning to the function node in our call history it seems like it's transitioning to this function node before it's saying that but the function node is a static sentence that doesn't allow the agent to say anything aside from the static sentence so i'm surprised why this is happening
a
Thanks for the follow-up, @reetam5807. I'll get back to you soon.
### Answer When using a function node in Retell AI's Conversation Flow, the function node itself is not intended for having a conversation, but the agent can still speak if "Speak During Execution" is enabled [(1) ]() . If you configure a static sentence in the function node, the agent should only say that sentence while the function executes, and nothing else from the function node itself . However, if you see output like {"asr_text":"jan 2 nineteen ninety","file_dob":"1/1/1950"} right before or along with the static sentence, this suggests that information from the function's API response (or possibly dynamic variables extracted earlier) is being surfaced to the LLM or agent context at the time of node transition [(2) ]() . This is not a documented feature of the function node's static sentence output, but it could occur if: - The transition between nodes is including dynamic variables or API responses in the agent's context, which may get surfaced before or during the static sentence output [(1) ]() [(2) ]() . - The previous conversation node or the function's response is injecting these variables into the context, and they are being rendered before the static sentence executes . According to the documentation, to strictly control what is said to the user, you should only use conversation nodes for user-facing output and use function nodes for backend/API calls, attaching a conversation node after the function node to tell the user the result [(1) ]() . If the function node is set to a static sentence, it should not output extra information unles
s variables are being referenced or injected elsewhere in the flow [(1) ]() [(2) ]() . If you want to avoid exposing function output or context variables unintentionally, review your node transitions and ensure that the static sentence does not reference or interpolate dynamic variables unless intended . Also, check if any conversation nodes before or after the function node are configured to output these variables.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Function Node Overview](https://docs.retellai.com/build/conversation-flow/function-node) [[2] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) ​