# 🤝help
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


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



I did but still nothing
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?


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
you can add an 'always' transition to go back to the main flow.
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
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?
@acceptable-gold-88171 have you used timeout / conversation end flows much?
@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.


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.


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.
That happens with workflow variables. They are scoped to the flow they are created in, so if you create
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
oh I see. thanks Gordy you've been great help