8
n8n 中文网amn8n.com

我的工作流程 2

高级

这是一个Market Research, AI Summarization领域的自动化工作流,包含 16 个节点。主要使用 Code, Merge, Webhook, GoogleSheets, SplitInBatches 等节点。 使用 ScrapeGraphAI、GPT-4 和 Google Sheets 自动化深度研究

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "VhEwspDqzu7ssFVE",
  "meta": {
    "instanceId": "f4b0efaa33080e7774e0d9285c40c7abcd2c6f7cf1a8b901fa7106170dd4cda3",
    "templateCredsSetupCompleted": true
  },
  "name": "我的工作流程 2",
  "tags": [],
  "nodes": [
    {
      "id": "48a84828-73de-4f4b-beb1-60e668342c11",
      "name": "研究请求Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -2048,
        624
      ],
      "webhookId": "5a9368a9-013f-41db-82cc-18be19ea6684",
      "parameters": {
        "path": "research-trigger",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 1.1
    },
    {
      "id": "5d8a05fa-1528-4dc4-95cd-d99625a2221b",
      "name": "研究配置处理器",
      "type": "n8n-nodes-base.code",
      "position": [
        -1760,
        624
      ],
      "parameters": {
        "jsCode": "// Extract and validate research parameters\nconst body = $input.all()[0].json.body;\n\n// Default research configuration\nconst researchConfig = {\n  topic: body.topic || 'artificial intelligence trends',\n  depth: body.depth || 'comprehensive', // basic, detailed, comprehensive\n  sources: body.sources || ['web', 'academic', 'news'],\n  timeframe: body.timeframe || '6months',\n  language: body.language || 'en',\n  maxSources: body.maxSources || 10,\n  analysisType: body.analysisType || 'summary' // summary, detailed, comparative\n};\n\n// Generate search queries based on topic\nconst baseQueries = [\n  `${researchConfig.topic} latest developments`,\n  `${researchConfig.topic} research findings`,\n  `${researchConfig.topic} market analysis`,\n  `${researchConfig.topic} expert opinions`,\n  `${researchConfig.topic} case studies`\n];\n\n// Add specific queries based on depth\nif (researchConfig.depth === 'comprehensive') {\n  baseQueries.push(\n    `${researchConfig.topic} academic papers`,\n    `${researchConfig.topic} industry reports`,\n    `${researchConfig.topic} statistical data`,\n    `${researchConfig.topic} future predictions`\n  );\n}\n\nreturn [{\n  json: {\n    ...researchConfig,\n    searchQueries: baseQueries,\n    timestamp: new Date().toISOString(),\n    sessionId: `research_${Date.now()}`\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "19e3c76b-f0fb-4324-b212-585ab132bde5",
      "name": "拆分搜索查询",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1456,
        624
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "6eb0ff10-aaf6-430f-aea0-7c0cbe950b95",
      "name": "查询选择器",
      "type": "n8n-nodes-base.code",
      "position": [
        -1152,
        624
      ],
      "parameters": {
        "jsCode": "// Get current batch data\nconst items = $input.all();\nconst currentItem = items[0].json;\nconst queries = currentItem.searchQueries;\nconst currentBatch = $('Split Search Queries').item.json;\n\n// Get current query\nconst currentQuery = queries[currentBatch.index];\n\nreturn [{\n  json: {\n    ...currentItem,\n    currentQuery: currentQuery,\n    batchIndex: currentBatch.index\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "99f73593-0ddd-4fc9-810f-8b1793cd8476",
      "name": "AI研究爬虫",
      "type": "n8n-nodes-scrapegraphai.scrapegraphAi",
      "position": [
        -848,
        624
      ],
      "parameters": {
        "userPrompt": "Research and extract comprehensive information about this topic. Provide: 1) Key findings and insights, 2) Important statistics or data points, 3) Expert quotes or opinions, 4) Recent developments, 5) Source credibility assessment. Format as structured JSON with fields: title, summary, keyPoints, statistics, quotes, sources, credibilityScore, datePublished, relevanceScore.",
        "websiteUrl": "={{ $json.currentQuery }}"
      },
      "typeVersion": 1
    },
    {
      "id": "da52e96d-0aa2-41ef-886e-bd396e0f42f2",
      "name": "新闻来源爬虫",
      "type": "n8n-nodes-scrapegraphai.scrapegraphAi",
      "position": [
        -848,
        832
      ],
      "parameters": {
        "userPrompt": "Extract recent news articles about this topic. For each article provide: headline, publication date, source, brief summary, and direct URL. Focus on credible news sources and recent publications within the last 6 months.",
        "websiteUrl": "https://www.google.com/search?q={{ encodeURIComponent($json.currentQuery) }}&tbm=nws"
      },
      "typeVersion": 1
    },
    {
      "id": "0ee6cf16-02e5-4a3b-b068-dd76a1351718",
      "name": "学术来源爬虫",
      "type": "n8n-nodes-scrapegraphai.scrapegraphAi",
      "position": [
        -848,
        1024
      ],
      "parameters": {
        "userPrompt": "Extract academic papers and research studies. For each paper provide: title, authors, publication year, journal/conference, citation count, abstract summary, and DOI/URL if available. Focus on peer-reviewed sources and recent publications.",
        "websiteUrl": "https://scholar.google.com/scholar?q={{ encodeURIComponent($json.currentQuery) }}"
      },
      "typeVersion": 1
    },
    {
      "id": "3228908f-f816-4a0c-889b-abf756281eb8",
      "name": "合并研究来源",
      "type": "n8n-nodes-base.merge",
      "position": [
        -560,
        832
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "mergeByFields": {
          "values": [
            {}
          ]
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "90b55ee1-3404-4db2-aec1-6d6219043c09",
      "name": "研究数据处理器",
      "type": "n8n-nodes-base.code",
      "position": [
        -256,
        832
      ],
      "parameters": {
        "jsCode": "// Combine and process all research data\nconst allItems = $input.all();\nconst researchData = allItems[0].json;\nconst newsData = allItems[1]?.json || {};\nconst academicData = allItems[2]?.json || {};\n\n// Extract and structure the research findings\nconst processedData = {\n  sessionId: researchData.sessionId,\n  query: researchData.currentQuery,\n  batchIndex: researchData.batchIndex,\n  timestamp: new Date().toISOString(),\n  \n  // General research findings\n  generalFindings: {\n    title: researchData.result?.title || 'Research Findings',\n    summary: researchData.result?.summary || '',\n    keyPoints: researchData.result?.keyPoints || [],\n    statistics: researchData.result?.statistics || [],\n    credibilityScore: researchData.result?.credibilityScore || 0\n  },\n  \n  // News findings\n  newsFindings: {\n    articles: newsData.result?.articles || [],\n    totalArticles: newsData.result?.articles?.length || 0\n  },\n  \n  // Academic findings\n  academicFindings: {\n    papers: academicData.result?.papers || [],\n    totalPapers: academicData.result?.papers?.length || 0\n  },\n  \n  // Meta information\n  sourceTypes: ['general', 'news', 'academic'],\n  totalSources: (researchData.result?.sources?.length || 0) + \n                (newsData.result?.articles?.length || 0) + \n                (academicData.result?.papers?.length || 0)\n};\n\nreturn [{\n  json: processedData\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "7eb34b80-f6d2-4e80-83f5-529d4748cbec",
      "name": "研究数据存储",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        352,
        832
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "sessionId",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Session ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "query",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Research Query",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "timestamp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "analysis",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "AI Analysis",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "totalSources",
              "type": "number",
              "display": true,
              "required": false,
              "displayName": "Total Sources",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": []
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Research_Data"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": ""
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "d093ce1d-9716-4254-89b7-4b8bffd23b48",
      "name": "研究完成响应",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        656,
        832
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({\n  status: 'completed',\n  sessionId: $json.sessionId,\n  message: 'Research analysis completed successfully',\n  totalSources: $json.totalSources,\n  timestamp: $json.timestamp\n}) }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "8398d709-67b8-4ad4-90f0-d2c041d4678e",
      "name": "Webhook触发器指南",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2160,
        -448
      ],
      "parameters": {
        "color": 2,
        "width": 520,
        "height": 1732,
        "content": "# 步骤1:研究请求Webhook 🎯\\n\\n此Webhook端点接收研究请求并启动深度研究流程。\\n\\n## 请求格式\\n```json\\n{\\n  \"topic\": \"artificial intelligence in healthcare\",\\n  \"depth\": \"comprehensive\",\\n  \"sources\": [\"web\", \"academic\", \"news\"],\\n  \"timeframe\": \"6months\",\\n  \"maxSources\": 15,\\n  \"analysisType\": \"detailed\"\\n}\\n```\\n\\n## 配置\\n- **方法**: POST\\n- **路径**: /research-trigger\\n- **认证**: 可选的API密钥\\n- **速率限制**: 可配置\\n\\n## 深度级别\\n- **基础**: 快速概览,包含3-5个来源\\n- **详细**: 全面分析,包含8-12个来源\\n- **全面**: 深度研究,包含15+个来源和学术论文\\n\\n## 来源类型\\n- **网络**: 通用网络内容和行业网站\\n- **新闻**: 近期新闻文章和新闻稿\\n- **学术**: 同行评审论文和研究报告"
      },
      "typeVersion": 1
    },
    {
      "id": "965963f7-6f98-4954-a0f0-916ab00477be",
      "name": "配置指南",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1600,
        -448
      ],
      "parameters": {
        "color": 2,
        "width": 520,
        "height": 1748,
        "content": "# 步骤2:研究配置处理器 🔧\\n\\n此节点处理并验证传入的研究请求,设置研究参数。\\n\\n## 功能\\n- 验证和清理输入参数\\n- 为缺失参数设置默认值\\n- 基于主题生成多个搜索查询\\n- 创建唯一的会话ID用于跟踪\\n- 配置研究深度和范围\\n\\n## 查询生成策略\\n- **基础查询**: 核心主题搜索\\n- **深度特定**: 全面研究的附加查询\\n- **时间敏感**: 近期发展和趋势\\n- **多角度**: 不同视角和观点\\n\\n## 自定义选项\\n- 修改查询生成逻辑\\n- 添加行业特定搜索模式\\n- 实现自定义验证规则\\n- 配置默认研究参数"
      },
      "typeVersion": 1
    },
    {
      "id": "47a160d4-d829-4133-93fa-aa4dbd41f785",
      "name": "AI爬取指南",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1040,
        -448
      ],
      "parameters": {
        "color": 3,
        "width": 520,
        "height": 1748,
        "content": "# 步骤3:多源AI爬取 🤖\\n\\n三个并行的AI驱动爬虫从不同来源类型收集数据,实现全面研究覆盖。\\n\\n## AI研究爬虫\\n- **目的**: 通用网络研究和行业洞察\\n- **重点**: 关键发现、统计数据、专家意见\\n- **输出**: 带有可信度评分的结构化洞察\\n\\n## 新闻来源爬虫\\n- **目的**: 近期新闻和当前发展\\n- **重点**: 标题、发布日期、可信来源\\n- **输出**: 带摘要的时间戳新闻文章\\n\\n## 学术来源爬虫\\n- **目的**: 同行评审研究和学术文章\\n- **重点**: 学术论文、引用、研究报告\\n- **输出**: 带有元数据的科学文献\\n\\n## ScrapeGraphAI优势\\n- **AI驱动**: 智能内容提取\\n- **结构化输出**: 一致的数据格式\\n- **来源验证**: 可信度评估\\n- **多语言**: 全球研究能力"
      },
      "typeVersion": 1
    },
    {
      "id": "503cdf42-cee7-4b44-a2fd-4f4a4a134f60",
      "name": "处理与分析指南",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -464,
        -448
      ],
      "parameters": {
        "color": 3,
        "width": 520,
        "height": 1748,
        "content": "# 步骤4:数据处理与AI分析 🧠\\n\\n先进的数据处理和AI驱动分析,从收集的研究数据中生成可操作的洞察。\\n\\n## 研究数据处理器\\n- **合并**: 将所有来源类型统一为结构化数据\\n- **验证**: 数据质量和完整性\\n- **丰富**: 元数据和来源归属\\n- **结构化**: 优化分析和存储\\n\\n## AI研究分析师\\n- **模型**: GPT-4用于复杂分析\\n- **分析类型**: 摘要、趋势、冲突、可靠性\\n- **输出**: 带有可操作洞察的执行摘要\\n- **温度**: 低(0.3)确保一致、事实性分析\\n\\n## 分析组件\\n1. **执行摘要**: 高层概览\\n2. **关键洞察**: 主要发现和趋势\\n3. **可靠性评估**: 来源可信度评估\\n4. **建议**: 可操作的后续步骤\\n5. **进一步研究**: 建议的调查领域"
      },
      "typeVersion": 1
    },
    {
      "id": "0105d893-94ce-465d-9ef8-8f144280f0c9",
      "name": "存储与响应指南",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        -432
      ],
      "parameters": {
        "color": 4,
        "width": 840,
        "height": 1716,
        "content": "# 步骤5:数据存储与响应 📊\\n\\n安全存储研究发现并结构化响应交付,实现与其他系统的无缝集成。\\n\\n## Google Sheets存储\\n- **表格结构**: Research_Data包含全面列\\n- **数据保留**: 历史研究用于趋势分析\\n- **访问控制**: 安全的OAuth2认证\\n- **格式**: 结构化数据,可直接用于分析和报告\\n\\n## 响应交付\\n- **格式**: 包含状态和元数据的JSON\\n- **内容**: 会话ID、完成状态、来源数量\\n- **集成**: 准备就绪供Webhook消费者和API使用\\n- **跟踪**: 唯一会话ID用于研究关联\\n\\n## 数据管理功能\\n- **版本控制**: 跟踪研究迭代\\n- **导出**: 支持多种格式\\n- **共享**: 团队协作能力\\n- **分析**: 内置Google Sheets分析工具\\n\\n## 使用场景\\n- **市场研究**: 竞争分析和趋势\\n- **学术研究**: 文献综述和引用\\n- **商业智能**: 行业洞察和报告"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "076dd376-d6cb-4851-b335-e074cd47911c",
  "connections": {
    "Query Selector": {
      "main": [
        [
          {
            "node": "AI Research Scraper",
            "type": "main",
            "index": 0
          },
          {
            "node": "News Sources Scraper",
            "type": "main",
            "index": 0
          },
          {
            "node": "Academic Sources Scraper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Research Scraper": {
      "main": [
        [
          {
            "node": "Merge Research Sources",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "News Sources Scraper": {
      "main": [
        [
          {
            "node": "Merge Research Sources",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Split Search Queries": {
      "main": [
        [
          {
            "node": "Query Selector",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Research Data Storage": {
      "main": [
        [
          {
            "node": "Research Complete Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Research Sources": {
      "main": [
        [
          {
            "node": "Research Data Processor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Research Data Processor": {
      "main": [
        [
          {
            "node": "Research Data Storage",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Research Request Webhook": {
      "main": [
        [
          {
            "node": "Research Configuration Processor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Research Configuration Processor": {
      "main": [
        [
          {
            "node": "Split Search Queries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 市场调研, AI 摘要总结

需要付费吗?

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

工作流信息
难度等级
高级
节点数量16
分类2
节点类型8
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

外部链接
在 n8n.io 查看

分享此工作流