Gmail附件备份到Google Drive
中级
这是一个IT Ops领域的自动化工作流,包含 8 个节点。主要使用 Code, Gmail, GoogleDrive, GmailTrigger 等节点。 Gmail附件备份到Google Drive
前置要求
- •Google 账号和 Gmail API 凭证
- •Google Drive API 凭证
分类
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"meta": {
"instanceId": "7d8066d2f56a07000fe7d753d3eeabf0ecdf68413466f30d10afe0906f058427",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "9b0e3c5c-6f27-4034-b281-960b039b883a",
"name": "Gmail 触发器",
"type": "n8n-nodes-base.gmailTrigger",
"position": [
0,
-20
],
"parameters": {
"filters": {
"sender": "akhilgadiraju@gmail.com"
},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
}
},
"credentials": {
"gmailOAuth2": {
"id": "wqFUFuFpF5eRAp4E",
"name": "Gmail OAuth2 - Akhil"
}
},
"typeVersion": 1.2
},
{
"id": "c68ebbfb-8fad-4f2b-837b-fb8ac0ffe4df",
"name": "Gmail",
"type": "n8n-nodes-base.gmail",
"position": [
220,
-20
],
"webhookId": "2614ede2-d4ce-4490-9792-8157980bece3",
"parameters": {
"simple": false,
"options": {
"downloadAttachments": true,
"dataPropertyAttachmentsPrefixName": "attachment_"
},
"messageId": "={{ $json.id }}",
"operation": "get"
},
"credentials": {
"gmailOAuth2": {
"id": "wqFUFuFpF5eRAp4E",
"name": "Gmail OAuth2 - Akhil"
}
},
"typeVersion": 2.1
},
{
"id": "40b97338-6ffe-4cfd-869e-a50815808a89",
"name": "替换我",
"type": "n8n-nodes-base.noOp",
"position": [
800,
-20
],
"parameters": {},
"typeVersion": 1
},
{
"id": "0d4ae5a5-51d5-4917-8a88-7828d2f0e5ea",
"name": "Google Drive",
"type": "n8n-nodes-base.googleDrive",
"position": [
620,
-20
],
"parameters": {
"name": "={{ $('Gmail Trigger').item.json.id + \"_\" + $now + \"_\" + \"backup_attachment\" }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive",
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
"cachedResultName": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "list",
"value": "1aZmIqT9jG-GqW_OIGT3HWvRb6JalTlBi",
"cachedResultUrl": "https://drive.google.com/drive/folders/1aZmIqT9jG-GqW_OIGT3HWvRb6JalTlBi",
"cachedResultName": "DOcs"
},
"inputDataFieldName": "=data"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "LxzMJWxwgbnYKUly",
"name": "Google Drive - Akhil"
}
},
"typeVersion": 3
},
{
"id": "3f2bd52a-7637-4b65-bae3-daebc5f664de",
"name": "代码",
"type": "n8n-nodes-base.code",
"position": [
420,
-20
],
"parameters": {
"jsCode": "return Object.entries(items[0].binary).map(([key, value]) => {\n return {\n binary: {\n data: value\n }\n };\n});"
},
"typeVersion": 2
},
{
"id": "c0ae6ad0-7f25-4912-9bbd-7610ef61d6cd",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
140,
-120
],
"parameters": {
"color": 4,
"width": 260,
"height": 80,
"content": "### 更改发件人筛选器"
},
"typeVersion": 1
},
{
"id": "0552dd8a-341e-4a67-ad12-8bab41371685",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
560,
140
],
"parameters": {
"color": 4,
"height": 180,
"content": "### 更改目标文件夹"
},
"typeVersion": 1
},
{
"id": "f19c4cff-b85d-4ac3-99d7-bf70e61fe5bb",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
740,
-140
],
"parameters": {
"height": 100,
"content": "### 添加上传后逻辑"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"Code": {
"main": [
[
{
"node": "Google Drive",
"type": "main",
"index": 0
}
]
]
},
"Gmail": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Replace Me": {
"main": [
[]
]
},
"Google Drive": {
"main": [
[
{
"node": "Replace Me",
"type": "main",
"index": 0
}
]
]
},
"Gmail Trigger": {
"main": [
[
{
"node": "Gmail",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - IT 运维
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
Gmail到Google Drive邮件导出工作流
Gmail到Google Drive邮件导出工作流
Set
Code
Gmail
+5
13 节点Akhil Varma Gadiraju
IT 运维
AI驱动的知识助手
基于AI的知识助手,使用Google Sheets、OpenAI和Supabase向量搜索
Set
Code
Gmail
+7
14 节点Akhil Varma Gadiraju
工程
[AOE] 收件箱和日历管理 Agent
使用 Gmail、Google Calendar 和 GPT-4o AI 自动化邮件与日历管理
Code
Gmail
Gmail Tool
+17
38 节点AOE Agent Lab
人工智能
使用Gmail、OpenAI和Google Drive提取和分类发票与收据
使用Gmail、OpenAI和Google Drive提取和分类发票与收据
If
Set
Code
+10
20 节点Tom
财务
Gmail到向量嵌入与PGVector和Ollama
使用PGVector和Ollama的Gmail向量嵌入
If
Set
Code
+12
20 节点Alfonso Corretti
客户支持
AI邮件分诊与GPT-4警报系统及Telegram通知
AI邮件分诊与GPT-4警报系统及Telegram通知
If
Set
Gmail
+22
104 节点Peter Joslyn
客户支持