gmail-workflows by claude-office-skills/skills
npx skills add https://github.com/claude-office-skills/skills --skill gmail-workflows通过智能工作流实现 Gmail 自动化,用于附件管理、邮件整理和 Google Drive 集成。基于 n8n 的 7,800+ 个工作流模板。
此技能可帮助您设计和实现 Gmail 自动化工作流,实现以下功能:
目的:自动从邮件中提取附件并保存到 Google Drive
工作流步骤:
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Gmail │───▶│ Filter by │───▶│ Extract │───▶│ Upload to │
│ Trigger │ │ Criteria │ │ Attachments │ │ Google Drive│
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
│
┌─────────────┐ ┌─────────────┐ │
│ Send │◀───│ Apply Label │◀───┘
│ Notification│ │ & Archive │
└─────────────┘ └─────────────┘
配置:
trigger:
type: gmail_new_email
filters:
has_attachment: true
from: ["*@company.com", "*@vendor.com"]
subject_contains: ["invoice", "report", "contract"]
actions:
- extract_attachments:
file_types: [pdf, xlsx, docx, csv]
max_size_mb: 25
- upload_to_drive:
folder_path: "/Attachments/{year}/{month}"
naming_pattern: "{filename}_{sender}_{date}"
create_folder_if_missing: true
- organize_email:
apply_label: "Processed/Attachments"
mark_as_read: true
archive: true
- notify:
channel: slack
message: "New attachment saved: {filename} from {sender}"
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
最佳实践:
目的:自动从邮件中收集并整理发票
工作流步骤:
Gmail Trigger → Detect Invoice → Extract PDF → OCR/Parse → Save to Drive → Update Spreadsheet → Archive Email
配置:
trigger:
subject_patterns:
- "invoice"
- "bill"
- "statement"
- "付款"
- "发票"
processing:
- detect_invoice:
methods: [subject_keywords, attachment_name, sender_domain]
- extract_data:
fields: [invoice_number, amount, date, vendor, due_date]
use_ocr: true
- save_to_drive:
folder: "/Finance/Invoices/{year}/{vendor}"
naming: "{date}_{vendor}_{amount}"
- update_tracker:
spreadsheet: "Invoice Tracker"
columns: [Date, Vendor, Amount, Invoice#, Status, File_Link]
- archive:
label: "Finance/Invoices"
star: true
目的:按项目/客户自动整理客户邮件
配置:
rules:
- name: "Client A Emails"
condition:
from_domain: "clienta.com"
actions:
- apply_label: "Clients/Client A"
- forward_to: "team-a@company.com"
- save_attachments: "/Clients/Client A/{subject}"
- name: "Project X Updates"
condition:
subject_contains: ["Project X", "PX-"]
actions:
- apply_label: "Projects/Project X"
- add_to_task: "Project X Board"
- notify_slack: "#project-x"
- name: "Urgent Requests"
condition:
subject_contains: ["URGENT", "ASAP", "紧急"]
is_unread: true
actions:
- apply_label: "Priority/Urgent"
- send_sms: "+1234567890"
- move_to_inbox: true
目的:跟踪邮件指标并生成报告
跟踪指标:
daily_metrics:
- emails_received: count(inbox)
- emails_sent: count(sent)
- response_time_avg: avg(reply_time)
- unread_count: count(unread)
- attachment_count: count(has_attachment)
weekly_report:
- top_senders: group_by(from, count)
- busiest_hours: group_by(hour, count)
- label_distribution: group_by(label, count)
- response_rate: sent / received
automation:
- schedule: "every Monday 9am"
- output: Google Sheets
- notify: Slack #email-metrics
// n8n Workflow: Gmail to Google Drive
{
"nodes": [
{
"name": "Gmail Trigger",
"type": "n8n-nodes-base.gmailTrigger",
"parameters": {
"pollTimes": { "item": [{ "mode": "everyMinute" }] },
"filters": { "labelIds": ["INBOX"] }
}
},
{
"name": "Filter Attachments",
"type": "n8n-nodes-base.if",
"parameters": {
"conditions": {
"boolean": [{
"value1": "={{ $json.hasAttachment }}",
"value2": true
}]
}
}
},
{
"name": "Get Attachments",
"type": "n8n-nodes-base.gmail",
"parameters": {
"operation": "getAttachments",
"messageId": "={{ $json.id }}"
}
},
{
"name": "Upload to Drive",
"type": "n8n-nodes-base.googleDrive",
"parameters": {
"operation": "upload",
"folderId": "your-folder-id",
"name": "={{ $json.filename }}"
}
}
]
}
// Gmail to Drive Automation
function processNewEmails() {
const threads = GmailApp.search('has:attachment is:unread');
const targetFolder = DriveApp.getFolderById('FOLDER_ID');
threads.forEach(thread => {
const messages = thread.getMessages();
messages.forEach(message => {
const attachments = message.getAttachments();
attachments.forEach(attachment => {
// Save to Drive
const file = targetFolder.createFile(attachment);
// Rename with date and sender
const newName = `${Utilities.formatDate(message.getDate(), 'GMT', 'yyyy-MM-dd')}_${message.getFrom()}_${attachment.getName()}`;
file.setName(newName);
});
// Mark as processed
message.markRead();
thread.addLabel(GmailApp.getUserLabelByName('Processed'));
});
});
}
// Set up trigger
function setupTrigger() {
ScriptApp.newTrigger('processNewEmails')
.timeBased()
.everyMinutes(5)
.create();
}
Email arrives
│
▼
┌─────────────────┐
│ Apply Filters │ → Skip if doesn't match
│ (sender, subject│
│ attachment) │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Process Content │ → Extract data, attachments
│ │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Organize │ → Save files, apply labels
│ │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Notify │ → Slack, email, SMS
│ │
└─────────────────┘
schedule: "daily at 6am"
steps:
1. Collect all unprocessed emails from last 24h
2. Group by category (invoices, reports, misc)
3. Batch upload to respective Drive folders
4. Generate summary report
5. Send daily digest to stakeholders
conditions:
- if: attachment_type == "pdf" AND subject contains "invoice"
then: route_to_finance_folder
- if: from_domain in ["important-client.com"]
then: priority_handling + immediate_notification
- if: attachment_size > 10MB
then: save_to_large_files_folder + skip_backup
- default:
then: standard_processing
| 问题 | 解决方案 |
|---|---|
| 未检测到附件 | 检查 MIME 类型过滤器,增加触发频率 |
| 重复文件 | 通过哈希或文件名启用去重 |
| 速率限制 | 降低触发频率,使用批量处理 |
| 权限错误 | 重新授权 OAuth 凭据 |
| 大文件处理失败 | 设置大小限制,使用分块上传 |
gmail.readonly 用于读取gmail.modify 用于标签/归档drive.file 用于 Drive 访问每日邮件报告:
# Email Activity Report - 2026-01-30
## Summary
- Emails Received: 47
- Emails Sent: 23
- Attachments Processed: 12
- Average Response Time: 2.3 hours
## Attachment Processing
| File | Sender | Saved To | Time |
|------|--------|----------|------|
| Invoice_Jan.pdf | vendor@co.com | /Finance/Invoices | 09:15 |
| Report_Q4.xlsx | team@company.com | /Reports/Q4 | 10:30 |
| Contract_v2.docx | legal@client.com | /Contracts | 14:22 |
## Labels Applied
- Finance/Invoices: 5 emails
- Projects/Active: 12 emails
- Clients/Priority: 8 emails
## Pending Actions
- 3 emails require manual review
- 2 large attachments need approval
Gmail Workflows Skill - Part of Claude Office Skills
每周安装次数
86
仓库
GitHub 星标数
7
首次出现
3 天前
安全审计
安装于
claude-code69
gemini-cli32
github-copilot32
codex32
amp32
cline32
Automate Gmail with intelligent workflows for attachment management, email organization, and Google Drive integration. Based on n8n's 7,800+ workflow templates.
This skill helps you design and implement Gmail automation workflows that:
Purpose : Automatically extract attachments from emails and save to Google Drive
Workflow Steps :
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Gmail │───▶│ Filter by │───▶│ Extract │───▶│ Upload to │
│ Trigger │ │ Criteria │ │ Attachments │ │ Google Drive│
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
│
┌─────────────┐ ┌─────────────┐ │
│ Send │◀───│ Apply Label │◀───┘
│ Notification│ │ & Archive │
└─────────────┘ └─────────────┘
Configuration :
trigger:
type: gmail_new_email
filters:
has_attachment: true
from: ["*@company.com", "*@vendor.com"]
subject_contains: ["invoice", "report", "contract"]
actions:
- extract_attachments:
file_types: [pdf, xlsx, docx, csv]
max_size_mb: 25
- upload_to_drive:
folder_path: "/Attachments/{year}/{month}"
naming_pattern: "{filename}_{sender}_{date}"
create_folder_if_missing: true
- organize_email:
apply_label: "Processed/Attachments"
mark_as_read: true
archive: true
- notify:
channel: slack
message: "New attachment saved: {filename} from {sender}"
Best Practices :
Purpose : Automatically collect and organize invoices from email
Workflow Steps :
Gmail Trigger → Detect Invoice → Extract PDF → OCR/Parse → Save to Drive → Update Spreadsheet → Archive Email
Configuration :
trigger:
subject_patterns:
- "invoice"
- "bill"
- "statement"
- "付款"
- "发票"
processing:
- detect_invoice:
methods: [subject_keywords, attachment_name, sender_domain]
- extract_data:
fields: [invoice_number, amount, date, vendor, due_date]
use_ocr: true
- save_to_drive:
folder: "/Finance/Invoices/{year}/{vendor}"
naming: "{date}_{vendor}_{amount}"
- update_tracker:
spreadsheet: "Invoice Tracker"
columns: [Date, Vendor, Amount, Invoice#, Status, File_Link]
- archive:
label: "Finance/Invoices"
star: true
Purpose : Automatically organize client emails by project/client
Configuration :
rules:
- name: "Client A Emails"
condition:
from_domain: "clienta.com"
actions:
- apply_label: "Clients/Client A"
- forward_to: "team-a@company.com"
- save_attachments: "/Clients/Client A/{subject}"
- name: "Project X Updates"
condition:
subject_contains: ["Project X", "PX-"]
actions:
- apply_label: "Projects/Project X"
- add_to_task: "Project X Board"
- notify_slack: "#project-x"
- name: "Urgent Requests"
condition:
subject_contains: ["URGENT", "ASAP", "紧急"]
is_unread: true
actions:
- apply_label: "Priority/Urgent"
- send_sms: "+1234567890"
- move_to_inbox: true
Purpose : Track email metrics and generate reports
Metrics to Track :
daily_metrics:
- emails_received: count(inbox)
- emails_sent: count(sent)
- response_time_avg: avg(reply_time)
- unread_count: count(unread)
- attachment_count: count(has_attachment)
weekly_report:
- top_senders: group_by(from, count)
- busiest_hours: group_by(hour, count)
- label_distribution: group_by(label, count)
- response_rate: sent / received
automation:
- schedule: "every Monday 9am"
- output: Google Sheets
- notify: Slack #email-metrics
// n8n Workflow: Gmail to Google Drive
{
"nodes": [
{
"name": "Gmail Trigger",
"type": "n8n-nodes-base.gmailTrigger",
"parameters": {
"pollTimes": { "item": [{ "mode": "everyMinute" }] },
"filters": { "labelIds": ["INBOX"] }
}
},
{
"name": "Filter Attachments",
"type": "n8n-nodes-base.if",
"parameters": {
"conditions": {
"boolean": [{
"value1": "={{ $json.hasAttachment }}",
"value2": true
}]
}
}
},
{
"name": "Get Attachments",
"type": "n8n-nodes-base.gmail",
"parameters": {
"operation": "getAttachments",
"messageId": "={{ $json.id }}"
}
},
{
"name": "Upload to Drive",
"type": "n8n-nodes-base.googleDrive",
"parameters": {
"operation": "upload",
"folderId": "your-folder-id",
"name": "={{ $json.filename }}"
}
}
]
}
// Gmail to Drive Automation
function processNewEmails() {
const threads = GmailApp.search('has:attachment is:unread');
const targetFolder = DriveApp.getFolderById('FOLDER_ID');
threads.forEach(thread => {
const messages = thread.getMessages();
messages.forEach(message => {
const attachments = message.getAttachments();
attachments.forEach(attachment => {
// Save to Drive
const file = targetFolder.createFile(attachment);
// Rename with date and sender
const newName = `${Utilities.formatDate(message.getDate(), 'GMT', 'yyyy-MM-dd')}_${message.getFrom()}_${attachment.getName()}`;
file.setName(newName);
});
// Mark as processed
message.markRead();
thread.addLabel(GmailApp.getUserLabelByName('Processed'));
});
});
}
// Set up trigger
function setupTrigger() {
ScriptApp.newTrigger('processNewEmails')
.timeBased()
.everyMinutes(5)
.create();
}
Email arrives
│
▼
┌─────────────────┐
│ Apply Filters │ → Skip if doesn't match
│ (sender, subject│
│ attachment) │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Process Content │ → Extract data, attachments
│ │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Organize │ → Save files, apply labels
│ │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Notify │ → Slack, email, SMS
│ │
└─────────────────┘
schedule: "daily at 6am"
steps:
1. Collect all unprocessed emails from last 24h
2. Group by category (invoices, reports, misc)
3. Batch upload to respective Drive folders
4. Generate summary report
5. Send daily digest to stakeholders
conditions:
- if: attachment_type == "pdf" AND subject contains "invoice"
then: route_to_finance_folder
- if: from_domain in ["important-client.com"]
then: priority_handling + immediate_notification
- if: attachment_size > 10MB
then: save_to_large_files_folder + skip_backup
- default:
then: standard_processing
| Issue | Solution |
|---|---|
| Attachments not detected | Check MIME type filters, increase trigger frequency |
| Duplicate files | Enable deduplication by hash or filename |
| Rate limits | Reduce trigger frequency, use batch processing |
| Permission errors | Re-authorize OAuth credentials |
| Large files failing | Set size limits, use chunked upload |
OAuth Scopes : Request minimal permissions
gmail.readonly for readinggmail.modify for labels/archivedrive.file for Drive accessData Privacy :
Access Control :
Daily Email Report :
# Email Activity Report - 2026-01-30
## Summary
- Emails Received: 47
- Emails Sent: 23
- Attachments Processed: 12
- Average Response Time: 2.3 hours
## Attachment Processing
| File | Sender | Saved To | Time |
|------|--------|----------|------|
| Invoice_Jan.pdf | vendor@co.com | /Finance/Invoices | 09:15 |
| Report_Q4.xlsx | team@company.com | /Reports/Q4 | 10:30 |
| Contract_v2.docx | legal@client.com | /Contracts | 14:22 |
## Labels Applied
- Finance/Invoices: 5 emails
- Projects/Active: 12 emails
- Clients/Priority: 8 emails
## Pending Actions
- 3 emails require manual review
- 2 large attachments need approval
Gmail Workflows Skill - Part of Claude Office Skills
Weekly Installs
86
Repository
GitHub Stars
7
First Seen
3 days ago
Security Audits
Gen Agent Trust HubPassSocketFailSnykWarn
Installed on
claude-code69
gemini-cli32
github-copilot32
codex32
amp32
cline32
Azure RBAC 权限管理工具:查找最小角色、创建自定义角色与自动化分配
104,600 周安装
客户成功管理全流程指南:从客户入职、健康度评分到留存策略
271 周安装
Claude Code技能智能路由器 - 分析需求推荐最佳开发技能工具
271 周安装
Apollo Kotlin:Android与JVM的强类型GraphQL客户端,支持Kotlin多平台
271 周安装
专业图表创建工具 - 支持Mermaid/PlantUML生成流程图、架构图、UML图
271 周安装
Voicebox 开源语音合成与克隆工具:本地化 TTS 工作室,替代 ElevenLabs
271 周安装
临床报告撰写指南:病例报告、诊断报告、临床试验报告与患者文档的AI辅助工具
271 周安装