recipe-save-email-to-doc
googleworkspace/cli
Save Gmail messages to Google Docs for archival and reference.
What is recipe-save-email-to-doc?
This recipe enables you to extract a Gmail message body and save it into a Google Doc. Use it when you need to preserve important emails in a searchable, organized document format for long-term reference or compliance.
- Query Gmail messages by subject, sender, or other criteria
- Retrieve full message content from Gmail
- Create new Google Docs programmatically
- Write email content into Google Docs with formatting
How to install recipe-save-email-to-doc
npx skills add null --skill recipe-save-email-to-doc- gws-gmail skill installed
- gws-docs skill installed
- Google Workspace CLI (gws) configured with appropriate Gmail and Docs permissions
How to use recipe-save-email-to-doc
- 1.Query Gmail to find the message using filters (subject, sender, date, etc.)
- 2.Retrieve the full message content using the message ID
- 3.Create a new Google Doc with an appropriate title
- 4.Write the email body (including headers like From and Subject) into the document
Use cases
- Archive important emails from managers or clients into organized documents
- Create a searchable reference library of key communications
- Save contract or agreement emails for compliance records
- Backup critical project communications outside of Gmail
- Knowledge workers managing email archives
- Compliance and legal teams preserving communications
- Project managers documenting key decisions
- Anyone needing to organize emails into structured documents
recipe-save-email-to-doc FAQ
Yes, you can append multiple email bodies to a single document by running the write step multiple times with the same document ID.
You can use Gmail search operators like subject:, from:, to:, before:, after:, and more in the query parameter.
The recipe saves the email body as text. For rich formatting, you may need to manually adjust the Google Doc or use additional formatting commands.
Yes, you can loop through multiple message IDs from the list step and create/write to separate docs or append to a single doc.
Full instructions (SKILL.md)
Source of truth, from googleworkspace/cli.
name: recipe-save-email-to-doc description: "Save a Gmail message body into a Google Doc for archival or reference." metadata: version: 0.22.5 openclaw: category: "recipe" domain: "productivity" requires: bins: - gws skills: - gws-gmail - gws-docs
Save a Gmail Message to Google Docs
PREREQUISITE: Load the following skills to execute this recipe:
gws-gmail,gws-docs
Save a Gmail message body into a Google Doc for archival or reference.
Steps
- Find the message:
gws gmail users messages list --params '{"userId": "me", "q": "subject:important from:boss@company.com"}' --format table - Get message content:
gws gmail users messages get --params '{"userId": "me", "id": "MSG_ID"}' - Create a doc with the content:
gws docs documents create --json '{"title": "Saved Email - Important Update"}' - Write the email body: `gws docs +write --document-id DOC_ID --text 'From: boss@company.com Subject: Important Update
[EMAIL BODY]'`
Related skills
More from googleworkspace/cli and the wider catalog.
gws-gmail
Send, read, and manage Gmail emails via Google Workspace CLI.
gws-drive
Manage Google Drive files, folders, and shared drives via CLI.
gws-docs
Read and write Google Docs via command line.
gws-calendar
Manage Google Calendar events, calendars, and access control via CLI.
gws-sheets
Read and write Google Sheets spreadsheets via CLI.
gws-gmail-send
Send emails via Gmail with attachments, CC/BCC, HTML support, and draft options.