Articles | C2C

Clear Session Variables on DialogFlow CX | GSuite Solved

Written by erin karam | May 26, 2022 5:00:00 AM

I would like to be able to allow a user to go through my bot flow two times. 

 

The second time, I would like an easy way to clear my session without having to manually set every variable to null in transition.

 

Best answer by Romin

A couple of points on this:

  1. There is a symbolic event END_SESSION and if this is transitioned to, then all the variables should be cleared up and you will be sent back to the start page of the default flow.
  2. You can then programmatically invoke this from any of your flows, by defining a custom event+transition that takes you to END_SESSION. This can be done then from any of your flows as per your logic. See this answer for a sample implementation.