wise-white•2y ago
Error in function
{"success":false,"latencyMS":50099.757129997015,"runtimeCommands":{"trace":[{"type":"debug","payload":{"message":"[ERROR]: Encountered an error in a Function step. Unknown error occurred when executing the function"}}]}}
2 Replies
Based on the error message you've shared, it seems like there's an issue within a Function step in your Voiceflow project. The error message indicates an unknown error occurred when executing the function.
In Voiceflow, a function step allows you to perform operations such as transforming text and returning runtime commands. The function accepts a single value, called the arguments object, args, which contains the data passed into the function when using the function step.
Runtime commands are JSON objects that specify the behavior of a function step. They include the Output Variables Command, which sets the output variables with the values to be used later in the conversation, the Next Command, which dictates the path to follow after the function executes, and the Trace Command, which produces traces as part of the agent's response.
Given your expertise level, I would recommend revisiting the function that's causing the error and checking for any potential issues in the code. Ensure that the function is correctly accepting the arguments object, performing the necessary operations, and returning the correct runtime commands.
For more information, you can refer to the Voiceflow documentation on functions here.
Try commenting out a portion of your code until the error goes away.