{"data":{"slug":"github-claude-office-skills-skills-gmail-workflows-6bbc0cd1f7c8","title":"Gmail Attachment Manager","summary":"Automatically extract and organize email attachments to Google Drive, with support for filtering by sender, subject, and file type, and organizing files into folders with custom naming patterns.","url":"https:\/\/skillshunter.net\/skills\/github-claude-office-skills-skills-gmail-workflows-6bbc0cd1f7c8","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-claude-office-skills-skills-gmail-workflows-6bbc0cd1f7c8","markdown_url":"https:\/\/skillshunter.net\/skills\/github-claude-office-skills-skills-gmail-workflows-6bbc0cd1f7c8.md","download_url":"https:\/\/skillshunter.net\/skills\/github-claude-office-skills-skills-gmail-workflows-6bbc0cd1f7c8\/download","category":{"slug":"product-design","name":"Product & Design"},"editor_note":"Ensure the Gmail API and Google Drive API are enabled in your Google Cloud project. Configure the workflow with specific filters and file types in the YAML configuration file before deployment.","instructions":"---\nname: gmail-workflows\ndescription: \"Automate Gmail with intelligent workflows - attachment management, email organization, auto-archiving, and Google Drive integration\"\nversion: \"1.0.0\"\nauthor: claude-office-skills\nlicense: MIT\n\ncategory: productivity\ntags:\n  - gmail\n  - google-drive\n  - email-automation\n  - workflow\n  - n8n\ndepartment: Operations\n\nmodels:\n  recommended:\n    - claude-sonnet-4\n    - claude-opus-4\n  compatible:\n    - gpt-4\n    - gpt-4o\n\nmcp:\n  server: google-workspace-mcp\n  tools:\n    - gmail_search\n    - gmail_get_attachments\n    - gmail_apply_label\n    - gmail_archive\n    - gdrive_upload\n    - gdrive_create_folder\n\ncapabilities:\n  - email_attachment_extraction\n  - automatic_file_organization\n  - email_filtering_rules\n  - drive_synchronization\n  - notification_setup\n\nlanguages:\n  - en\n  - zh\n\nrelated_skills:\n  - email-drafter\n  - email-classifier\n  - file-organizer\n---\n\n# Gmail Workflows\n\nAutomate Gmail with intelligent workflows for attachment management, email organization, and Google Drive integration. Based on n8n's 7,800+ workflow templates.\n\n## Overview\n\nThis skill helps you design and implement Gmail automation workflows that:\n- Automatically save attachments to Google Drive\n- Organize emails with smart labeling\n- Archive processed emails\n- Send notifications via Slack\/Email\n- Track email metrics\n\n## Core Workflow Templates\n\n### 1. Gmail Attachment Manager\n\n**Purpose**: Automatically extract attachments from emails and save to Google Drive\n\n**Workflow Steps**:\n```\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Gmail       \u2502\u2500\u2500\u2500\u25b6\u2502 Filter by   \u2502\u2500\u2500\u2500\u25b6\u2502 Extract     \u2502\u2500\u2500\u2500\u25b6\u2502 Upload to   \u2502\n\u2502 Trigger     \u2502    \u2502 Criteria    \u2502    \u2502 Attachments \u2502    \u2502 Google Drive\u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n                                                                \u2502\n                         \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u2502\n                         \u2502 Send        \u2502\u25c0\u2500\u2500\u2500\u2502 Apply Label \u2502\u25c0\u2500\u2500\u2500\u2518\n                         \u2502 Notification\u2502    \u2502 & Archive   \u2502\n                         \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n**Configuration**:\n```yaml\ntrigger:\n  type: gmail_new_email\n  filters:\n    has_attachment: true\n    from: [\"*@company.com\", \"*@vendor.com\"]\n    subject_contains: [\"invoice\", \"report\", \"contract\"]\n\nactions:\n  - extract_attachments:\n      file_types: [pdf, xlsx, docx, csv]\n      max_size_mb: 25\n  \n  - upload_to_drive:\n      folder_path: \"\/Attachments\/{year}\/{month}\"\n      naming_pattern: \"{filename}_{sender}_{date}\"\n      create_folder_if_missing: true\n  \n  - organize_email:\n      apply_label: \"Processed\/Attachments\"\n      mark_as_read: true\n      archive: true\n  \n  - notify:\n      channel: slack\n      message: \"New attachment saved: {filename} from {sender}\"\n```\n\n**Best Practices**:\n- Use specific sender filters to avoid processing spam\n- Set file size limits to prevent storage issues\n- Use date-based folder structure for easy retrieval\n- Enable duplicate detection to avoid redundant uploads\n\n---\n\n### 2. Invoice Auto-Archiver\n\n**Purpose**: Automatically collect and organize invoices from email\n\n**Workflow Steps**:\n```\nGmail Trigger \u2192 Detect Invoice \u2192 Extract PDF \u2192 OCR\/Parse \u2192 Save to Drive \u2192 Update Spreadsheet \u2192 Archive Email\n```\n\n**Configuration**:\n```yaml\ntrigger:\n  subject_patterns:\n    - \"invoice\"\n    - \"bill\"\n    - \"statement\"\n    - \"\u4ed8\u6b3e\"\n    - \"\u53d1\u7968\"\n\nprocessing:\n  - detect_invoice:\n      methods: [subject_keywords, attachment_name, sender_domain]\n  \n  - extract_data:\n      fields: [invoice_number, amount, date, vendor, due_date]\n      use_ocr: true\n  \n  - save_to_drive:\n      folder: \"\/Finance\/Invoices\/{year}\/{vendor}\"\n      naming: \"{date}_{vendor}_{amount}\"\n  \n  - update_tracker:\n      spreadsheet: \"Invoice Tracker\"\n      columns: [Date, Vendor, Amount, Invoice#, Status, File_Link]\n  \n  - archive:\n      label: \"Finance\/Invoices\"\n      star: true\n```\n\n---\n\n### 3. Client Communication Organizer\n\n**Purpose**: Automatically organize client emails by project\/client\n\n**Configuration**:\n```yaml\nrules:\n  - name: \"Client A Emails\"\n    condition:\n      from_domain: \"clienta.com\"\n    actions:\n      - apply_label: \"Clients\/Client A\"\n      - forward_to: \"team-a@company.com\"\n      - save_attachments: \"\/Clients\/Client A\/{subject}\"\n\n  - name: \"Project X Updates\"\n    condition:\n      subject_contains: [\"Project X\", \"PX-\"]\n    actions:\n      - apply_label: \"Projects\/Project X\"\n      - add_to_task: \"Project X Board\"\n      - notify_slack: \"#project-x\"\n\n  - name: \"Urgent Requests\"\n    condition:\n      subject_contains: [\"URGENT\", \"ASAP\", \"\u7d27\u6025\"]\n      is_unread: true\n    actions:\n      - apply_label: \"Priority\/Urgent\"\n      - send_sms: \"+1234567890\"\n      - move_to_inbox: true\n```\n\n---\n\n### 4. Email Analytics Dashboard\n\n**Purpose**: Track email metrics and generate reports\n\n**Metrics to Track**:\n```yaml\ndaily_metrics:\n  - emails_received: count(inbox)\n  - emails_sent: count(sent)\n  - response_time_avg: avg(reply_time)\n  - unread_count: count(unread)\n  - attachment_count: count(has_attachment)\n\nweekly_report:\n  - top_senders: group_by(from, count)\n  - busiest_hours: group_by(hour, count)\n  - label_distribution: group_by(label, count)\n  - response_rate: sent \/ received\n\nautomation:\n  - schedule: \"every Monday 9am\"\n  - output: Google Sheets\n  - notify: Slack #email-metrics\n```\n\n---\n\n## Implementation Guide\n\n### Using n8n\n\n```javascript\n\/\/ n8n Workflow: Gmail to Google Drive\n{\n  \"nodes\": [\n    {\n      \"name\": \"Gmail Trigger\",\n      \"type\": \"n8n-nodes-base.gmailTrigger\",\n      \"parameters\": {\n        \"pollTimes\": { \"item\": [{ \"mode\": \"everyMinute\" }] },\n        \"filters\": { \"labelIds\": [\"INBOX\"] }\n      }\n    },\n    {\n      \"name\": \"Filter Attachments\",\n      \"type\": \"n8n-nodes-base.if\",\n      \"parameters\": {\n        \"conditions\": {\n          \"boolean\": [{\n            \"value1\": \"={{ $json.hasAttachment }}\",\n            \"value2\": true\n          }]\n        }\n      }\n    },\n    {\n      \"name\": \"Get Attachments\",\n      \"type\": \"n8n-nodes-base.gmail\",\n      \"parameters\": {\n        \"operation\": \"getAttachments\",\n        \"messageId\": \"={{ $json.id }}\"\n      }\n    },\n    {\n      \"name\": \"Upload to Drive\",\n      \"type\": \"n8n-nodes-base.googleDrive\",\n      \"parameters\": {\n        \"operation\": \"upload\",\n        \"folderId\": \"your-folder-id\",\n        \"name\": \"={{ $json.filename }}\"\n      }\n    }\n  ]\n}\n```\n\n### Using Google Apps Script\n\n```javascript\n\/\/ Gmail to Drive Automation\nfunction processNewEmails() {\n  const threads = GmailApp.search('has:attachment is:unread');\n  const targetFolder = DriveApp.getFolderById('FOLDER_ID');\n  \n  threads.forEach(thread => {\n    const messages = thread.getMessages();\n    messages.forEach(message => {\n      const attachments = message.getAttachments();\n      attachments.forEach(attachment => {\n        \/\/ Save to Drive\n        const file = targetFolder.createFile(attachment);\n        \n        \/\/ Rename with date and sender\n        const newName = `${Utilities.formatDate(message.getDate(), 'GMT', 'yyyy-MM-dd')}_${message.getFrom()}_${attachment.getName()}`;\n        file.setName(newName);\n      });\n      \n      \/\/ Mark as processed\n      message.markRead();\n      thread.addLabel(GmailApp.getUserLabelByName('Processed'));\n    });\n  });\n}\n\n\/\/ Set up trigger\nfunction setupTrigger() {\n  ScriptApp.newTrigger('processNewEmails')\n    .timeBased()\n    .everyMinutes(5)\n    .create();\n}\n```\n\n---\n\n## Common Workflow Patterns\n\n### Pattern 1: Filter \u2192 Process \u2192 Organize \u2192 Notify\n\n```\nEmail arrives\n    \u2502\n    \u25bc\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Apply Filters   \u2502 \u2192 Skip if doesn't match\n\u2502 (sender, subject\u2502\n\u2502  attachment)    \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n         \u2502\n         \u25bc\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Process Content \u2502 \u2192 Extract data, attachments\n\u2502                 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n         \u2502\n         \u25bc\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Organize        \u2502 \u2192 Save files, apply labels\n\u2502                 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n         \u2502\n         \u25bc\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Notify          \u2502 \u2192 Slack, email, SMS\n\u2502                 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n### Pattern 2: Batch Processing\n\n```yaml\nschedule: \"daily at 6am\"\nsteps:\n  1. Collect all unprocessed emails from last 24h\n  2. Group by category (invoices, reports, misc)\n  3. Batch upload to respective Drive folders\n  4. Generate summary report\n  5. Send daily digest to stakeholders\n```\n\n### Pattern 3: Conditional Routing\n\n```yaml\nconditions:\n  - if: attachment_type == \"pdf\" AND subject contains \"invoice\"\n    then: route_to_finance_folder\n  \n  - if: from_domain in [\"important-client.com\"]\n    then: priority_handling + immediate_notification\n  \n  - if: attachment_size > 10MB\n    then: save_to_large_files_folder + skip_backup\n  \n  - default:\n    then: standard_processing\n```\n\n---\n\n## Troubleshooting\n\n### Common Issues\n\n| Issue | Solution |\n|-------|----------|\n| Attachments not detected | Check MIME type filters, increase trigger frequency |\n| Duplicate files | Enable deduplication by hash or filename |\n| Rate limits | Reduce trigger frequency, use batch processing |\n| Permission errors | Re-authorize OAuth credentials |\n| Large files failing | Set size limits, use chunked upload |\n\n---\n\n## Security Considerations\n\n1. **OAuth Scopes**: Request minimal permissions\n   - `gmail.readonly` for reading\n   - `gmail.modify` for labels\/archive\n   - `drive.file` for Drive access\n\n2. **Data Privacy**: \n   - Don't log email content\n   - Use secure storage for credentials\n   - Implement retention policies\n\n3. **Access Control**:\n   - Limit who can modify workflows\n   - Audit automation activities\n   - Use separate service accounts\n\n---\n\n## Output Example\n\n**Daily Email Report**:\n```markdown\n# Email Activity Report - 2026-01-30\n\n## Summary\n- Emails Received: 47\n- Emails Sent: 23\n- Attachments Processed: 12\n- Average Response Time: 2.3 hours\n\n## Attachment Processing\n| File | Sender | Saved To | Time |\n|------|--------|----------|------|\n| Invoice_Jan.pdf | vendor@co.com | \/Finance\/Invoices | 09:15 |\n| Report_Q4.xlsx | team@company.com | \/Reports\/Q4 | 10:30 |\n| Contract_v2.docx | legal@client.com | \/Contracts | 14:22 |\n\n## Labels Applied\n- Finance\/Invoices: 5 emails\n- Projects\/Active: 12 emails\n- Clients\/Priority: 8 emails\n\n## Pending Actions\n- 3 emails require manual review\n- 2 large attachments need approval\n```\n\n---\n\n*Gmail Workflows Skill - Part of Claude Office Skills*\n","use_cases":["Automatically save invoice attachments to a finance folder","Organize project-related emails with smart labeling","Track email metrics and generate reports"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/claude-office-skills\/skills\/blob\/9c4c7d5cd2813a8936bf2c9fdb174ea883b85a11\/gmail-workflows\/SKILL.md","source_commit":"9c4c7d5cd2813a8936bf2c9fdb174ea883b85a11","license":"MIT","version":null,"listing_approved_at":"2026-11-22","created_at":"2026-11-21T13:51:36.000000Z","updated_at":"2026-11-22T11:17:55.000000Z","seo_title":"Gmail Attachment Manager for Google Drive","seo_description":"Automate email attachment extraction and organize files in Google Drive with Gmail workflows, including smart labeling and folder creation.","seo_keywords":["Gmail attachment manager","Google Drive automation","Email attachment extraction","Email organization tool","Gmail workflow automation"]}}