Claude销售增长营收AI 评分 · 待评分AI 辅助编辑·未发现明显提示词注入风险n8n.io

用 n8n 自动生成 AI 市场研究报告:Perplexity + Claude + Google Trends + Autype

输入产品信息 → SerpAPI 获取趋势与竞品数据 → Perplexity AI 深度研究 → Claude 撰写报告 → Autype 渲染 PDF → 保存至 Google Drive

有一点经验步骤流程提示词贴士
给谁
产品经理、初创创始人、战略分析师、咨询顾问,需要快速生成投资人演示、董事会或战略定位用的市场研究报告
你会得到
填写表单后自动获取 Google Trends 与竞品搜索数据,经 AI 研究与撰写,输出带专业排版的 PDF 报告并保存至 Google Drive
你需要
n8n · serpapi · perplexity · autype · google-drive

硬约束

需要自托管 n8n 实例(社区节点不可用 n8n Cloud)。需准备:SerpAPI 账号(免费档 100 次/月,来源描述为 250 次)、OpenRouter API key(可同时用于 Perplexity 与 Claude)、Autype 账号与 API key、Google Drive OAuth2 凭证。导入模板后需为每个节点分配凭证,并设置 Google Drive 保存节点的 YOUR_FOLDER_ID。

他们做了什么

作者 kesim0 在 n8n.io 发布了官方模板 workflow 13908。该模板通过 n8n Form Trigger 收集产品信息,并行调用 SerpAPI 获取 Google Trends 12 个月数据与竞品搜索结果,同时下载 Autype 扩展 Markdown 语法参考。经 Code 节点合并上下文后,先由连接 OpenRouter Perplexity Sonar Pro 的 AI Research Agent 执行深度市场研究,再由连接 OpenRouter Anthropic Claude 的 AI Report Writer 生成结构化报告(含标题页模板与目录),最终经 Autype 渲染为专业排版 PDF 并保存至 Google Drive。模板提供了完整的节点参数、提示词与自定义指南。

效果如何

作者描述该工作流可在 2 分钟内生成包含市场趋势、自动发现竞品对比、SWOT 分析与战略建议的精美 PDF(author_report)。来源未提供第三方独立验证或量化成功率数据。

值得知道

必须自托管 n8n(社区节点 n8n-nodes-autype 与 n8n-nodes-serpapi 不支持 n8n Cloud)。SerpAPI 免费档额度在 description.md 中标注为 250 次/月,但 Requirements 中写 100 次/月,实际以账户为准。OpenRouter 的两份凭证可使用同一 API key。Google Drive 节点为可选输出,可替换为 Email/S3/Slack 等。报告语言下拉框默认仅 English/German/French/Spanish,添加更多语言需手动编辑表单节点。PDF 默认页眉显示 'SearchIT Inc.' 与固定 logo,需修改 Render Report PDF 节点的 defaults JSON 以适配自有品牌。本站未实测该工作流,reproduction=not_tested。

n8n 工作流模板

结构已检查 · 未实际运行

下载后在 n8n 选择“Import from File”,或复制 JSON 后粘贴到编辑器。先配置自己的账号,再用测试数据运行;模板默认未启用。

配置与测试清单

需要绑定的凭证

  • Google Trends 节点:绑定serpApi 凭证。
  • Search Competitors 节点:绑定serpApi 凭证。
  • OpenRouter Perplexity 节点:绑定openRouterApi 凭证。
  • Render Report PDF 节点:绑定autypeApi 凭证。
  • Save Report to Drive 节点:绑定Google Drive OAuth2 凭证。
  • OpenRouter Anthropic Claude 节点:绑定openRouterApi 凭证。

需要替换的配置

  • 源模板来自 n8n 公开库 #13908(约 20 个节点)。导入后先保持未启用,核对触发器、表达式与外部 API 端点。
  • Sticky Note 中的说明仅供参考;按自己的账号、表结构或频道 ID 替换占位配置。

测试输入与预期结果

  • 在测试环境手动执行一次主路径,确认每个需凭证的节点已连接且无鉴权错误。
  • 用一条合成/脱敏样例数据跑通,核对输出字段与下游写入目标,再考虑生产启用。

模板处理说明

  • 已移除原作者凭证绑定、webhookId 与执行数据,工作流设为未启用;节点、连线与原文提示词保持原样。未在 n8n 中实际运行。
  • 未改业务逻辑;运行前请自行核对密钥、配额与隐私合规。

