Browse Platform
Platform · Project

Session Threads

Group related Flow requests into time-bounded Threads, configure when they close, and evaluate or route completed Threads for review.

4 min read

Session Threads divide a longer chat session into smaller units of related activity. They are useful when one conversation can contain several distinct issues, tasks, or periods of work and you want to evaluate or review each unit separately.

Requests, Sessions, and Threads

ScopeWhat it representsExample
Flow requestOne execution of the Flow.One user message and the agent's response.
SessionThe complete interaction that links multiple Flow requests.The user's ongoing support conversation.
ThreadA time-bounded group of requests within the session.One support issue discussed during that conversation.

Every request in the same active Thread receives the same Thread ID. When that Thread expires, BotDojo closes it and the next request in the session starts a new Thread.

Thread boundaries do not create a new session or automatically clear Session State. Session-level memory can continue across Threads unless the Flow explicitly resets or separates it.

Configure Threads for a Flow

Thread settings are available for chat-compatible Flows. If Chat does not appear in Flow Settings, confirm that the Flow is configured as a Chat Flow and has a chat-compatible input schema.

  1. Open the Flow and select Flow Settings.
  2. Expand Chat, then select Chat Settings.
  3. Turn on Enable Session Threads.
  4. Choose a Thread Expiration Type.
  5. Set the duration or timezone required by that expiration type.
  6. Select Update.
Chat Settings with Session Threads enabled, Duration From Last Request selected, and a 1,800-second duration.
Screenshot previewChat Settings with Session Threads enabled, Duration From Last Request selected, and a 1,800-second duration.
Chat Settings with Session Threads enabled, Duration From Last Request selected, and a 1,800-second duration.

For a support or assistant Flow, a good starting point is:

  • Thread Expiration Type: Duration From Last Request
  • Thread Duration (seconds): 1800

This creates a 30-minute inactivity window. Each new request in the Thread restarts the timer.

Choose the expiration strategy

Expiration typeBehaviorGood fit
Duration From Last RequestCloses the Thread after a period of inactivity. Every new request extends the expiration time.Support conversations and task-oriented agents where related messages may arrive at uneven intervals.
Duration After Thread StartCloses the Thread after a fixed duration measured from its first request. Later requests do not extend it.Calls, shifts, timed exercises, or other fixed work windows.
Calendar DayCloses the Thread at the end of the calendar day in the selected timezone.Daily summaries, daily operations, or reporting grouped by business day.

Duration values are entered in seconds. Common examples are 900 for 15 minutes, 1800 for 30 minutes, and 3600 for one hour.

Example: a 30-minute support Thread

Assume a customer sends these messages in one session:

  1. At 10:00, the customer reports a billing problem.
  2. At 10:08, the customer provides an invoice number.
  3. At 10:20, the agent confirms the correction.

With Duration From Last Request set to 1800, all three requests belong to the same Thread. The last request moves the expiration time to 10:50. If the customer returns at 11:00 with a new question, that request starts a new Thread while remaining in the same session.

Inspect Threads in Trace

After enabling Threads and running the Flow, open Trace. The Threads tab appears next to Requests and Sessions.

The Threads view shows the last request from each Thread, giving you one row per Thread boundary instead of one row per message. Use the Thread ID on individual requests when you need to find all requests that belonged to the same Thread.

Run evaluations after a Thread closes

Thread-level evaluations let you judge a completed unit of work instead of scoring every response independently.

  1. Add or open an evaluation for the Flow.
  2. Map the evaluator inputs it needs.
  3. Under Run Options, select Run automatically after each thread.
  4. Save the evaluation.

When a Thread closes, BotDojo schedules the evaluations configured for that Thread boundary. This is useful for outcome checks such as whether the issue was resolved, whether the agent followed the full procedure, or whether the conversation should be escalated.

See Set Up Evaluations for evaluator types, input mapping, and run options.

Send completed Threads to a Work Queue

Use a Work Queue when completed Threads need human review or follow-up.

  1. In Chat Settings, expand Advanced Thread Settings.
  2. Turn on Add ended threads to a Work Queue.
  3. Select the destination Work Queue.
  4. Optionally enter a Resource column when the queue has a resource_reference property intended to store the Thread resource.
  5. Select Update.

BotDojo creates the Work Queue item when the Thread closes. The item includes references to the Thread and session so a reviewer can open the relevant conversation context.

Next steps

  • Configure evaluators and choose Run automatically after each thread in Set Up Evaluations.
  • Design the human follow-up process with Work Queues.
  • Use Session State when data must persist across requests and Thread boundaries.