---
title: "Recent Sessions"
description: "List recent chat sessions for a user or channel identifier."
canonical_url: "https://docs.vettero.com/build/workflows/blocks/chat/recent-sessions"
---
# Recent Sessions

> List recent chat sessions for a user or channel identifier.

<block-meta block="Yes" channels="Any" folder="chat" group="Chat" groupTo="/build/workflows/blocks/chat" icon="i-lucide-history" pipe="Value" scope="Any" tool="Yes" type="chat.recent-sessions">



</block-meta>

**Recent Sessions** returns the latest chat sessions that match a **user identifier** or a **channel identifier**. Provide at least one of those filters.

## Configure

<table>
<thead>
  <tr>
    <th>
      Setting
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        User identifier
      </strong>
    </td>
    
    <td>
      Optional text (literal or variable). Leave blank to filter by channel instead
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Channel identifier
      </strong>
    </td>
    
    <td>
      Optional text. Used when you are not filtering by user
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Limit
      </strong>
    </td>
    
    <td>
      Max sessions. Default <strong>
        10
      </strong>
      
      , 1–100
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Page
      </strong>
    </td>
    
    <td>
      Page number. Default <strong>
        1
      </strong>
    </td>
  </tr>
</tbody>
</table>

## Handles

<table>
<thead>
  <tr>
    <th>
      Handle
    </th>
    
    <th>
      Role
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        In
      </strong>
      
       (target)
    </td>
    
    <td>
      Incoming connection
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Out
      </strong>
      
       (source)
    </td>
    
    <td>
      Continues after the list is loaded
    </td>
  </tr>
</tbody>
</table>

## Pipe schema

The next block reads this on the data pipe (`pipe.value`).

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        sessions
      </code>
    </td>
    
    <td>
      <code>
        list<Session>
      </code>
    </td>
    
    <td>
      Matching sessions, newest first
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        total
      </code>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      How many sessions were returned
    </td>
  </tr>
</tbody>
</table>

Each `Session` includes:

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Session id
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        channel
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Channel type
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        channelIdentifier
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Identifier on that channel
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        userIdentifier
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      User on that channel
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        summary
      </code>
    </td>
    
    <td>
      any
    </td>
    
    <td>
      AI session summary when one exists
    </td>
  </tr>
</tbody>
</table>

## Use case

- Look up prior chats for the same person before deciding whether to [Start Chat](https://docs.vettero.com/build/workflows/blocks/chat/start-chat).
- Feed session ids into [Get Messages](https://docs.vettero.com/build/workflows/blocks/chat/get-messages) or [Summarize Chat](https://docs.vettero.com/build/workflows/blocks/chat/summarize).

<block-page-nav>



</block-page-nav>


## Sitemap

See the full [sitemap](https://docs.vettero.com/sitemap.md) for all pages.
