---
title: "List Threads"
description: "List Gmail threads with optional search, labels, and paging."
canonical_url: "https://docs.vettero.com/build/workflows/blocks/gmail/list-threads"
---
# List Threads

> List Gmail threads with optional search, labels, and paging.

<block-meta block="Yes" capability="Gmail" channels="Any" folder="google/gmail" group="Gmail" groupTo="/build/workflows/blocks/gmail" icon="i-lucide-layers" pipe="Value" scope="Any" service="Google" tool="Yes" type="google.gmail.list_threads">



</block-meta>

**List Threads** returns thread ids and snippets. It does not return full bodies. Follow with [Get Thread](https://docs.vettero.com/build/workflows/blocks/gmail/get-thread).

Search uses the same syntax as the Gmail search box. Type a query in one line and insert context with `{{ }}` (for example `from:{{ args.email }} newer_than:7d`).

## Configure

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

<tbody>
  <tr>
    <td>
      <strong>
        Search query (optional)
      </strong>
    </td>
    
    <td>
      Gmail search string. Liquid template, for example <code>
        from:{{ args.email }} is:unread
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Label IDs (optional)
      </strong>
    </td>
    
    <td>
      Comma-separated label ids, for example <code>
        INBOX,UNREAD
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Max results
      </strong>
    </td>
    
    <td>
      Page size, 1–500. Default <strong>
        20
      </strong>
      
       if empty
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Page token (optional)
      </strong>
    </td>
    
    <td>
      <code>
        nextPageToken
      </code>
      
       from a previous list
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Include spam and trash
      </strong>
    </td>
    
    <td>
      When on, spam and trash can appear in results
    </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 returns
    </td>
  </tr>
</tbody>
</table>

## Pipe schema

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

<tbody>
  <tr>
    <td>
      <code>
        threads
      </code>
    </td>
    
    <td>
      list
    </td>
    
    <td>
      Each item has <code>
        id
      </code>
      
      , <code>
        snippet
      </code>
      
      , <code>
        historyId
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        nextPageToken
      </code>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Pass to the next list for the following page
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        resultSizeEstimate
      </code>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      Approximate match count
    </td>
  </tr>
</tbody>
</table>

<block-page-nav>



</block-page-nav>


## Sitemap

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