Skip to main content

Session ID

Every session has a unique session_id (UUID v4) automatically generated and attached to the metadata of every event in that session. No configuration is required.

When a new session_id is generated

session_id in event metadata

All events within the same session share the same session_id. A new session carries a new UUID.

current_session_id on the tracker

The tracker also exposes a current_session_id field, so you can read the active session ID at any point during the conversation:

Conversation Lifecycle Events

ConversationInactive

ConversationInactive marks a conversation as inactive but resumable. It is emitted automatically by the session timer when the inactivity timeout elapses. Tracker effects:
  • inactive = true is set on the tracker.
  • The conversation continues to accept new events.
  • The inactive state is cleared when a UserUttered or ConversationResumed event is received.

SessionEnded

SessionEnded marks a conversation as permanently terminated. No further events can be appended after this point. Tracker effects:
  • terminated = true is set on the tracker.
  • All subsequent attempts to append events are rejected.
  • The session timer is cancelled immediately.

How to trigger SessionEnded

Via a custom action:
When a custom action returns SessionEnded, Rasa stops the prediction loop and flow executor immediately. No further actions are predicted or executed. Via the REST API:
When SessionEnded is posted via the API, the session timer is cancelled unconditionally, regardless of whether execute_side_effects is set. If an A2A sub agent task is running in the background, it is also cancelled. Likewise, posting a ConversationInactive event through the same endpoint cancels in-flight background A2A processing for that conversation.

Comparison