---
title: "Get Attachment"
description: "Download a Gmail attachment into workspace Files."
canonical_url: "https://docs.vettero.com/build/workflows/blocks/gmail/get-attachment"
---
# Get Attachment

> Download a Gmail attachment into workspace Files.

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



</block-meta>

**Get Attachment** downloads one Gmail attachment into **temporary** workspace Files. The file expires after **3 hours** unless you [Persist File](https://docs.vettero.com/build/workflows/blocks/file/persist). Use `attachmentId` from [Get Email](https://docs.vettero.com/build/workflows/blocks/gmail/get-email) or [Mail Received](https://docs.vettero.com/build/event-handlers/mail-received).

## Configure

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

<tbody>
  <tr>
    <td>
      <strong>
        Message ID
      </strong>
    </td>
    
    <td>
      Gmail message id (required)
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Attachment ID
      </strong>
    </td>
    
    <td>
      Gmail attachment id (required)
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Filename (optional)
      </strong>
    </td>
    
    <td>
      Override the saved filename. If Gmail does not send a real name or type, the file type is detected from the contents.
    </td>
  </tr>
</tbody>
</table>

The saved file is temporary (`expiresAt` about 3 hours). Use [Persist File](https://docs.vettero.com/build/workflows/blocks/file/persist) before you store the id on a table or knowledge base.

## 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 file is created
    </td>
  </tr>
</tbody>
</table>

## Pipe schema

The next block reads a workspace file record (`id`, `name`, `url`, `mime`, `size`, and related fields).

## Use case

- After Get Email, loop `attachments[]`, download each file, [persist](https://docs.vettero.com/build/workflows/blocks/file/persist) it, then store the id on a [table](https://docs.vettero.com/data/tables) or [knowledge base](https://docs.vettero.com/data/knowledge-bases).

<block-page-nav>



</block-page-nav>


## Sitemap

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