# Save this month's invoice attachments to a Drive folder

Your agent finds this month's invoice emails and puts each attached PDF in the Drive folder you name, with a checksum for every file. DataToRAG gives an agent such as Claude, ChatGPT, or Cursor your Gmail and Google Drive through one connection, so the agent does this from a single request.

Updated: 2026-11-25  
Source: https://datatorag.com/use-cases/save-invoice-attachments-from-email-to-a-drive-folder

## What to ask

> Save every invoice PDF I was emailed this month into my Invoices folder in Drive.

## What the agent does

1. Find this month's emails that carry an invoice (`gws-mcp__gmail_search`)
2. Read each one and list its attachments with their part ids (`gws-mcp__gmail_read`)
3. Find the Invoices folder you named (`gws-mcp__drive_search`)
4. Put each PDF in the folder, one call for each file (`gws-mcp__drive_upload_file`)

## What comes back

Three invoices are in your Invoices folder. Drive's checksum matches what was sent for each one.

| File | Size | Checksum |
| --- | --- | --- |
| invoice-1042.pdf | 184 KB | Matches what Drive stored |
| invoice-1043.pdf | 97 KB | Matches what Drive stored |
| hosting-november.pdf | 212 KB | Matches what Drive stored |

Sample content. Yours comes from your own accounts.

## The tools it uses

- [Gmail docs](https://datatorag.com/docs/gmail.md)
- [Google Drive docs](https://datatorag.com/docs/drive.md)
