8
n8n 中文网amn8n.com

Gmail邮件每日自动归档

初级

这是一个Building Blocks领域的自动化工作流,包含 4 个节点。主要使用 Gmail, SplitOut, ScheduleTrigger 等节点。 Gmail邮件的每日自动归档功能

前置要求
  • Google 账号和 Gmail API 凭证

使用的节点 (4)

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "c62c01f3e843893075a10f252ec7d6d69e5ab593af019f50055d506cb3081b99",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "61682ff7-397d-4ecb-a98f-91d45d5a07a1",
      "name": "Daily Trigger at 4AM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -140,
        160
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 4
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "84a83cf9-63fc-40cf-bfa6-bc01ad67b3b7",
      "name": "Fetch Gmail Inbox Emails",
      "type": "n8n-nodes-base.gmail",
      "position": [
        80,
        160
      ],
      "webhookId": "57a7df32-d350-4e67-b106-f7b5b8b39f08",
      "parameters": {
        "filters": {
          "labelIds": "={{ [\"INBOX\"] }}",
          "receivedBefore": "={{ new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString() }}"
        },
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "T6a7nzYASeRq8gwp",
          "name": "Gmail account [abc@mail.com]"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "29939c36-30d1-499a-9c1b-9d3e4c4c9ba5",
      "name": "Split Each Email",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        300,
        160
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "id"
      },
      "typeVersion": 1
    },
    {
      "id": "316ad247-78c2-4fbb-b420-94bb8fb354f3",
      "name": "Archive Message (Remove INBOX Label)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        520,
        160
      ],
      "webhookId": "44a7f451-9ebb-4a08-86b2-1c4cb8600bcc",
      "parameters": {
        "labelIds": [
          "INBOX"
        ],
        "messageId": "={{ $json.id }}",
        "operation": "removeLabels"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "T6a7nzYASeRq8gwp",
          "name": "Gmail account [abc@mail.com]"
        }
      },
      "typeVersion": 2.1
    }
  ],
  "pinData": {},
  "connections": {
    "Split Each Email": {
      "main": [
        [
          {
            "node": "Archive Message (Remove INBOX Label)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Trigger at 4AM": {
      "main": [
        [
          {
            "node": "Fetch Gmail Inbox Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Gmail Inbox Emails": {
      "main": [
        [
          {
            "node": "Split Each Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Archive Message (Remove INBOX Label)": {
      "main": [
        []
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

初级 - 构建模块

需要付费吗?

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

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

适合 n8n 新手,包含 1-5 个节点的简单工作流

作者
Niranjan G

Niranjan G

@niranjan

Cybersecurity leader turning complex workflows into seamless, AI-driven automations.

外部链接
在 n8n.io 查看

分享此工作流