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.
recipe-schedule-recurring-event
Create recurring Google Calendar events with attendees using the command line.
recipe-search-and-export-emails
Find Gmail messages matching a query and export them for review.
recipe-send-personalized-emails
Read recipient data from Google Sheets and send personalized Gmail messages to each row.
recipe-send-team-announcement
Send team announcements simultaneously via Gmail and Google Chat.
recipe-share-doc-and-notify
Share Google Docs with collaborators and notify them via email in one workflow.
recipe-share-event-materials
Share Google Drive files with all attendees of a Google Calendar event.