研究型 AI Agent:抓取并总结文章并保存到 Notion(Gemini、Browserless)

中级

这是一个Other、AI领域的自动化工作流,包含 9 个节点。主要使用 NotionTool、DiscordTool、Agent、ChatTrigger、ToolHttpRequest 等节点,结合人工智能技术实现智能自动化。 AI智能助手:抓取、总结文章并保存至Notion(Gemini,Browserless)

前置要求
  • Notion API Key
  • Discord Bot Token 或 Webhook
  • 可能需要目标 API 的认证凭证
  • Google Gemini API Key

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "4sKJLlAF2vqpkk2I",
  "meta": {
    "instanceId": "69133932b9ba8e1ef14816d0b63297bb44feb97c19f759b5d153ff6b0c59e18d"
  },
  "name": "研究型 AI Agent:抓取并总结文章并保存到 Notion(Gemini、Browserless)",
  "tags": [],
  "nodes": [
    {
      "id": "bbfff416-7270-4f1c-8024-b91b1c5acd1b",
      "name": "Gemini 2.5 PRO",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -840,
        20
      ],
      "parameters": {
        "options": {
          "temperature": 0
        },
        "modelName": "models/gemini-2.5-pro-exp-03-25"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "jLOqyTR4yTT1nYKi",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e1a4b171-0850-4d90-bf49-5c39888922af",
      "name": "website_scraper",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        -220,
        -100
      ],
      "parameters": {
        "url": "http://browserless:3000/content",
        "method": "POST",
        "jsonBody": "={\n  \"url\": \"{url}\",\n  \"gotoOptions\": {\n    \"waitUntil\": \"networkidle0\"\n  }\n} ",
        "sendBody": true,
        "specifyBody": "json",
        "toolDescription": "website_scraper: Scrape a website given it's URL",
        "placeholderDefinitions": {
          "values": [
            {
              "name": "url",
              "type": "string",
              "description": "the URL of the website to scrape"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "fd94022a-bf8d-47e6-b561-d622da350737",
      "name": "save_to_notion",
      "type": "n8n-nodes-base.notionTool",
      "position": [
        -620,
        -100
      ],
      "parameters": {
        "title": "={{ $fromAI('Title', `The original title of the article!`, 'string') }}",
        "blockUi": {
          "blockValues": [
            {
              "type": "heading_1",
              "textContent": "={{ $fromAI('Title', `The original title of the article!`, 'string') }}"
            },
            {
              "type": "heading_2",
              "textContent": "Quick Summary (TL;DR)"
            },
            {
              "textContent": "={{ $fromAI('Summary', `1-3 sentence summary capturing the absolute essence of this article`, 'string') }}"
            },
            {
              "type": "heading_2",
              "textContent": "={{ $fromAI('objective_title', `short title for the Problem Addressed / Objective section`, 'string') }}"
            },
            {
              "textContent": "={{ $fromAI('objective_text', `description of the core problem, question, or goal the article tackles. Keep it focused.`, 'string') }}"
            },
            {
              "type": "heading_2",
              "textContent": "={{ $fromAI('concepts_title', `title for the Key Concepts / Solution Overview section`, 'string') }}"
            },
            {
              "textContent": "={{ $fromAI('concepts_text', `Explain the main ideas, theories, or the high-level approach of the solution presented.`, 'string') }}"
            },
            {
              "type": "heading_2",
              "textContent": "Technologies & Libraries"
            },
            {
              "text": {
                "text": [
                  {
                    "text": "={{ $fromAI('technologies_list', `A bulleted list of Technologies, Libraries, Techniques and Patterns Mentioned in the article along with a short description for each`, 'string') }}",
                    "annotationUi": {}
                  }
                ]
              },
              "richText": true
            },
            {
              "type": "heading_2",
              "textContent": "Core Code Snippets"
            },
            {
              "textContent": "={{ $fromAI('important_code_snippet_description', `1-2 sentences of context explaining what this snippet does or why it's important.`, 'string') }}"
            },
            {
              "text": {
                "text": [
                  {
                    "text": "={{ $fromAI('important_code_snippet', `The actual code snippet. The AI must ensure this block doesn't exceed 2000 chars. If a crucial snippet is longer, the AI should either prioritize a key part of it or potentially link to the source if available. Specify the language (e.g., python, javascript) for syntax highlighting.`, 'string') }}",
                    "annotationUi": {
                      "code": true
                    }
                  }
                ]
              },
              "richText": true
            },
            {
              "type": "heading_2",
              "textContent": "Key Takeaways & Conclusion"
            },
            {
              "textContent": "={{ $fromAI('conclusions', `A bulleted item list that summarizes the main conclusions, results, or actionable insights from the article.`, 'string') }}"
            }
          ]
        },
        "options": {
          "icon": "={{ $fromAI('Icon', `Pick an emoji that would be good as an icon for this article. Remember, this should be a single emoji`, 'string') }}"
        },
        "resource": "databasePage",
        "databaseId": {
          "__rl": true,
          "mode": "list",
          "value": "1c385086-bf58-80a1-a60f-dbc96d64413f",
          "cachedResultUrl": "https://www.notion.so/1c385086bf5880a1a60fdbc96d64413f",
          "cachedResultName": "Knowledge Database"
        },
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "Description|rich_text",
              "textContent": "={{ $fromAI('Description', `Short description of what the article is about`, 'string') }}"
            },
            {
              "key": "URL|url",
              "urlValue": "={{ $fromAI('URL', `The URL where this article resides.`, 'string') }}"
            },
            {
              "key": "Tags|multi_select",
              "multiSelectValue": "={{ $fromAI('Tags', `General (generic) tags that would be relevant for this article, such as technologies used / talked about, programming language, techniques and so on! Keep them generic not ultra specific.`, 'string') }}"
            },
            {
              "key": "Publication Date|date",
              "date": "={{ $fromAI('publication_date', `The date this article was published if available on the page.`, 'string') }}",
              "includeTime": false
            }
          ]
        },
        "descriptionType": "manual",
        "toolDescription": "save_to_notion: This tool saves the information to the Notion database."
      },
      "credentials": {
        "notionApi": {
          "id": "MDVhXc92xUP3UjxB",
          "name": "Notion account"
        }
      },
      "notesInFlow": false,
      "typeVersion": 2.2
    },
    {
      "id": "0e70e938-97ac-4aa0-80c1-8f7c9c519b9d",
      "name": "discord_notification",
      "type": "n8n-nodes-base.discordTool",
      "position": [
        -420,
        -100
      ],
      "webhookId": "617fa695-5a0a-464e-b3f2-bcd77ab5965b",
      "parameters": {
        "embeds": {
          "values": [
            {
              "url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', ``, 'string') }}",
              "title": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Title', ``, 'string') }}",
              "description": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Description', ``, 'string') }}"
            }
          ]
        },
        "content": "={{ $fromAI('Message', `Start with an :information_source: emoji. Then tell the chat that the action has been completed.`, 'string') }}",
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": "1207038600731168821",
          "cachedResultUrl": "https://discord.com/channels/1207038600731168821",
          "cachedResultName": "Let's Talk Dev Community"
        },
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "1354563802854723774",
          "cachedResultUrl": "https://discord.com/channels/1207038600731168821/1354563802854723774",
          "cachedResultName": "research"
        }
      },
      "credentials": {
        "discordBotApi": {
          "id": "LfVy6XSgcAgRUPSS",
          "name": "Discord Bot account"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "ee123a65-f0db-45e8-8e78-618b6c2b74e9",
      "name": "保存文章到 Notion",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "onError": "continueErrorOutput",
      "position": [
        -700,
        -320
      ],
      "parameters": {
        "options": {
          "systemMessage": "=You will receive a URL. Your task is to:\n1. use the website_scraper to scrape the provided URL!\n2. use the save_to_notion tool to save the information to Notion.\n3. use the discord_notification tool to send a notification that the research is available, along with the notion URL of the created page.\n\n## Tools\nThe save_to_notion tool expects the following parameters:\n* title: the original title of the article\n* description: short description of what the article is about\n* url: the URL where this article resides.\n* tags: general (generic) tags that would be relevant for this article, such as technologies used / talked about, programming language, techniques and so on! Keep them generic not ultra specific.\n* publication_date: The date this article was published if available on the page.\n* summary: 1-3 sentence summary capturing the absolute essence of this article\n* objective_title: short title for the section about the problem addressed / objective\n* objective_text: description of the core problem, question, or goal the article tackles. Keep it focused.\n* concepts_title: title for the Key Concepts / Solution Overview section\n* concepts_text: explain the main ideas, theories, or the high-level approach of the solution presented. \n* technologies_list: A bulleted list of Technologies, Libraries, Techniques and Patterns Mentioned in the article along with a short description for each.\n* important_code_snippet_description: Description for The most important code snippet in the article. 1-2 sentences of context explaining what this snippet does or why it's important.\n* important_code_snippet: The actual code snippet. The AI must ensure this block doesn't exceed 2000 chars. If a crucial snippet is longer, the AI should either prioritize a key part of it or potentially link to the source if available. Specify the language (e.g., python, javascript) for syntax highlighting.\n* conclusions: A bulleted item list that summarizes the main conclusions, results, or actionable insights from the article.\n* icon: an emoji that represents this article best!\n\nRemember you always have to scrape the website using the website_scraper tool. Don't try to summarize without scraping!\nAlways save the results to notion using the save_to_notion tool. Only execute this tool once!"
        }
      },
      "executeOnce": true,
      "notesInFlow": false,
      "typeVersion": 1.7
    },
    {
      "id": "4a7f0a06-0d5f-4013-964c-fcc272484ff4",
      "name": "当收到聊天消息时",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -1000,
        -320
      ],
      "webhookId": "3e4878bb-dcb4-4591-975f-8f279605e90b",
      "parameters": {
        "public": true,
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "5bcfe9f7-a58f-4851-8ac4-ad6de06705df",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1060,
        -120
      ],
      "parameters": {
        "width": 340,
        "height": 260,
        "content": "## Google Gemini AI 模型"
      },
      "typeVersion": 1
    },
    {
      "id": "8a1ef34e-9f27-4e68-8ef2-34c488463512",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -280,
        -420
      ],
      "parameters": {
        "width": 380,
        "height": 460,
        "content": "## Browserless (https://www.browserless.io/)"
      },
      "typeVersion": 1
    },
    {
      "id": "dfba5742-663c-4b8c-a971-de120c8f73c1",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1980,
        -820
      ],
      "parameters": {
        "width": 860,
        "height": 980,
        "content": "## 设置"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "d5328d32-6ee9-4dd6-a68b-8736c85975fe",
  "connections": {
    "Gemini 2.5 PRO": {
      "ai_languageModel": [
        [
          {
            "node": "Save Article To Notion",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "save_to_notion": {
      "ai_tool": [
        [
          {
            "node": "Save Article To Notion",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "website_scraper": {
      "ai_tool": [
        [
          {
            "node": "Save Article To Notion",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "discord_notification": {
      "ai_tool": [
        [
          {
            "node": "Save Article To Notion",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Save Article To Notion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

这是一个中级难度的工作流,适用于Other、AI等场景。适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

需要付费吗?

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

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

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

作者
Mihai Farcas

Mihai Farcas

@mihailtd

Full-stack developer with 5+ years streamlining healthcare processes. Proficient in NodeJS, VueJS, MongoDB, PostgreSQL, Kubernetes, and n8n. Ready to optimize your workflows – book a consult via my link.

外部链接
在 n8n.io 上查看 →

分享此工作流