Some products and features are in the process of being renamed. Generative playbook and flow features are also being migrated to a single consolidated console. See the details.
Stay organized with collections
Save and categorize content based on your preferences.
A session represents a conversation between a Conversational Agents (Dialogflow CX) agent and an end-user.
You create a session at the beginning of a conversation
and use it for each turn of the conversation.
Once the conversation has ended,
you discontinue using the session.
You should not use the same session for concurrent conversations
with different end-users.
A session remains active and its data is stored for 30 minutes
after the last request is sent for the session.
Each session is determined unique by a session ID generated by your system.
You create a new session by providing a new session ID
in a detect intent request and other session methods.
A session ID is a string of at most 36 bytes in size.
Your system is responsible for generating unique session IDs.
They can be random numbers, hashed end-user identifiers,
or any other values that are convenient for you to generate.
Check the Regionalization
documentation for information about the Location ID value in the session name.
Long-lasting sessions
By default, Conversational Agents (Dialogflow CX) maintains the session data for 30 minutes. There are two ways to extend the lifetime of the sessions:
(Preferred) Set session TTL using QueryParameters.session_ttl. The maximum allowed value is 24 hours.
You can revive the previous session state by setting
QueryParameters.current_page and QueryParameters.parameters in DetectIntentRequest.
An example workflow looks like:
End-user talks with the agent under session A.
Your code records the state associated with session A returned in the API
response, namely QueryResult.current_page and QueryResult.parameters.
End-user stops interacting with the agent after 50 minutes.
End-user talks with the agent again.
Your code sends the end-user input, together with the previously recorded
QueryParameters.current_page and QueryParameters.parameters in the request,
to detect intent with the previous session state. You do not need to use the
same session ID as used by session A.
References
For information on session pricing, see the
pricing page.
For more information on sessions:
Select a protocol and version for the Session reference:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eA session in Conversational Agents (Dialogflow CX) represents a single conversation between an agent and an end-user, beginning at the start of the conversation and ending when the conversation is done.\u003c/p\u003e\n"],["\u003cp\u003eEach session is assigned a unique session ID, which is a string of up to 36 bytes, and it is generated by the user's system.\u003c/p\u003e\n"],["\u003cp\u003eSessions should not be shared between multiple end-users concurrently, as it may produce unpredictable behaviors and data corruption.\u003c/p\u003e\n"],["\u003cp\u003eBy default, session data is stored for 30 minutes after the last request; however, this can be extended up to 24 hours by setting the \u003ccode\u003eQueryParameters.session_ttl\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou can also revive a previous session state by setting \u003ccode\u003eQueryParameters.current_page\u003c/code\u003e and \u003ccode\u003eQueryParameters.parameters\u003c/code\u003e in a \u003ccode\u003eDetectIntentRequest\u003c/code\u003e for long-lasting sessions, allowing users to resume from a previous state even after the default 30-minute window has passed.\u003c/p\u003e\n"]]],[],null,["# Sessions\n\nA session represents a conversation between a Conversational Agents (Dialogflow CX) agent and an end-user.\nYou create a session at the beginning of a conversation\nand use it for each turn of the conversation.\nOnce the conversation has ended,\nyou discontinue using the session.\n\nYou should not use the same session for concurrent conversations\nwith different end-users.\nA session remains active and its data is stored for 30 minutes\nafter the last request is sent for the session.\n\nEach session is determined unique by a session ID generated by your system.\nYou create a new session by providing a new session ID\nin a detect intent request and other session methods.\nA session ID is a string of at most 36 bytes in size.\nYour system is responsible for generating unique session IDs.\nThey can be random numbers, hashed end-user identifiers,\nor any other values that are convenient for you to generate.\n\nCheck the [Regionalization](/dialogflow/cx/docs/how/region)\ndocumentation for information about the Location ID value in the session name.\n\nLong-lasting sessions\n---------------------\n\nBy default, Conversational Agents (Dialogflow CX) maintains the session data for 30 minutes. There are two ways to extend the lifetime of the sessions:\n\n- **(Preferred)** Set session TTL using `QueryParameters.session_ttl`. The maximum allowed value is 24 hours.\n- You can revive the previous session state by setting\n `QueryParameters.current_page` and `QueryParameters.parameters` in `DetectIntentRequest`.\n\n An example workflow looks like:\n 1. End-user talks with the agent under session A.\n 2. Your code records the state associated with session A returned in the API response, namely `QueryResult.current_page` and `QueryResult.parameters`.\n 3. End-user stops interacting with the agent after 50 minutes.\n 4. End-user talks with the agent again.\n 5. Your code sends the end-user input, together with the previously recorded `QueryParameters.current_page` and `QueryParameters.parameters` in the request, to detect intent with the previous session state. You do not need to use the same session ID as used by session A.\n\n | **Note:** [Handler call stack](/dialogflow/cx/docs/concept/handler#call-stack) will **not** be revived with this approach.\n\nReferences\n----------\n\nFor information on session pricing, see the\n[pricing page](/dialogflow/pricing).\n\nFor more information on sessions:\n\n\nGo to the Session API reference \n**Select a protocol and version for the Session reference:**\n\nClose\n\n\u003cbr /\u003e"]]