8
n8n 中文网amn8n.com

自动保存 Gmail 附件到 Google Drive

中级

这是一个File Management领域的自动化工作流,包含 6 个节点。主要使用 If, GoogleDrive, GmailTrigger 等节点。 自动保存 Gmail 附件到 Google Drive

前置要求
  • Google Drive API 凭证
  • Google 账号和 Gmail API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "2000c64071c20843606b95c63795bb0797c41036047055a6586498e855b96efc"
  },
  "nodes": [
    {
      "id": "6f21b176-7f42-4cbb-938e-5ffd61aac490",
      "name": "上传到 Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -720,
        -320
      ],
      "parameters": {
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_DRIVE_FOLDER_ID"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "9ff0cc89-232e-4720-8ffd-ad3a516d0fd2",
      "name": "Gmail 触发器",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -1248,
        -320
      ],
      "parameters": {
        "filters": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ab199d88-e3c0-4ce4-96af-fe338e45484e",
      "name": "如果(有附件)",
      "type": "n8n-nodes-base.if",
      "position": [
        -976,
        -320
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "has-attachments",
              "operator": {
                "type": "number",
                "operation": "notEquals"
              },
              "leftValue": "={{ $json.attachments.length }}",
              "rightValue": 0
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "3b2f527f-7376-4a5e-b937-44877b90046d",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1312,
        -880
      ],
      "parameters": {
        "color": 7,
        "width": 832,
        "height": 768,
        "content": "## Gmail 附件提取器到 Google Drive"
      },
      "typeVersion": 1
    },
    {
      "id": "48285db9-5075-4bd4-8642-5749267324b8",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        -928
      ],
      "parameters": {
        "color": 7,
        "height": 880,
        "content": "## 设置步骤"
      },
      "typeVersion": 1
    },
    {
      "id": "1cf8d9e0-1d2b-4d9e-a1bc-5e4713ffb848",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1632,
        -832
      ],
      "parameters": {
        "color": 7,
        "height": 688,
        "content": "## 配置节点"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "If (has Attachments)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If (has Attachments)": {
      "main": [
        [
          {
            "node": "Upload to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 文件管理

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量6
分类1
节点类型4
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
David Olusola

David Olusola

@dae221

I help ambitious businesses eliminate operational bottlenecks and scale faster with AI automation. My clients typically see 40-60% efficiency gains within 90 days. Currently accepting 3 new projects this quarter - david@daexai.com

外部链接
在 n8n.io 查看

分享此工作流