timeout
# 🤝help
b
I have waited 5 minutes and the timeout flow does not get executed. do i need to reference it in the main flow or what do i do? here is my timeout flow

https://cdn.discordapp.com/attachments/1143107440150331402/1143107440871755786/image.png

a
Hey @bright-angle-75059 the default timour is 30 minutes. You can change it in your chabot's settings

https://cdn.discordapp.com/attachments/1143107440150331402/1143129797787144253/image.png

https://cdn.discordapp.com/attachments/1143107440150331402/1143129798072336434/image.png

b
I did but still nothing
a
are you testing in emulator or in webchat? Because I don't think timeout happens in the emulator, only in webchat
so if you publish your bot then click this link, does it time out correctly?

https://cdn.discordapp.com/attachments/1143107440150331402/1143132461694451773/image.png

b
ohhh let me see
okay so now it works
but I am stuc in the timeout flow
based on the screenshot I sent
how can I get out of it?
and back to main
or end the conversation
a
you can add an 'always' transition to go back to the main flow.
b
It doesn't happen but it's odd because you guys even include a "emulate timeout" (or something along those lines) but when clicked nothing happens like you said
g
What do I connect the transition to in order for it to switch back to the main workflow?
I know I could connect it to another workflow, but 1. the main workflow is not available there and 2. That would probably put me at the start of the workflow wouldn't it?
a
@acceptable-gold-88171 have you used timeout / conversation end flows much?
l
@acceptable-kangaroo-64719 I'm sorry for hijacking this thread but I have been trying to get some help with this for over a week. I'm unable to get the timeout flow to get executed. I have my timeout set at 5 minutes. On both messenger integration and webchat integration I'm getting this error in the logs.

https://cdn.discordapp.com/attachments/1143107440150331402/1145445045965684827/image.png

a
No worries. The reason for this is that a conversation can't time out when the bot isn't waiting for the user. Consider these two nodes. A flow that ends on the node "end_with_text" will not time out because the bot isn't waiting for the user to say anything. When the user says something next, this bot will start back at the main flow's start node. A flow ending on "end_with_question" however will time out because the bot is waiting for the user to say something so it can move on from the capture card. If you want your flows to time out, this is how you want to end your flows.

https://cdn.discordapp.com/attachments/1143107440150331402/1145669219405529168/image.png

l
Thanks for the quick response, I will try this out.
Timeout seems to be working well now that I've added a capture card. however I have trouble accessing variables defined in the workflow to track the conversation history. I have been using event.state.session.history, but a recent change made it such that only the last few replies of the conversation is tracked using that variable. As such I have switched to tracking the conversation state/history manually through an array variable. Upon timing out, I'm sending a post request to a lambda endpoint to send emails that that include the conversation history. the variable i'm using to track the history works well when used in the main flow. But if i use the exact same code to send the post request in the timeout flow, the variable is undefined.
a
That happens with workflow variables. They are scoped to the flow they are created in, so if you create
workflow.myVar
in main, it'll only be defined in main. Luckily there are other variable types! You might want to try a session varaiable https://botpress.com/docs/cloud/studio/variables/#session-variables which are scoped to the whole conversation and can be used between flows
l
oh I see. thanks Gordy you've been great help
8 Views