blank-aquamarine•15mo ago
Workflow fails to capture user input & hangs on api call
I have an workflow that is showing weird behavior.
Each node when tested individually works, but when I hit "Run" it hangs then fails.
Here's Copy Clone Link of the agent so you can test it and confirm my findings. https://creator.voiceflow.com/dashboard?import=6663343c00679aec89c3654a
When you hit "Run" a workflow calls an api, outputs text then captures user input. At this point, there is an api call next. But for some reason, the existence of this api node causes the capture user input block not to work; in addition, it'll hang then show an error (see attached)
Please help. I'm in contact with support, but they're currently unable to resolve my issue. It seems like a bug in Voiceflow.

41 Replies
This is usually due to a timeout. I think it is 45 seconds. This is the total time it takes to process all api / ai / text steps between two listen steps. BTW, that is a long time to make someone wait for a response. We typically shoot for around 5-10 seconds.
blank-aquamarineOP•15mo ago
The timeout should not occur in the first place. The api works, testing just the api node works, but when running the whole flow, it times out + capture user input doesn't capture user input despite executing before the api call. It's likely due to a bug - please see .vf file to confirm.
How long does each piece take to run?
@edk ?
I'll have a look at the template in the morning when I get to work.
blank-aquamarineOP•15mo ago
Each node takes less than a second. It's simple http post requests passed to openai api
It definitely takes more than a second. It looks like you are using the assistants API.
You should just use the OpenAI Assistants API function here: https://www.voiceflow.com/function/openai-assistants-api
OpenAI Assistants API | Voiceflow Functions
Built by community member w.williams, this function uses the OpenAI assistants API with threads to send and retrieve messages. This function will create a new thread if no existing thread exists or add messages to an existing threadID if provided.
blank-aquamarineOP•15mo ago
I cannot use OpenAI assistant on voiceflow, we're using Azure Open AI + custom preprocessing. Note that the node it's stuck at is a "create run" node - it takes less than a second to execute. The only part that takes time is waiting for the response to be generated - which I never reach.
Yes but the answer takes more than 60 seconds.
that is causing the timeout.
blank-aquamarineOP•15mo ago
No. First of all, it never reaches the code that waits for the assistant response. Second, the capture user input fails to capture {last_utterance} (a bug). Thirdly, even if the workflow reached that portion of the code, it take less than 20 seconds - a timeout couldn't occur. You can test it for yourself, these are my findings.
We are having zero issues. You need to do some debuging. Try outputing the responses from each step. I would be happy to help you. I have to do some work for my real job, but will be available in 15ish minutes for 15 minutes.
Just DM me
blank-aquamarineOP•15mo ago
You can copy the agent and see if you can run it https://creator.voiceflow.com/dashboard?import=6663343c00679aec89c3654a
I have run it
The issue is with your wait logic

Working fine with breaks
blank-aquamarineOP•15mo ago
breaks?
I put button steps in between the api calls

blank-aquamarineOP•15mo ago
weird let me try it
as far as your last_utterance "bug," you have hardcoded the question as "Hello."
VF is working fine
blank-aquamarineOP•15mo ago
I did that for debugging. But you can replace it with last_utterance or even better if you remove the user capture and just set last utterance manually, not even the first part of the flow will execute. But my confusion is, the api works... as shown even in your demonstration, why does adding a button make the flow work yet without a button it timesout. That makes no sense to me
did you write the backend code?
or did you copy it from somewhere?
blank-aquamarineOP•15mo ago
yes. The backend 100% works. I wrote it myself
Note that even in Voiceflow it works, it worked even for you
the problem is without the button, the flow fails
yes, but if you run it all together it fails. You have to wait 5 seconds before you can run the Wait step.
blank-aquamarineOP•15mo ago
why?
the issue is with the Wait logic
no clue.
that would be a coding issue. This is not a VF issue.
I would bet the wait logic is not looping correctly if the run is not complete.
and is not returning a response correctly
blank-aquamarineOP•15mo ago
I'm sorry, but this makes no sense at all. I have this same exact code running on ManyChat, Make.Com & also manually through postman client
so you have all 3 running one after another with no delay?
blank-aquamarineOP•15mo ago
it's only VF that gives the problem
so you have all 3 running one after another with no delay?
blank-aquamarineOP•15mo ago
yes. none at all. You can http post to them yourself and they'll be no issues
Anyways, does VF have a wait function?
or are you copying the thread to the run and then the thread & run to the wait?
correct
but there is no copying and pasting in VF
it just does it all in a row.
You need a loop on the check of the run status.
trust me. I have hundreds of these.
no wait in VF
I can make your api fail with the buttons everytime.
the endpoint has a logic issue
blank-aquamarineOP•15mo ago
how do you make it fail with button?
check your server logs right now. It is erroring.
click them immediatly
I would put money on you not having a loop
blank-aquamarineOP•15mo ago
ok one second... let me draft something
do you check the to make sure the status is complete?

Look at this function and you will see how to do it: https://www.voiceflow.com/function/openai-assistants-api
OpenAI Assistants API | Voiceflow Functions
Built by community member w.williams, this function uses the OpenAI assistants API with threads to send and retrieve messages. This function will create a new thread if no existing thread exists or add messages to an existing threadID if provided.
just import it into your VF Assistant.
blank-aquamarineOP•15mo ago
Thanks for the feedback. It seems quick requests to the wait endpoint causes a hang. It's a simple endpoint
@W. Williams (SFT) Many thanks. I believe I've figured it out. The error was as you said on the wait logic.
Sweet. drop me a shoutout: https://discord.com/channels/1079548823610871889/1149727345549262931
let's the VF team know I'm still alive.
blank-aquamarineOP•15mo ago
Done. Thanks again