Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

QueryParameters `sessionTtl` does not override default 30 minute session

https://cloud.google.com/dialogflow/cx/docs/reference/rest/v3/QueryParameters

Hi everyone,

I'm working with Dialogflow CX and trying to customize the session timeout using the sessionTtl parameter in Google Query Parameters. According to the documentation, this parameter is supposed to define how long a session remains active after the last request.

However, despite setting sessionTtl to a specific value, the session always seems to follow the default timeout set in Dialogflow, and my custom value is ignored. For example:

  • Default Dialogflow session timeout: 30 minutes.
  • sessionTtl parameter set to 30 seconds in my request.

Even with the above configuration, the session continues to stay active for 30 minutes, completely bypassing the value I provided via sessionTtl.

Here's some examples of the requests I have tried:

 

 

if (!queryParams?.sessionTtl) {
  queryParams['sessionTtl'] = "PT30S"
}

 

 

 

 

if (!queryParams?.sessionTtl) {
  queryParams['sessionTtl'] = "30s and 30 without the s"
}

 

 

 

 

if (!queryParams?.sessionTtl) {
  queryParams['sessionTtl'] = {
    seconds: 30
  }
}

 

 

None of these seems to work. Can anyone help?

1 1 142
1 REPLY 1

Hi! As I haven't had any response so far, I'm making a new comment to see if anyone can help. Thanks!