Modèle pour attraper les sujets

Avancé

Ceci est unMarket Research, AI Summarizationworkflow d'automatisation du domainecontenant 34 nœuds.Utilise principalement des nœuds comme If, Set, Code, Gmail, Merge. Utiliser Gemini pour analyser Reddit, YouTube et X et générer des rapports de stratégie de contenu

Prérequis
  • Compte Google et informations d'identification Gmail API
  • Informations d'identification Twitter API
  • Peut nécessiter les informations d'identification d'authentification de l'API cible
  • Informations d'identification Google Sheets API
  • Clé API Google Gemini
Aperçu du workflow
Visualisation des connexions entre les nœuds, avec support du zoom et du déplacement
Exporter le workflow
Copiez la configuration JSON suivante dans n8n pour importer et utiliser ce workflow
{
  "id": "qS9W7d2IVCxZZKaN",
  "meta": {
    "instanceId": "a912b1ffbf54f9a698ae2f03f134609ff21aef9627c34b8e5437966acbdecf88",
    "templateCredsSetupCompleted": true
  },
  "name": "选题捕手模板",
  "tags": [
    {
      "id": "yz1g2PbPKQgVLlgc",
      "name": "选题捕手",
      "createdAt": "2025-06-25T01:29:38.391Z",
      "updatedAt": "2025-06-25T01:29:38.391Z"
    }
  ],
  "nodes": [
    {
      "id": "9fed71e8-52e3-4c6e-9e95-22c387915f81",
      "name": "Apify Scraper x Tweets",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2780,
        1120
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/nfp1fpt5gUlBwPcor/run-sync-get-dataset-items",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "input",
              "value": "=={{ JSON.stringify({\n    \"queries\": [$(\"Analysis Parameters\").item.json.keyword],\n    \"tweets_desired\": 20,\n    \"proxyConfiguration\": {\n        \"useApifyProxy\": true\n    }\n}) }}"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "YTr69keQFFaEDz0m",
          "name": "My Apify API Key"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "858cf619-ed1b-4b9d-aa7d-6c99872641d5",
      "name": "ScrapingBee Scraper x Tweets",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2980,
        1120
      ],
      "parameters": {
        "url": "https://api.scrapingbee.com/api/v1",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "url",
              "value": "={{ \"https://x.com/search?q=\" + encodeURIComponent($json.keyword) }}"
            },
            {
              "name": "render_js",
              "value": "true"
            },
            {
              "name": "wait",
              "value": "3000"
            }
          ]
        }
      },
      "credentials": {
        "httpQueryAuth": {
          "id": "cSbiAkc95apO2jUK",
          "name": "My ScrapingBee Key"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "68a4588f-9086-4974-ac6e-57c5269b801f",
      "name": "twitterapi Scraper x Tweets",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2580,
        1120
      ],
      "parameters": {
        "url": "https://api.twitterapi.io/twitter/user/last_tweets",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "userName",
              "value": "={{ $('分成多条').item.json.users }}"
            },
            {
              "name": "cursor",
              "value": "={{ $json.cursor }}"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "kAPoPiTshPILpDam",
          "name": "抓取x博主推文"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "632ab262-c571-46b7-a2af-37b7e430522b",
      "name": "Boucle sur les Éléments",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -2200,
        360
      ],
      "parameters": {
        "options": {},
        "batchSize": 10
      },
      "typeVersion": 3
    },
    {
      "id": "9fb2d5ce-5f69-4c22-8f3a-6b4a681ab11e",
      "name": "Note Adhésive1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2980,
        840
      ],
      "parameters": {
        "color": 6,
        "width": 260,
        "height": 240,
        "content": "## X Third-party scraping tools\nX API is relatively easy to configure and suitable for quick start-up, but they offer limited free quotas. Here are three third-party scraping tools. Please refer to the official documentation for configuration instructions."
      },
      "typeVersion": 1
    },
    {
      "id": "40f49eac-3232-40d1-b6ad-c093d862cbbc",
      "name": "Note Adhésive",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2040,
        700
      ],
      "parameters": {
        "color": 6,
        "width": 220,
        "height": 140,
        "content": "## llm node\nJust change it to your usual one."
      },
      "typeVersion": 1
    },
    {
      "id": "7a0fbe60-d027-4be0-9a64-c2f652db85ed",
      "name": "Note Adhésive2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        220
      ],
      "parameters": {
        "color": 6,
        "content": "## URL configuration settings\n\nFeishu Group Chat - Settings - Create a new robot to obtain the webhook, then fill it in."
      },
      "typeVersion": 1
    },
    {
      "id": "12041c3c-5e45-4ae3-aeec-7769e9599f36",
      "name": "Déclencheur de Formulaire",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -3340,
        300
      ],
      "webhookId": "253ac9e8-08aa-4cf5-af18-287fcb5b496b",
      "parameters": {
        "options": {},
        "formTitle": "选题捕手",
        "formFields": {
          "values": [
            {
              "fieldLabel": "keyword",
              "placeholder": "e.g.AI",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Please enter the core keywords you want to analyze, then click Submit."
      },
      "typeVersion": 2.2
    },
    {
      "id": "b6164739-04d2-48f3-a22b-d4e4e3a57c9e",
      "name": "Paramètres d'Analyse",
      "type": "n8n-nodes-base.set",
      "position": [
        -3160,
        300
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "keyword-assignment",
              "name": "keyword",
              "type": "string",
              "value": "={{ $json.body.keyword || $json.query.keyword || 'AI' }}"
            },
            {
              "id": "date-assignment",
              "name": "search_date",
              "type": "string",
              "value": "={{ $now.toFormat('yyyy-MM-dd') }}"
            },
            {
              "id": "analysis-id",
              "name": "analysis_id",
              "type": "string",
              "value": "={{ $now.toFormat('yyyyMMddHHmmss') }}_{{ ($json.body.keyword || $json.query.keyword || 'default').replace(' ', '_') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "70bfecff-afa0-4423-810e-d570d86512fb",
      "name": "Reddit: Rechercher des Posts",
      "type": "n8n-nodes-base.reddit",
      "position": [
        -2940,
        160
      ],
      "parameters": {
        "keyword": "={{ $('Analysis Parameters').item.json.keyword }}",
        "location": "allReddit",
        "operation": "search",
        "additionalFields": {}
      },
      "credentials": {
        "redditOAuth2Api": {
          "id": "sMlNkr0t1SHte16l",
          "name": "Reddit account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "77808c17-0b0b-4c52-a0e7-095d79de44b5",
      "name": "Formatter les Données Reddit",
      "type": "n8n-nodes-base.set",
      "position": [
        -2760,
        160
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "reddit-weight",
              "name": "source_weight",
              "type": "number",
              "value": 0.7
            },
            {
              "id": "reddit-source",
              "name": "source_type",
              "type": "string",
              "value": "reddit"
            },
            {
              "id": "reddit-content",
              "name": "content",
              "type": "string",
              "value": "={{ $json.title + ' ' + ($json.selftext || '') }}"
            },
            {
              "id": "reddit-url",
              "name": "url",
              "type": "string",
              "value": "={{ $json.url }}"
            },
            {
              "id": "reddit-score",
              "name": "engagement_score",
              "type": "number",
              "value": "={{ $json.ups }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "fa853181-835f-4f89-98c6-63dd093c8ac7",
      "name": "YouTube: Rechercher des Vidéos",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2940,
        340
      ],
      "parameters": {
        "url": "https://www.googleapis.com/youtube/v3/search",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "part",
              "value": "snippet"
            },
            {
              "name": "q",
              "value": "={{ $('Analysis Parameters').item.json.keyword }}"
            },
            {
              "name": "type",
              "value": "video"
            },
            {
              "name": "order",
              "value": "relevance"
            },
            {
              "name": "maxResults",
              "value": "15"
            },
            {
              "name": "publishedAfter",
              "value": "={{ $now.minus({days: 7}).toISO() }}"
            }
          ]
        }
      },
      "credentials": {
        "httpQueryAuth": {
          "id": "Mt9JvwGreY6YHYTr",
          "name": "My YouTube API Key"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "82c25f04-f65f-4c7e-bbf7-661ba36a9a6b",
      "name": "Diviser",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -2760,
        340
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "items"
      },
      "typeVersion": 1
    },
    {
      "id": "224a28a8-42f0-441a-b5ba-744d327c62c0",
      "name": "X: Rechercher des Tweets",
      "type": "n8n-nodes-base.twitter",
      "position": [
        -2940,
        520
      ],
      "parameters": {
        "operation": "search",
        "searchText": "={{ $json.keyword }}",
        "additionalFields": {}
      },
      "credentials": {
        "twitterOAuth2Api": {
          "id": "EqYf1S4xveBy4e6t",
          "name": "X account"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "af9dbdce-c8dc-432d-8f06-a86f6110032f",
      "name": "Parser les Données Twitter",
      "type": "n8n-nodes-base.code",
      "position": [
        -2760,
        520
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "// 新代码:输出与其他平台完全一致的格式,并增加 engagement_score\ntry {\n  const tweetObject = $input.item.json;\n\n  // 从推文的公开指标(public_metrics)中计算一个综合的互动分数\n  // 同时增加安全检查,防止某些指标不存在时报错\n  const metrics = tweetObject.public_metrics || {};\n  const likeCount = metrics.like_count || 0;\n  const retweetCount = metrics.retweet_count || 0;\n  const replyCount = metrics.reply_count || 0;\n  const quoteCount = metrics.quote_count || 0;\n  const engagementScore = likeCount + retweetCount + replyCount + quoteCount;\n\n  // 构建与其他平台格式完全一致的result对象\n  const result = {\n    source_weight: 0.9,                        // 权重\n    source_type: 'twitter',                    // 来源类型\n    content: tweetObject.text,                 // 推文内容\n    url: `https://x.com/anyuser/status/${tweetObject.id}`, // 推文链接\n    engagement_score: engagementScore          // 互动分数\n  };\n\n  return { json: result };\n\n} catch (error) {\n  console.error('处理推文JSON时出错:', error);\n  return { json: { error: '处理推文JSON失败', raw_data: $input.item.json } };\n}"
      },
      "typeVersion": 2,
      "alwaysOutputData": false
    },
    {
      "id": "2a76c59f-7626-41a9-b72d-9197b1173a67",
      "name": "Formatter les Données YouTube",
      "type": "n8n-nodes-base.set",
      "position": [
        -2580,
        340
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "youtube-weight",
              "name": "source_weight",
              "type": "number",
              "value": 0.8
            },
            {
              "id": "youtube-source",
              "name": "source_type",
              "type": "string",
              "value": "youtube"
            },
            {
              "id": "youtube-content",
              "name": "content",
              "type": "string",
              "value": "={{ $json.snippet.title + ' ' + $json.snippet.description }}"
            },
            {
              "id": "youtube-url",
              "name": "url",
              "type": "string",
              "value": "=https://www.youtube.com/watch?v={{ $json.id.videoId }}"
            },
            {
              "id": "youtube-channel",
              "name": "channel",
              "type": "string",
              "value": "={{ $json.snippet.channelTitle }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "21d91bbc-8116-4c48-9f51-f81445e8684c",
      "name": "Fusionner: Toutes les Sources",
      "type": "n8n-nodes-base.merge",
      "position": [
        -2360,
        360
      ],
      "parameters": {
        "numberInputs": 3
      },
      "typeVersion": 3
    },
    {
      "id": "1d5341a4-1429-4d7a-afcb-8074e43ff748",
      "name": "Pré-filtrage IA",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -2040,
        360
      ],
      "parameters": {
        "text": "你是一位敏锐的选题策划,你的任务是为编辑发掘有潜力的内容,而不是过滤信息,同时需要【保留原始内容】。\n\n请根据给定的关键词,为每一条内容进行判断。如果内容满足【以下任一条件】,就必须标记为\"YES\",否则标记为\"NO\":\n1. 包含强烈的个人观点、情绪或独特的个人经历。\n2. 引发了争议或多人参与的讨论。\n3. 提出了一个新颖的问题或与众不同的见解。\n4. 虽然简短,但可能是一个新兴趋势或网络“梗”的苗头。\n\n你的目标是“宁滥勿缺”,只要内容有任何可能成为好选题的火花,都应标记为YES。纯粹的广告或垃圾信息才应标记为NO。\n\n你的回复必须遵循以下规则:\n1. 返回一个严格的JSON数组格式的字符串,不要包含任何markdown标记 (如```json)。\n2. 该数组的长度必须与输入数组完全一致。\n3. 数组中的每个对象都必须包含以下三个字段:\n   - `url`: 原始内容的URL。\n   - `decision`: 你的判断结果,值为 'YES' 或 'NO'。\n   - `content`: 必须原封不动地返回原始内容。\n\n示例输出格式:\n[\n  { \"url\": \"[http://example.com/article1](http://example.com/article1)\", \"decision\": \"YES\", \"content\": \"这是第一篇文章的内容...\" },\n  { \"url\": \"[http://example.com/article2](http://example.com/article2)\", \"decision\": \"NO\", \"content\": \"这是第二篇文章的内容...\" }\n]\n\n关键词: {{ $('设置分析参数').item.json.keyword }}\n\n待处理内容数组:\n{{ JSON.stringify($json.data) }}",
        "batching": {
          "batchSize": 20
        },
        "messages": {
          "messageValues": [
            {
              "message": "=关键词: {{ $('Analysis Parameters').item.json.keyword }}  待处理内容数组: {{ JSON.stringify($json) }}"
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "5198dc72-a270-453f-9e68-78204b6eb9e7",
      "name": "Pré-filtrer le Contenu",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -2040,
        540
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "S1FgINMN5qUQ5Z61",
          "name": "n8n workflow项目2"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "cdc21593-af88-4d1e-8c0c-79cd831673c7",
      "name": "Parser les Résultats du Filtre IA",
      "type": "n8n-nodes-base.code",
      "position": [
        -1740,
        360
      ],
      "parameters": {
        "jsCode": "// 最终代码:在\"Run Once for All Items\"模式下,处理所有批次并返回所有结果\n\n// 1. 创建一个空数组,用来存放所有批次解析后的最终结果。\nconst allParsedItems = [];\n\n// 2. 遍历所有输入的项目(您这里的10个批次)。\n//    $input.all() 可以获取全部的输入项。\nfor (const batchItem of $input.all()) {\n  try {\n    const contentString = batchItem.json.text;\n    if (!contentString) continue; // 如果某个批次的text为空,则跳过\n\n    const cleanedContent = contentString.replace(/```json/g, '').replace(/```/g, '').trim();\n\n    // 3. 解析当前批次中的JSON字符串。\n    const itemsInBatch = JSON.parse(cleanedContent);\n\n    // 4. 将解析出的项目(一个数组)添加到我们最终的总结果数组中。\n    if (Array.isArray(itemsInBatch)) {\n      allParsedItems.push(...itemsInBatch);\n    }\n\n  } catch (error) {\n    // 如果某个批次解析失败,在控制台打印错误并继续处理下一个批次。\n    console.error(`一个批次解析失败。错误: ${error.message}. 批次内容: ${batchItem.json.text}`);\n  }\n}\n\n// 5. 循环结束后,将包含了所有结果的总数组,格式化成n8n需要的格式并返回。\nreturn allParsedItems.map(item => ({ json: item }));"
      },
      "typeVersion": 2
    },
    {
      "id": "2e736b35-d703-4ef6-9af6-1a681563f2e3",
      "name": "SI: Le Contenu est-il Pertinent",
      "type": "n8n-nodes-base.if",
      "position": [
        -1560,
        360
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "filter-condition",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.decision }}",
              "rightValue": "YES"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "bb893ede-d07b-4c46-81f3-7985ab45dac4",
      "name": "Gérer les Erreurs de Filtre",
      "type": "n8n-nodes-base.code",
      "position": [
        -1340,
        520
      ],
      "parameters": {
        "jsCode": "try {\n  const errorInfo = {\n    error: '工作流执行出错',\n    timestamp: new Date().toISOString(),\n    node_error: $input.item(0).json.error || '未知错误',\n    analysis_id: $('Analysis Parameters').item.json.analysis_id || 'unknown'\n  };\n  \n  console.error('工作流错误:', errorInfo);\n  return { json: errorInfo };\n} catch (e) {\n  return { \n    json: { \n      error: '严重错误: 错误处理节点也失败了',\n      timestamp: new Date().toISOString()\n    } \n  };\n}"
      },
      "typeVersion": 2
    },
    {
      "id": "937a9584-02d5-42b4-af30-49346f90ee0f",
      "name": "Agréger: Éléments Pertinents",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -1340,
        240
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "191fe689-acd1-45bb-a8d4-92b88967c95a",
      "name": "Analyse Approfondie IA",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -1180,
        240
      ],
      "parameters": {
        "text": "=你是一个具备媒体素养和新闻敏感度的信息分析专家。你将收到一个 JSON 数组,每个元素包含一篇文章的内容与基础信息。请逐条进行深度结构化分析,并输出统一格式的 JSON 结果。\n\n分析目标:\n1. 提取文章的核心信息;\n2. 评估其用户情绪与传播潜力;\n3. 给出可衍生的新选题建议。\n\n请严格遵循以下输出格式,返回一个JSON字符串,不要包含任何markdown标记 (如```json):\n\n{\n  \"analyses\": [\n    {\n      \"original_url\": \"...\",\n      \"summary\": \"一句话核心摘要\",\n      \"topic\": \"文章主话题\",\n      \"sentiment\": \"positive | negative | mixed\",\n      \"key_arguments\": [\"要点A\", \"要点B\", \"要点C\"],\n      \"trending_potential\": 1-10之间的数字(基于该内容的热点潜力),\n      \"audience_interest\": 1-10之间的数字(基于普通用户的兴趣度),\n      \"news_value\": 1-10之间的数字(基于该内容的信息价值),\n      \"angle_suggestions\": [\"可衍生选题角度1\", \"可衍生选题角度2\"]\n    }\n  ]\n}\n\n请确保:\n- 分析维度客观中立。\n- 输出 JSON 严格符合格式要求。\n- 每条分析完整、无缺漏字段。\n- `original_url` 字段必须存在并且与输入内容一致。\n\n关键词: {{ $('Analysis Parameters').item.json.keyword }}\n\n待分析内容数组:\n{{ JSON.stringify($json.data) }}",
        "batching": {},
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "9ca30e5e-aa64-4da4-9586-9720b23e2f65",
      "name": "Analyse Approfondie",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -1180,
        400
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "LkH0TapWjEfUVaSr",
          "name": "n8n workflow api"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "606529dc-6f29-437d-be61-d74b987a37ad",
      "name": "Structurer le Résultat de l'Analyse",
      "type": "n8n-nodes-base.code",
      "position": [
        -840,
        240
      ],
      "parameters": {
        "jsCode": "// 新代码:增加了清理步骤\ntry {\n  // 1. 从 'text' 字段获取AI返回的原始字符串\n  let contentString = $input.item.json.text;\n  \n  // 2. **新增的关键步骤:清理字符串,去掉AI可能添加的markdown标记**\n  contentString = contentString.replace(/```json/g, '').replace(/```/g, '').trim();\n  \n  // 3. 解析这个干净的字符串\n  const aiResults = JSON.parse(contentString);\n  \n  // 4. 从上游的\"聚合1\"节点获取原始数据项\n  const originalItems = $('Aggregate: Relevant Items').all();\n\n  // 5. 检查AI输出是否是我们期望的格式\n  if (!aiResults.analyses || !Array.isArray(aiResults.analyses)) {\n    throw new Error(\"AI output is not in the expected format: { \\\"analyses\\\": [...] }\");\n  }\n\n  // 6. 将AI分析结果与原始数据进行匹配和合并\n  const enrichedAnalyses = aiResults.analyses.map(analysis => {\n    const originalItem = originalItems.find(item => item.json.url === analysis.original_url);\n    \n    return {\n      json: {\n        ...analysis,\n        source_info: originalItem ? {\n          type: originalItem.json.source_type,\n          weight: originalItem.json.source_weight,\n          engagement_score: originalItem.json.engagement_score || 0\n        } : {\n          type: 'unknown',\n          url: analysis.original_url\n        },\n        analysis_timestamp: new Date().toISOString()\n      }\n    };\n  });\n  \n  // 7. 返回包含所有合并后结果的数组\n  return enrichedAnalyses;\n\n} catch (error) {\n  console.error('成型分析结果节点错误:', error);\n  return [{ \n    json: { \n      error: `成型分析结果失败: ${error.message}`,\n      raw_content: $input.item.json.text || 'No raw content available'\n    } \n  }];\n}"
      },
      "typeVersion": 2
    },
    {
      "id": "1223e62f-1e4a-48cc-8f65-6daa0baf5913",
      "name": "Agréger: Résultats de l'Analyse Approfondie",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -600,
        240
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "2b28a672-9be6-4400-9fc1-7ce546c64637",
      "name": "IA: Synthétiser le Rapport Final",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -440,
        240
      ],
      "parameters": {
        "text": "={{ `你是一位顶级的图书编辑和内容策略师。你现在拥有 ${$json.length} 篇关于“${$('Analysis Parameters').item.json.keyword}”的高质量文章的结构化分析数据(JSON 格式)。\n\n分析数据如下:\n${JSON.stringify($json)}\n\n请基于这些数据,完成以下任务,并直接输出一份可以直接用于发送邮件的、格式优美的**HTML代码**。请使用 <h1>, <h2>, <h3>作为各级标题,使用<ul>和<li>创建列表,使用<strong>或<b> 对关键点进行加粗。请确保你的回复只包含纯粹的HTML代码,不要有任何额外的解释或Markdown标记。\n1. **聚类分析**:识别出 3-5 个最热门或最核心的讨论焦点。\n2. **趋势预测**:基于用户情绪和讨论热度,预测哪个焦点在未来最有潜力成为爆款。\n3. **选题生成**:为每个核心焦点,生成 2 个具有爆款潜力的选题。每个选题需提供:\n   - **标题 (Catchy Title)**\n   - **核心大纲 (Outline)**\n   - **关键论点 (Key Arguments)**` }}",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2
    },
    {
      "id": "cae79054-712a-40eb-8792-909fc287c246",
      "name": "Synthèse",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -440,
        420
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.5-flash"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "S1FgINMN5qUQ5Z61",
          "name": "n8n workflow项目2"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5d00f35a-4043-4d3f-a46f-058c0038ea48",
      "name": "Formatter les Charges Utiles du Rapport",
      "type": "n8n-nodes-base.set",
      "position": [
        -120,
        240
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "27744290-a4c0-4afb-b948-bf19f3998b38",
              "name": "report_title",
              "type": "string",
              "value": "={{ '【' + $('Analysis Parameters').item.json.keyword + '】热点分析报告 (' + $('Analysis Parameters').item.json.search_date + ')' }}"
            },
            {
              "id": "9380ff58-c183-4f97-a588-35a7d06a8085",
              "name": "report_content",
              "type": "string",
              "value": "={{ $json.output }}"
            },
            {
              "id": "915a7cac-30dd-44fc-8b1b-4c5fbc29cbff",
              "name": "analysis_summary",
              "type": "string",
              "value": "={{ '本次分析共合并了 ' + $('Merge: All Sources').all().length + ' 条原始数据,筛选后深度分析了 ' + $('Aggregate: Relevant Items').item.json.data.length + ' 条高价值内容。' }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "8ec130d7-fcc8-4160-8c45-5bd976a4d978",
      "name": "Assembler le rapport final",
      "type": "n8n-nodes-base.set",
      "position": [
        120,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "76202dc1-18f1-47eb-b533-14395a4c01ab",
              "name": "final_report_text",
              "type": "string",
              "value": "={{ $json.report_title + '\\n\\n**分析概要**:\\n' + $json.analysis_summary + '\\n\\n**详细报告**:\\n' + $json.report_content }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "4f6d8ef7-c662-49c4-8e8a-2550366a0cd5",
      "name": "Envoyer le Rapport HTML",
      "type": "n8n-nodes-base.gmail",
      "position": [
        320,
        0
      ],
      "webhookId": "22ffd326-3962-4fa9-adf9-5580be6701a4",
      "parameters": {
        "message": "={{ $json.final_report_text }}",
        "options": {},
        "subject": "={{ $('Format Report Payloads').item.json.report_title }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "uY3e74Pt4SFoyVaW",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "7a964d92-4caa-43b0-b14a-07ee5c902201",
      "name": "Envoyer la Carte Feishu",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        140,
        240
      ],
      "parameters": {
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "msg_type",
              "value": "interactive"
            },
            {
              "name": "card",
              "value": "={{\n  {\n    \"config\": {\n      \"wide_screen_mode\": true\n    },\n    \"header\": {\n      \"template\": \"blue\",\n      \"title\": {\n        \"tag\": \"plain_text\",\n        \"content\": $json.report_title\n      }\n    },\n    \"elements\": [\n      {\n        \"tag\": \"div\",\n        \"text\": {\n          \"tag\": \"lark_md\",\n          \"content\": $json.analysis_summary\n        }\n      },\n      {\n        \"tag\": \"hr\"\n      },\n      {\n        \"tag\": \"note\",\n        \"elements\": [\n          {\n            \"tag\": \"plain_text\",\n            \"content\": \"✅ 报告已生成,完整的详细报告已发送至您的Gmail邮箱。\"\n          }\n        ]\n      }\n    ]\n  }\n}}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "1f3f314f-7f2d-42c8-96e0-1c7cd419e131",
      "name": "Archiver les Données",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        140,
        480
      ],
      "parameters": {
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "uBYTAwRuGBn9fTxi",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "b74fa61d-bbc3-4487-ac13-07606b8f92a3",
  "connections": {
    "82c25f04-f65f-4c7e-bbf7-661ba36a9a6b": {
      "main": [
        [
          {
            "node": "2a76c59f-7626-41a9-b72d-9197b1173a67",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cae79054-712a-40eb-8792-909fc287c246": {
      "ai_languageModel": [
        [
          {
            "node": "2b28a672-9be6-4400-9fc1-7ce546c64637",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "12041c3c-5e45-4ae3-aeec-7769e9599f36": {
      "main": [
        [
          {
            "node": "b6164739-04d2-48f3-a22b-d4e4e3a57c9e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9ca30e5e-aa64-4da4-9586-9720b23e2f65": {
      "ai_languageModel": [
        [
          {
            "node": "191fe689-acd1-45bb-a8d4-92b88967c95a",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "632ab262-c571-46b7-a2af-37b7e430522b": {
      "main": [
        [],
        [
          {
            "node": "1d5341a4-1429-4d7a-afcb-8074e43ff748",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "191fe689-acd1-45bb-a8d4-92b88967c95a": {
      "main": [
        [
          {
            "node": "606529dc-6f29-437d-be61-d74b987a37ad",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1d5341a4-1429-4d7a-afcb-8074e43ff748": {
      "main": [
        [
          {
            "node": "cdc21593-af88-4d1e-8c0c-79cd831673c7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "224a28a8-42f0-441a-b5ba-744d327c62c0": {
      "main": [
        [
          {
            "node": "af9dbdce-c8dc-432d-8f06-a86f6110032f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "77808c17-0b0b-4c52-a0e7-095d79de44b5": {
      "main": [
        [
          {
            "node": "21d91bbc-8116-4c48-9f51-f81445e8684c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "21d91bbc-8116-4c48-9f51-f81445e8684c": {
      "main": [
        [
          {
            "node": "632ab262-c571-46b7-a2af-37b7e430522b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "af9dbdce-c8dc-432d-8f06-a86f6110032f": {
      "main": [
        [
          {
            "node": "21d91bbc-8116-4c48-9f51-f81445e8684c",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "5198dc72-a270-453f-9e68-78204b6eb9e7": {
      "ai_languageModel": [
        [
          {
            "node": "1d5341a4-1429-4d7a-afcb-8074e43ff748",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "b6164739-04d2-48f3-a22b-d4e4e3a57c9e": {
      "main": [
        [
          {
            "node": "fa853181-835f-4f89-98c6-63dd093c8ac7",
            "type": "main",
            "index": 0
          },
          {
            "node": "70bfecff-afa0-4423-810e-d570d86512fb",
            "type": "main",
            "index": 0
          },
          {
            "node": "224a28a8-42f0-441a-b5ba-744d327c62c0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2a76c59f-7626-41a9-b72d-9197b1173a67": {
      "main": [
        [
          {
            "node": "21d91bbc-8116-4c48-9f51-f81445e8684c",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "70bfecff-afa0-4423-810e-d570d86512fb": {
      "main": [
        [
          {
            "node": "77808c17-0b0b-4c52-a0e7-095d79de44b5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "8ec130d7-fcc8-4160-8c45-5bd976a4d978": {
      "main": [
        [
          {
            "node": "4f6d8ef7-c662-49c4-8e8a-2550366a0cd5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5d00f35a-4043-4d3f-a46f-058c0038ea48": {
      "main": [
        [
          {
            "node": "1f3f314f-7f2d-42c8-96e0-1c7cd419e131",
            "type": "main",
            "index": 0
          },
          {
            "node": "8ec130d7-fcc8-4160-8c45-5bd976a4d978",
            "type": "main",
            "index": 0
          },
          {
            "node": "7a964d92-4caa-43b0-b14a-07ee5c902201",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fa853181-835f-4f89-98c6-63dd093c8ac7": {
      "main": [
        [
          {
            "node": "82c25f04-f65f-4c7e-bbf7-661ba36a9a6b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2e736b35-d703-4ef6-9af6-1a681563f2e3": {
      "main": [
        [
          {
            "node": "937a9584-02d5-42b4-af30-49346f90ee0f",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "bb893ede-d07b-4c46-81f3-7985ab45dac4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cdc21593-af88-4d1e-8c0c-79cd831673c7": {
      "main": [
        [
          {
            "node": "2e736b35-d703-4ef6-9af6-1a681563f2e3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "937a9584-02d5-42b4-af30-49346f90ee0f": {
      "main": [
        [
          {
            "node": "191fe689-acd1-45bb-a8d4-92b88967c95a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "606529dc-6f29-437d-be61-d74b987a37ad": {
      "main": [
        [
          {
            "node": "1223e62f-1e4a-48cc-8f65-6daa0baf5913",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2b28a672-9be6-4400-9fc1-7ce546c64637": {
      "main": [
        [
          {
            "node": "5d00f35a-4043-4d3f-a46f-058c0038ea48",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1223e62f-1e4a-48cc-8f65-6daa0baf5913": {
      "main": [
        [
          {
            "node": "2b28a672-9be6-4400-9fc1-7ce546c64637",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Foire aux questions

Comment utiliser ce workflow ?

Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.

Dans quelles scénarios ce workflow est-il adapté ?

Avancé - Étude de marché, Résumé IA

Est-ce payant ?

Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.

Workflows recommandés

Explorer les nœuds n8n dans la bibliothèque de références visuelles
Explorer les nœuds n8n dans la base de références visuelles
If
Ftp
Set
+
If
Ftp
Set
113 NœudsI versus AI
Autres
01 Analyser la performance des publicités Facebook avec un acheteur d'espace médias IA et envoyer les informations dans Google Sheets
Analyser les publicités Facebook et envoyer les insights dans Google Sheets avec Gemini AI
If
Set
Code
+
If
Set
Code
34 NœudsJJ Tham
Étude de marché
Analyse intelligente quotidienne des groupes WhatsApp : Analyse GPT-4.1 et transcription des messages vocaux
Analyse intelligente des groupes WhatsApp quotidiens : analyse GPT-4.1 et transcription des messages vocaux
If
Set
Code
+
If
Set
Code
52 NœudsDaniel Lianes
Divers
Version professionnelle de l'automatisation de blog WordPress (recherche approfondie) v2.1 sur le marché
Automatisation de la création de blog optimisé pour le SEO avec GPT-4o, Perplexity AI et support multilingue
If
Set
Xml
+
If
Set
Xml
125 NœudsDaniel Ng
Création de contenu
Prospection et workflow d'e-mails
Utiliser Google Maps, SendGrid et l'IA pour automatiser le développement de prospects B2B et le marketing par e-mail
If
Set
Code
+
If
Set
Code
141 NœudsEzema Kingsley Chibuzo
Génération de leads
Automatisation de la recherche d'emploi et de la personnalisation des CV avec Mistral AI, LinkedIn et Google Sheets
Automatisation de la recherche d'offres d'emploi et de la personnalisation de CV avec Mistral AI, LinkedIn et Google Sheets
Set
Code
Html
+
Set
Code
Html
46 NœudsJordan Hoyle
Productivité personnelle
Informations sur le workflow
Niveau de difficulté
Avancé
Nombre de nœuds34
Catégorie2
Types de nœuds17
Description de la difficulté

Adapté aux utilisateurs avancés, avec des workflows complexes contenant 16+ nœuds

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34