Auto-Generate AI Market Research Reports with n8n: Perplexity + Claude + Google Trends + Autype
Enter product info → SerpAPI fetches trends & competitor data → Perplexity AI deep research → Claude writes report → Autype renders PDF → save to Google Drive
- Who
- Product managers, startup founders, strategists, and consultants who need quick market research reports for investor decks, board meetings, or strategic positioning
- You get
- Fill a form to automatically fetch Google Trends and competitor search data, then produce a professionally styled PDF report via AI research and writing, saved to Google Drive
- You need
- n8n · serpapi · perplexity · autype · google-drive
Constraints
Requires a self-hosted n8n instance (community nodes unavailable on n8n Cloud). Prepare: SerpAPI account (free tier 100 searches/month; source description states 250), OpenRouter API key (can use same key for both models), Autype account with API key, Google Drive OAuth2 credential. After importing the template, assign credentials to each node and set YOUR_FOLDER_ID in the Save Report to Drive node.
What they did
Author kesim0 published official template workflow 13908 on n8n.io. The template collects product info via n8n Form Trigger, calls SerpAPI in parallel for Google Trends 12-month data and competitor search results, and downloads the Autype Extended Markdown syntax reference. A Code node merges this into context, then an AI Research Agent connected to OpenRouter Perplexity Sonar Pro performs deep market research, followed by an AI Report Writer connected to OpenRouter Anthropic Claude that generates a structured report with title page template and table of contents. Finally Autype renders it as a professionally styled PDF and saves to Google Drive. The template includes complete node parameters, prompts, and customization guides.
How it went
The author describes generating a polished PDF with market trends, auto-discovered competitor comparisons, SWOT analysis, and strategic recommendations in under two minutes (author_report). No third-party independent validation or quantitative success rate data is provided by the source.
Worth knowing
Self-hosted n8n is mandatory (community nodes n8n-nodes-autype and n8n-nodes-serpapi are unavailable on n8n Cloud). SerpAPI free tier is listed as 250 searches/month in the description but 100 searches/month in Requirements; actual limits depend on your account. The two OpenRouter credentials may use the same API key. The Google Drive node is optional and replaceable with Email/S3/Slack. The language dropdown defaults to English/German/French/Spanish only; adding languages requires editing the form node. The PDF header shows 'SearchIT Inc.' with a fixed logo; modify the defaults JSON in the Render Report PDF node for your own branding. This site has not tested this workflow; reproduction=not_tested.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- Google Trends node: connect serpApi credentials.
- Search Competitors node: connect serpApi credentials.
- OpenRouter Perplexity node: connect openRouterApi credentials.
- Render Report PDF node: connect autypeApi credentials.
- Save Report to Drive node: connect Google Drive OAuth2 credentials.
- OpenRouter Anthropic Claude node: connect openRouterApi credentials.
Configuration to replace
- Source template is n8n public workflow #13908 (~20 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use.
Template retrieved: 2026-10-24
Steps
Setup: Configure form and data sources
Import the workflow template into n8n. Configure the Market Research Form node: it collects productName, industry, productDescription, and language (dropdown: English/German/French/Spanish). Prepare credentials for three parallel data sources: Google Trends and Search Competitors share a SerpAPI credential; Download Markdown Syntax is an HTTP Request node that fetches https://autype.com/llm-resources/markdown-syntax.md with no extra credential needed.
Merge research context
The Prepare Research Context Code node merges form data, Google Trends interest data (last 6 months), competitor search results (top 10), and Autype Markdown syntax reference into a single JSON object with productName, industry, productDescription, language, trendsSummary, competitorSearchResults, and markdownSyntax.
Execution prompt · Source text。Prepare Research Context node JS Code field
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 } }];AI deep market research
The AI Research Agent node calls OpenRouter Perplexity (model perplexity/sonar-pro). It receives the merged context and performs deep market and competitor analysis. Connect the OpenRouter Perplexity sub-node to the AI Research Agent's ai_languageModel socket.
Execution prompt · Source text。AI Research Agent node System Message field
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.
Execution prompt · Source text。AI Research Agent node User Prompt field
=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 }}Prepare report input
The Prepare Report Input Code node recomposes the AI Research Agent output (researchOutput) with form data, language, trends summary, and Markdown syntax reference, then passes it to the AI Report Writer.
Execution prompt · Source text。Prepare Report Input node JS Code field
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 } }];AI report writing
The AI Report Writer node calls OpenRouter Anthropic Claude (model anthropic/claude-sonnet-4.6). It generates a structured market research report in Autype Extended Markdown using the research data, trend data, Markdown syntax reference, and title page template. Connect the OpenRouter Anthropic Claude sub-node to the AI Report Writer's ai_languageModel socket.
Execution prompt · Source text。AI Report Writer node System Message field
=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 elseExecution prompt · Source text。AI Report Writer node User Prompt field
=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}--- {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} --- ... ```Render PDF and output
The Prepare Render Payload Code node cleans the AI output (strips code fences) and generates a filename as market-research-{slug}-{YYYY-MM-DD}.pdf. The Render Report PDF Autype node renders Markdown to PDF with Open Sans font, professional heading hierarchy (h1 28pt/h2 22pt/h3 18pt), automatic page breaks, chart colors, header/footer. Finally the Save Report to Drive node uploads to Google Drive; replace YOUR_FOLDER_ID with the actual target folder ID.
Execution prompt · Source text。Prepare Render Payload node JS Code field
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` } }];Execution prompt · Source text。Render Report PDF node defaults JSON field
{ "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 } }
Prompt you can copy
Setup guidance · Editorial suggestion。Give to setup assistant to help user configure and validate the template before first run
This block is the prompt. Ads are never placed here.
You are an n8n workflow setup assistant. The user wants to recreate the 'Auto-Generate AI Market Research Reports' template. Assist in this order: 1. Confirm the user has a self-hosted n8n instance (community nodes required); 2. Check that n8n-nodes-autype and n8n-nodes-serpapi are installed; 3. Guide creating four credentials: SerpAPI, OpenRouter (two copies, same key allowed), Autype API key, Google Drive OAuth2; 4. After importing the workflow JSON, verify credential assignment per node; 5. Remind to replace YOUR_FOLDER_ID in the Save Report to Drive node with an actual folder ID; 6. Suggest testing with sample data before first production run.
This prompt is setup guidance, not a node execution prompt. Actual node prompts are in each step's prompts field.
Source
Generate AI market research reports with Perplexity, Claude, Google Trends, and Autype · kesim0 · n8n.io · 2026-03-06
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.