模板获取日期: 2026-10-24

步骤

  1. 前置准备:配置表单与数据获取

    在 n8n 中导入工作流模板。配置 Market Research Form 节点:表单自动收集 productName(产品名称)、industry(行业)、productDescription(产品描述)、language(报告语言,下拉选项:English/German/French/Spanish)。同时准备三个并行数据源的凭证:Google Trends 节点与 Search Competitors 节点共用 SerpAPI credential;Download Markdown Syntax 节点为 HTTP Request,无需额外凭证,自动获取 https://autype.com/llm-resources/markdown-syntax.md。

  2. 合并研究上下文

    Prepare Research Context(Code 节点)将表单数据、Google Trends 近 6 个月兴趣数据、竞品搜索结果(取前 10 条)、Autype Markdown 语法参考合并为单一 JSON 对象,包含 productName、industry、productDescription、language、trendsSummary、competitorSearchResults、markdownSyntax。

    运行提示词 · 来源原文。Prepare Research Context 节点的 JS Code 字段

    const items = $input.all();
    const form = $('Market Research Form').first().json;
    
    // Extract Google Trends data
    let trendsSummary = 'No Google Trends data available.';
    for (const item of items) {
      const d = item.json;
      if (d.interest_over_time?.timeline_data) {
        const timeline = d.interest_over_time.timeline_data;
        const latest = timeline.slice(-6);
        trendsSummary = 'Google Trends interest (last 6 months):\n';
        for (const point of latest) {
          const value = point.values?.[0]?.extracted_value || 0;
          trendsSummary += `- ${point.date}: ${value}/100\n`;
        }
        break;
      }
    }
    
    // Extract competitor search results
    let competitorSearchResults = '';
    for (const item of items) {
      const d = item.json;
      if (d.organic_results) {
        competitorSearchResults = d.organic_results
          .slice(0, 10)
          .map((r, i) => `${i + 1}. ${r.title}\n   ${r.snippet || ''}\n   ${r.link}`)
          .join('\n');
        break;
      }
    }
    
    // Extract markdown syntax
    let markdownSyntax = '';
    for (const item of items) {
      const d = item.json;
      if (d.data && typeof d.data === 'string' && d.data.includes('Markdown')) {
        markdownSyntax = d.data;
        break;
      }
    }
    
    return [{
      json: {
        productName: form.productName,
        industry: form.industry,
        productDescription: form.productDescription,
        language: form.language || 'English',
        trendsSummary,
        competitorSearchResults,
        markdownSyntax
      }
    }];
  3. AI 深度市场研究

    AI Research Agent(AI Agent 节点)调用 OpenRouter Perplexity(模型 perplexity/sonar-pro)。该节点接收合并后的上下文,执行深度市场与竞品分析。需将 OpenRouter Perplexity 子节点连接至 AI Research Agent 的 ai_languageModel 接口。

    运行提示词 · 来源原文。AI Research Agent 节点的 System Message 字段

    You are a senior market research analyst with access to real-time web data. Your job is to conduct thorough competitive and market analysis. Be factual, specific, and data-driven. Always identify real companies and real data points. Structure your response clearly with sections for market overview, competitor profiles, trends, and positioning.

    运行提示词 · 来源原文。AI Research Agent 节点的 User Prompt 字段

    =Conduct deep market research for the following product:
    
    **Product:** {{ $json.productName }}
    **Industry:** {{ $json.industry }}
    **Description:** {{ $json.productDescription }}
    
    Here are Google Search results about competitors in this market:
    {{ $json.competitorSearchResults }}
    
    Here is Google Trends data for this industry:
    {{ $json.trendsSummary }}
    
    Based on this data and your real-time web knowledge, provide:
    1. A comprehensive market overview (market size, growth rate, key drivers, challenges)
    2. Identify the top 5-8 competitors and for each: name, website, key features, pricing model, target audience, strengths, weaknesses
    3. Current market trends and predictions for the next 2 years
    4. Where the user's product ({{ $json.productName }}) fits in this landscape
    
    Be specific and factual. Include numbers, percentages, and dates where possible.
    Write in: {{ $json.language }}
  4. 准备报告输入

    Prepare Report Input(Code 节点)将 AI Research Agent 的输出(researchOutput)与表单数据、语言、趋势摘要、Markdown 语法参考重新组合,传递给 AI Report Writer。

    运行提示词 · 来源原文。Prepare Report Input 节点的 JS Code 字段

    const researchOutput = $json.output;
    const form = $('Market Research Form').first().json;
    const context = $('Prepare Research Context').first().json;
    
    return [{
      json: {
        researchData: researchOutput,
        productName: form.productName,
        industry: form.industry,
        productDescription: form.productDescription,
        language: context.language,
        trendsSummary: context.trendsSummary,
        markdownSyntax: context.markdownSyntax
      }
    }];
  5. AI 撰写报告

    AI Report Writer(AI Agent 节点)调用 OpenRouter Anthropic Claude(模型 anthropic/claude-sonnet-4.6)。该节点根据研究数据、趋势数据、Markdown 语法参考及标题页模板,生成 Autype Extended Markdown 格式的结构化市场研究报告。需将 OpenRouter Anthropic Claude 子节点连接至 AI Report Writer 的 ai_languageModel 接口。

    运行提示词 · 来源原文。AI Report Writer 节点的 System Message 字段

    =You are a senior market research analyst writing professional reports.
    
    You MUST write the report using Autype Extended Markdown syntax. Here is the full syntax reference:
    
    {{ $json.markdownSyntax }}
    
    ---
    
    IMPORTANT RENDERING CONSTRAINTS:
    - NEVER use   -- they cannot be processed by the renderer.
    - Page breaks before h1 and h2 headings are inserted AUTOMATICALLY by the rendering engine via the defaults. Do NOT insert manual page breaks (---) before headings.
    - For blockquotes (> syntax), you may ONLY set `color` and `borderColor` as inline attributes. Example: `> {color=#1e40af borderColor=#3b82f6} Key takeaway text here`. Do not set background, padding, indent, or other blockquote attributes.
    - Use standard Markdown horizontal rules (---) ONLY for visual separation where no heading follows, since headings already force page breaks.
    
    Report structure (use these exact sections with ## headings):
    1. Executive Summary
    2. Market Overview (size, growth rate, key drivers)
    3. Trend Analysis (include Google Trends data interpretation)
    4. Competitive Landscape (table comparing competitors)
    5. SWOT Analysis (use a table for the user's product)
    6. Key Findings & Recommendations
    7. Sources
    
    Formatting rules:
    - Use ## for main sections, ### for subsections
    - Use tables (with :::table wrapper for styling) for competitor comparisons and SWOT analysis
    - Use **bold** for key metrics and findings
    - Use > blockquotes for key takeaways (only with color and borderColor attributes)
    - Use numbered lists for recommendations
    - Keep the report between 1500 and 3000 words
    - Be factual and specific -- include numbers, percentages, and dates
    - Do NOT wrap the output in markdown code fences
    - Output ONLY the markdown content, nothing else

    运行提示词 · 来源原文。AI Report Writer 节点的 User Prompt 字段

    =Write a professional market research report for **{{ $json.productName }}** in the **{{ $json.industry }}** market.
    
    Product description: {{ $json.productDescription }}
    
    Use the following research data to write the report:
    
    --- RESEARCH DATA (from Perplexity AI) ---
    {{ $json.researchData }}
    
    --- GOOGLE TRENDS DATA ---
    {{ $json.trendsSummary }}
    
    Write the report in: {{ $json.language }}
    
    --- USE THIS TEMPLATE AS TITLE PAGE AND TOC ---
    
    ```
    ---page{align=center}---
    
    ![](https://img.icons8.com/?size=100&id=4910&format=png&color=000000){align=center}
    
    <h1 align="center">REPORT NAME</h1>
    
    <h1 align="center">PRODUCT – PRODUCT DESCRIPTION (2/3Words)</h1>
    
    ---spacer{height=4}---
    
    | **Created:** {{date}} 
    | **Segment:** SEGMENT 
    | **Language:** LANG
    
    ---/page---
    
    ::toc{title="Inhaltsverzeichnis" maxLevel=3}
    
    ---
    
    ...
    ```
  6. 渲染 PDF 与输出

    Prepare Render Payload(Code 节点)清理 AI 输出(去除代码围栏),生成文件名格式为 market-research-{slug}-{YYYY-MM-DD}.pdf。Render Report PDF(Autype 节点)使用 Open Sans 字体、专业标题层级(h1 28pt/h2 22pt/h3 18pt)、自动分页、图表配色、页眉页脚等默认样式将 Markdown 渲染为 PDF。最后 Save Report to Drive 节点上传至 Google Drive;需将 folderId 从 YOUR_FOLDER_ID 改为实际目标文件夹 ID。

    运行提示词 · 来源原文。Prepare Render Payload 节点的 JS Code 字段

    const markdown = $json.output;
    const form = $('Market Research Form').first().json;
    const today = new Date().toISOString().split('T')[0];
    
    // Clean up: strip code fences if the LLM wrapped the output
    let content = markdown;
    if (content.startsWith('```')) {
      content = content.replace(/^```(?:markdown)?\n?/, '').replace(/\n?```$/, '');
    }
    
    const slug = form.productName.toLowerCase().replace(/[^a-z0-9]+/g, '-');
    
    return [{
      json: {
        content,
        title: `Market Research Report: ${form.productName} - ${form.industry}`,
        filename: `market-research-${slug}-${today}.pdf`
      }
    }];

    运行提示词 · 来源原文。Render Report PDF 节点的 defaults JSON 字段

    {
      "fontFamily": "Open Sans",
      "fontSize": 11,
      "color": "#1a1a1a",
      "lineHeight": 1.6,
      "spacing": {
        "before": { "h1": 24, "h2": 20, "h3": 16, "h4": 14, "h5": 12, "h6": 10, "text": 0, "table": 12, "list": 10, "image": 12, "code": 12, "chart": 12, "math": 10, "blockquote": 20 },
        "after": { "h1": 16, "h2": 14, "h3": 12, "h4": 10, "h5": 8, "h6": 6, "text": 10, "table": 16, "list": 10, "image": 16, "code": 16, "chart": 16, "math": 15, "blockquote": 20 }
      },
      "chart": {
        "colors": ["#3b82f6", "#ef4444", "#10b981", "#f59e0b", "#8b5cf6"],
        "borderColors": ["#2563eb", "#dc2626", "#059669", "#d97706", "#7c3aed"]
      },
      "styles": {
        "h1": { "color": "#000000", "fontSize": 28, "fontWeight": "bold", "pageBreakBefore": true },
        "h2": { "color": "#333333", "fontSize": 22, "fontWeight": "bold", "pageBreakBefore": true },
        "h3": { "color": "#444444", "fontSize": 18, "fontWeight": "bold" },
        "h4": { "fontSize": 16, "fontWeight": "bold" },
        "h5": { "fontSize": 14, "fontWeight": "normal" },
        "h6": { "fontSize": 12, "fontWeight": "normal" },
        "text": { "fontSize": 11 },
        "blockquote": { "indentLeft": 0, "indentRight": 0 }
      },
      "header": {
        "left": { "type": "text", "content": [{ "text": "SearchIT Inc.", "color": "#6700FF", "fontSize": 10, "fontWeight": "bold" }] },
        "right": { "src": "https://img.icons8.com/?size=100&id=HLcedHsnUGdr&format=png&color=6700FF", "type": "image", "width": 50 },
        "center": "",
        "excludeFirstPage": true
      },
      "footer": {
        "left": "",
        "right": "",
        "center": "Page {{pageNumber}}",
        "excludeFirstPage": true
      }
    }

可复制提示词

搭建指导 · 本站建议版本。交给搭建助手,协助用户按来源模板完成配置与首次验证

这一段是提示词,页面不会在这里插入广告。

你是一个 n8n 工作流搭建助手。用户想复现「自动生成 AI 市场研究报告」模板。请按以下顺序协助:
1. 确认用户拥有自托管 n8n 实例(社区节点必需);
2. 检查已安装 n8n-nodes-autype 与 n8n-nodes-serpapi;
3. 引导创建四个凭证:SerpAPI、OpenRouter(两份,可同 key)、Autype API key、Google Drive OAuth2;
4. 导入 workflow JSON 后,逐节点检查凭证分配;
5. 提醒将 Save Report to Drive 节点的 YOUR_FOLDER_ID 替换为实际文件夹 ID;
6. 建议首次运行前用测试数据验证各节点输出。

此 prompt 为搭建指导,不是节点运行指令。实际节点提示词见各步骤 prompts 字段。

来源

Generate AI market research reports with Perplexity, Claude, Google Trends, and Autype · kesim0 · n8n.io · 2026-03-06

留言与反馈

试过这个方法吗?分享效果、遇到的问题或改进建议。留言审核后公开,请勿填写敏感信息。

正在加载…

    相关用例