$npx -y skills add claude-office-skills/skills --skill gmail-workflowsAutomate Gmail with intelligent workflows - attachment management, email organization, auto-archiving, and Google Drive integration
| 1 | # Gmail Workflows |
| 2 | |
| 3 | Automate Gmail with intelligent workflows for attachment management, email organization, and Google Drive integration. Based on n8n's 7,800+ workflow templates. |
| 4 | |
| 5 | ## Overview |
| 6 | |
| 7 | This skill helps you design and implement Gmail automation workflows that: |
| 8 | - Automatically save attachments to Google Drive |
| 9 | - Organize emails with smart labeling |
| 10 | - Archive processed emails |
| 11 | - Send notifications via Slack/Email |
| 12 | - Track email metrics |
| 13 | |
| 14 | ## Core Workflow Templates |
| 15 | |
| 16 | ### 1. Gmail Attachment Manager |
| 17 | |
| 18 | **Purpose**: Automatically extract attachments from emails and save to Google Drive |
| 19 | |
| 20 | **Workflow Steps**: |
| 21 | ``` |
| 22 | ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ |
| 23 | │ Gmail │───▶│ Filter by │───▶│ Extract │───▶│ Upload to │ |
| 24 | │ Trigger │ │ Criteria │ │ Attachments │ │ Google Drive│ |
| 25 | └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ |
| 26 | │ |
| 27 | ┌─────────────┐ ┌─────────────┐ │ |
| 28 | │ Send │◀───│ Apply Label │◀───┘ |
| 29 | │ Notification│ │ & Archive │ |
| 30 | └─────────────┘ └─────────────┘ |
| 31 | ``` |
| 32 | |
| 33 | **Configuration**: |
| 34 | ```yaml |
| 35 | trigger: |
| 36 | type: gmail_new_email |
| 37 | filters: |
| 38 | has_attachment: true |
| 39 | from: ["*@company.com", "*@vendor.com"] |
| 40 | subject_contains: ["invoice", "report", "contract"] |
| 41 | |
| 42 | actions: |
| 43 | - extract_attachments: |
| 44 | file_types: [pdf, xlsx, docx, csv] |
| 45 | max_size_mb: 25 |
| 46 | |
| 47 | - upload_to_drive: |
| 48 | folder_path: "/Attachments/{year}/{month}" |
| 49 | naming_pattern: "{filename}_{sender}_{date}" |
| 50 | create_folder_if_missing: true |
| 51 | |
| 52 | - organize_email: |
| 53 | apply_label: "Processed/Attachments" |
| 54 | mark_as_read: true |
| 55 | archive: true |
| 56 | |
| 57 | - notify: |
| 58 | channel: slack |
| 59 | message: "New attachment saved: {filename} from {sender}" |
| 60 | ``` |
| 61 | |
| 62 | **Best Practices**: |
| 63 | - Use specific sender filters to avoid processing spam |
| 64 | - Set file size limits to prevent storage issues |
| 65 | - Use date-based folder structure for easy retrieval |
| 66 | - Enable duplicate detection to avoid redundant uploads |
| 67 | |
| 68 | --- |
| 69 | |
| 70 | ### 2. Invoice Auto-Archiver |
| 71 | |
| 72 | **Purpose**: Automatically collect and organize invoices from email |
| 73 | |
| 74 | **Workflow Steps**: |
| 75 | ``` |
| 76 | Gmail Trigger → Detect Invoice → Extract PDF → OCR/Parse → Save to Drive → Update Spreadsheet → Archive Email |
| 77 | ``` |
| 78 | |
| 79 | **Configuration**: |
| 80 | ```yaml |
| 81 | trigger: |
| 82 | subject_patterns: |
| 83 | - "invoice" |
| 84 | - "bill" |
| 85 | - "statement" |
| 86 | - "付款" |
| 87 | - "发票" |
| 88 | |
| 89 | processing: |
| 90 | - detect_invoice: |
| 91 | methods: [subject_keywords, attachment_name, sender_domain] |
| 92 | |
| 93 | - extract_data: |
| 94 | fields: [invoice_number, amount, date, vendor, due_date] |
| 95 | use_ocr: true |
| 96 | |
| 97 | - save_to_drive: |
| 98 | folder: "/Finance/Invoices/{year}/{vendor}" |
| 99 | naming: "{date}_{vendor}_{amount}" |
| 100 | |
| 101 | - update_tracker: |
| 102 | spreadsheet: "Invoice Tracker" |
| 103 | columns: [Date, Vendor, Amount, Invoice#, Status, File_Link] |
| 104 | |
| 105 | - archive: |
| 106 | label: "Finance/Invoices" |
| 107 | star: true |
| 108 | ``` |
| 109 | |
| 110 | --- |
| 111 | |
| 112 | ### 3. Client Communication Organizer |
| 113 | |
| 114 | **Purpose**: Automatically organize client emails by project/client |
| 115 | |
| 116 | **Configuration**: |
| 117 | ```yaml |
| 118 | rules: |
| 119 | - name: "Client A Emails" |
| 120 | condition: |
| 121 | from_domain: "clienta.com" |
| 122 | actions: |
| 123 | - apply_label: "Clients/Client A" |
| 124 | - forward_to: "team-a@company.com" |
| 125 | - save_attachments: "/Clients/Client A/{subject}" |
| 126 | |
| 127 | - name: "Project X Updates" |
| 128 | condition: |
| 129 | subject_contains: ["Project X", "PX-"] |
| 130 | actions: |
| 131 | - apply_label: "Projects/Project X" |
| 132 | - add_to_task: "Project X Board" |
| 133 | - notify_slack: "#project-x" |
| 134 | |
| 135 | - name: "Urgent Requests" |
| 136 | condition: |
| 137 | subject_contains: ["URGENT", "ASAP", "紧急"] |
| 138 | is_unread: true |
| 139 | actions: |
| 140 | - apply_label: "Priority/Urgent" |
| 141 | - send_sms: "+1234567890" |
| 142 | - move_to_inbox: true |
| 143 | ``` |
| 144 | |
| 145 | --- |
| 146 | |
| 147 | ### 4. Email Analytics Dashboard |
| 148 | |
| 149 | **Purpose**: Track email metrics and generate reports |
| 150 | |
| 151 | **Metrics to Track**: |
| 152 | ```yaml |
| 153 | daily_metrics: |
| 154 | - emails_received: count(inbox) |
| 155 | - emails_sent: count(sent) |
| 156 | - response_time_avg: avg(reply_time) |
| 157 | - unread_count: c |