Recipe Save Email Attachments

by googleworkspacea3768d0e82adNo license31K starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated yesterday

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

Instructions onlyProductivity & Workflow
AI-generated overview

Finds Gmail messages with attachments and saves the attachments to a Google Drive folder.

What it does
This recipe walks through locating Gmail messages that have attachments, retrieving the message details, downloading the attachment, and uploading the file to a specified Google Drive folder. It is an instruction-only recipe that relies on the gws command-line tool and the gws-gmail and gws-drive skills. The result is the attachment stored in Drive rather than in the mailbox.
When to use it
Use it when attachments received by email need to be collected and archived in Google Drive. It suits a workflow where a user wants to move files out of Gmail into a shared or organized Drive folder.
Requirements
Requires the gws binary and the gws-gmail and gws-drive skills. It needs authenticated access to Gmail and Google Drive, plus network access. No scripts are shipped; it is instructions only.

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:[email protected]"}' --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

Source and attribution

Source:googleworkspace/cliinskills/recipe-save-email-attachmentsat commita3768d0

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal