8
n8n 中文网amn8n.com

自动新闻摘要与邮件简报(GPT-4、NewsAPI 和 Gmail)

中级

这是一个AI, Marketing领域的自动化工作流,包含 7 个节点。主要使用 Gmail, HttpRequest, GoogleSheets, Agent, ScheduleTrigger 等节点,结合人工智能技术实现智能自动化。 使用 GPT-4、NewsAPI 和 Gmail 自动生成新闻摘要与邮件简报

前置要求
  • Google 账号和 Gmail API 凭证
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "5aaf4236c70e34e423fbdb2c7b754d19253a933bb1476d548f75848a01e473cf",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "c5091fb1-5bc5-44bc-b804-201d5ffe0672",
      "name": "定时触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2120,
        -40
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 10
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "60424e56-7429-48c5-831c-056e9874b8a3",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1560,
        -40
      ],
      "parameters": {
        "text": "=You are act as news expert and collect all news headlines  in below and summarise in 5 bullets.\n\n\n {{ $json.articles[1].title }}",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "2bd28b32-80f9-4a69-9b1a-0eee7ef3db42",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1560,
        140
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "792376e9-3312-4862-94a0-e38de2e6dda5",
      "name": "拉取新闻",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1840,
        -40
      ],
      "parameters": {
        "url": "https://newsapi.org/v2/top-headlines",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "country",
              "value": "us"
            },
            {
              "name": "apiKey",
              "value": "NEWS_API_KEY"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "596c8d5d-3c03-435e-abab-e7b93de28471",
      "name": "发送邮件",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -980,
        -40
      ],
      "webhookId": "e5c02fba-64bc-47f0-b752-2de2b8e6b03c",
      "parameters": {
        "sendTo": "={{ $json.Email }}",
        "message": "=Hi {{ $json.Name }},\nPlease find the top news headlines as below:\n\n{{ $('AI Agent').item.json.output }}",
        "options": {},
        "subject": "News Headlines",
        "emailType": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "125b6015-f220-4245-94eb-08d61ece41b3",
      "name": "邮箱列表",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1200,
        -40
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1L2dLObdw_aicD6fTd-ElHSBBJIj1aBmKT7FecMtbyyE/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1L2dLObdw_aicD6fTd-ElHSBBJIj1aBmKT7FecMtbyyE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1L2dLObdw_aicD6fTd-ElHSBBJIj1aBmKT7FecMtbyyE/edit?usp=drivesdk",
          "cachedResultName": "Emails"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "b4146559-5d6c-4db3-aad5-12a73621aa90",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3020,
        -300
      ],
      "parameters": {
        "width": 740,
        "height": 1280,
        "content": "📰 AI 新闻摘要智能体:自动新闻摘要与邮件发送器"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Email list",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pull News": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email list": {
      "main": [
        [
          {
            "node": "Send Mail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Pull News",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 人工智能, 营销

需要付费吗?

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

工作流信息
难度等级
中级
节点数量7
分类2
节点类型7
难度说明

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

作者
Yaron Been

Yaron Been

@yaron-nofluff

Building AI Agents and Automations | Growth Marketer | Entrepreneur | Book Author & Podcast Host

外部链接
在 n8n.io 查看

分享此工作流