PluginBench
Skill
Pass
Audit score 90

recipe-save-email-attachments

googleworkspace/cli

Find Gmail messages with attachments and save them to a Google Drive folder.

What is recipe-save-email-attachments?

This recipe automates the process of locating emails with attachments in Gmail and transferring those attachments to a designated Google Drive folder. Use it to organize email attachments, archive important documents, or consolidate files from specific senders.

  • Search Gmail for messages matching custom criteria (e.g., from specific senders, with attachments)
  • Retrieve full message details including attachment metadata
  • Download attachments from Gmail messages
  • Upload attachments directly to a Google Drive folder

How to install recipe-save-email-attachments

npx skills add null --skill recipe-save-email-attachments
Prerequisites
  • gws-gmail skill installed
  • gws-drive skill installed
  • Google Workspace CLI (gws) configured with appropriate Gmail and Drive permissions
Claude Code
Cursor
Windsurf
Cline

How to use recipe-save-email-attachments

  1. 1.Search for emails with attachments using a Gmail query (e.g., from a specific sender or with certain keywords)
  2. 2.Retrieve the message ID and attachment ID from the search results
  3. 3.Download the attachment using the Gmail API
  4. 4.Upload the downloaded file to your target Google Drive folder using the folder ID

Use cases

Good for
  • Archive all attachments from a client email address to a shared Drive folder
  • Automatically organize invoices or receipts sent via email into Drive
  • Consolidate contract PDFs from multiple email threads into a single folder
  • Back up important email attachments to cloud storage
Who it's for
  • Administrative professionals managing email workflows
  • Teams needing centralized document storage from email
  • Anyone automating attachment organization across Gmail and Drive

recipe-save-email-attachments FAQ

What Gmail search queries can I use?

Any valid Gmail search operator works, such as 'has:attachment', 'from:sender@example.com', 'before:2024-01-01', or combinations like 'has:attachment from:client@example.com'.

How do I find the Google Drive folder ID?

Open the folder in Google Drive and copy the ID from the URL (the long alphanumeric string after /folders/).

Can I filter by attachment type?

Gmail search doesn't filter by file type directly, but you can use the query to narrow by sender or date, then manually filter results or process specific attachment types after download.

Does this recipe handle multiple attachments per email?

Yes, you need to iterate through each attachment ID in a message and download/upload them individually.

What permissions do I need?

Your Google account needs read access to Gmail messages and write access to the target Google Drive folder.

Full instructions (SKILL.md)

Source of truth, from googleworkspace/cli.


name: recipe-save-email-attachments description: "Find Gmail messages with attachments and save them to a Google Drive folder." metadata: version: 0.22.5 openclaw: category: "recipe" domain: "productivity" requires: bins: - gws skills: - gws-gmail - gws-drive

Save Gmail Attachments to Google Drive

PREREQUISITE: Load the following skills to execute this recipe: gws-gmail, gws-drive

Find Gmail messages with attachments and save them to a Google Drive folder.

Steps

  1. Search for emails with attachments: gws gmail users messages list --params '{"userId": "me", "q": "has:attachment from:client@example.com"}' --format table
  2. Get message details: gws gmail users messages get --params '{"userId": "me", "id": "MESSAGE_ID"}'
  3. Download attachment: gws gmail users messages attachments get --params '{"userId": "me", "messageId": "MESSAGE_ID", "id": "ATTACHMENT_ID"}'
  4. Upload to Drive folder: gws drive +upload --file ./attachment.pdf --parent FOLDER_ID