This workflow corresponds to n8n.io template #12599 — we link there as the canonical source.
This workflow follows the Agent → Error Trigger recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "WXQLci7o0JPwN2Q6",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Analyze Market Demand using GPT-4o and XPOZ MCP with Notion & Email Reports",
"tags": [],
"nodes": [
{
"id": "ba71fddd-0f4b-40d4-9fb7-066b81310771",
"name": "Workflow Error Handler",
"type": "n8n-nodes-base.errorTrigger",
"position": [
-640,
848
],
"parameters": {},
"typeVersion": 1
},
{
"id": "c2894b99-27d7-4b68-9ca6-161e862687cc",
"name": "Send a message1",
"type": "n8n-nodes-base.gmail",
"position": [
-288,
848
],
"parameters": {
"sendTo": "user@example.com",
"message": "=\ud83d\udea8 *Workflow Error Alert* *Error Node:* {{ $json.node.name }} *Error Message:* {{ $json.error.message }} *Timestamp:* {{ $now.toISO() }} Please investigate immediately.",
"options": {},
"subject": "Workflow Error Alert",
"emailType": "text"
},
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
},
"typeVersion": 2.2
},
{
"id": "ac5dfa8c-e898-47e7-aba5-b6874ea1e30f",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-720,
688
],
"parameters": {
"color": 7,
"width": 672,
"height": 336,
"content": "## Error Handling\nSends alerts when the workflow fails\n"
},
"typeVersion": 1
},
{
"id": "b09a495c-095a-49d0-b9cf-05a864b6e89b",
"name": "Scheduled Market Research Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-480,
16
],
"parameters": {
"rule": {
"interval": [
{}
]
}
},
"typeVersion": 1.3
},
{
"id": "25189cbd-6271-436b-bc39-44d43387fbd1",
"name": "Inject Niche, Query, and Research Notes",
"type": "n8n-nodes-base.set",
"position": [
-208,
16
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "105bdfc5-b28e-4d96-a993-af24e5b24fff",
"name": "body.niche",
"type": "string",
"value": "=n8n automations"
},
{
"id": "619782c6-212c-4782-86f7-6f7819f1c294",
"name": "body.query",
"type": "string",
"value": "=Lead generation and CRM automation using n8n"
},
{
"id": "d9859010-1dcd-494d-a197-a4d833291fa3",
"name": "body.notes",
"type": "string",
"value": "=Focus on common automation use cases, pain points, and complaints about building or maintaining n8n workflows. Look for people asking for templates, integrations, or alternatives."
}
]
}
},
"typeVersion": 3.4
},
{
"id": "e0789a80-86b3-4b67-8c7e-3be9491d236b",
"name": "Analyze Public Discussions for Market Demand Signals (AI)",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
112,
16
],
"parameters": {
"text": "=ANALYSIS REQUEST:\n\nNiche: \"{{ $json.body.niche }}\"\nResearch Topic / Keywords: \"{{ $json.body.query }}\"\nnotes : {{ $json.body.notes }}\n\nTask:\nAnalyze public discussions related to the given niche and keywords across the selected platforms.\n\nFocus on:\n- Real customer pain points and frustrations\n- Marketing and growth challenges\n- Mentions of competitors or existing tools\n- Complaints, limitations, or pricing issues with current solutions\n- Posts where users ask for tools, alternatives, or recommendations\n- Language users naturally use to describe their problems\n\nGoal:\nIdentify high-signal market demand and actionable startup opportunities.\n\nReturn insights only if they show real demand or buying intent.\nIgnore generic discussions, tutorials, promotions, or news-only content.\n",
"options": {
"maxIterations": 30,
"systemMessage": "You are a market research and growth intelligence analyst.\n\nYou specialize in:\n- Startup idea validation\n- Marketing gap analysis\n- Competitive intelligence\n- Buying-intent detection from public online discussions\n\nYou have access to connected search and social intelligence tools that allow you to analyze public data from:\n- Google Search\n- Twitter/X\n- Instagram\n\nYour responsibilities:\n1. Extract only high-signal insights (real problems, unmet needs, demand)\n2. Identify competitor weaknesses or dissatisfaction\n3. Detect buying or switching intent\n4. Focus on insights useful for founders, marketers, and growth teams\n\nRules:\n- Use only public information\n- Do NOT invent private data\n- Be concise and factual\n- Prefer insight over volume\n- Avoid marketing fluff\n\nIf no strong demand signals exist, clearly state that demand is weak or unclear.\n"
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 3
},
{
"id": "dbe246d9-0eeb-4e80-adb9-5c374f6f77a1",
"name": "Public Search & Social Intelligence Connector (MCP Client)",
"type": "@n8n/n8n-nodes-langchain.mcpClientTool",
"position": [
272,
288
],
"parameters": {
"options": {},
"endpointUrl": "https://mcp.xpoz.ai/mcp",
"authentication": "bearerAuth"
},
"credentials": {
"httpBearerAuth": {
"name": "<your credential>"
}
},
"typeVersion": 1.2,
"rewireOutputLogTo": "ai_tool"
},
{
"id": "810c6014-efa3-48eb-b06e-0c04f26a1068",
"name": "OpenAI Reasoning Engine for Market Signal Extraction",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
80,
272
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o",
"cachedResultName": "gpt-4o"
},
"options": {},
"responsesApiEnabled": false
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "92012dd0-85bb-4510-97c9-c15b81a7b961",
"name": "Convert Market Signals into Notion Summary and Customer Email (AI)",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
576,
16
],
"parameters": {
"text": "=You are given market insight data collected from public discussions.\n\nTASK:\n\n1. Create a Notion-ready summary:\n - Short\n - Plain text\n - Easy to paste directly into a Notion page\n - Focus on key insights, problems, and opportunities\n\n2. Create a customer-ready email:\n - Professional subject line\n - Short introduction\n - Key insights in simple language\n - Clear value for the customer\n - Neutral CTA (no selling pressure)\n\nReturn ONLY valid JSON in the following structure:\n\n{\n \"notion_summary\": \"text\",\n \"email\": {\n \"subject\": \"text\",\n \"body\": \"text\"\n }\n}\n\nHere is the input data:\n{{ $json.output }}\n",
"options": {
"maxIterations": 30,
"systemMessage": "You are an AI Operations Analyst.\n\nYour task is to transform raw market or insight data into:\n1. A concise Notion-ready summary\n2. A professional customer-ready email\n\nRules:\n- Be clear, business-focused, and non-technical\n- Do NOT use markdown\n- Do NOT include emojis\n- Keep language simple and actionable\n- No hallucinations or new data\n- Use only the provided input content\n- Output MUST be valid JSON only\n\nTone:\n- Professional\n- Insight-driven\n- Customer-friendly\n\nLength rules:\n- Notion summary: 4\u20136 short bullet-style lines (plain text)\n- Email: concise, value-focused, easy to skim\n"
},
"promptType": "define"
},
"typeVersion": 3
},
{
"id": "0328136b-1139-4053-8f4d-dcc8d65d9170",
"name": "OpenAI Reasoning Engine for Insight Formatting",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
576,
272
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o",
"cachedResultName": "gpt-4o"
},
"options": {},
"responsesApiEnabled": false
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.3
},
{
"id": "e794d9fc-bbca-451e-8667-da23b383f3a0",
"name": "Parse Structured Insight Output from AI",
"type": "n8n-nodes-base.code",
"position": [
1040,
16
],
"parameters": {
"jsCode": "// Get the AI output (string)\nconst rawOutput = $json.output;\n\n// Safety check\nif (!rawOutput || typeof rawOutput !== 'string') {\n throw new Error('No valid AI output found to parse');\n}\n\nlet parsedOutput;\n\ntry {\n parsedOutput = JSON.parse(rawOutput);\n} catch (error) {\n throw new Error('Failed to parse AI output as JSON');\n}\n\n// Return clean JSON for downstream nodes\nreturn [\n {\n json: parsedOutput\n }\n];\n"
},
"typeVersion": 2
},
{
"id": "2eb4ed33-015f-45f7-ba81-c3b5fa211b99",
"name": "Send Market Insight Email to Stakeholder",
"type": "n8n-nodes-base.gmail",
"position": [
1408,
208
],
"parameters": {
"sendTo": "user@example.com",
"message": "={{ $json.email.body }}",
"options": {},
"subject": "={{ $json.email.subject }}",
"emailType": "text"
},
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
},
"typeVersion": 2.2
},
{
"id": "b5a4fd96-9a7e-44aa-a534-4e310dafd863",
"name": "Save Market Research Insight to Notion Database",
"type": "n8n-nodes-base.notion",
"position": [
1408,
-160
],
"parameters": {
"title": "=data",
"simple": false,
"options": {},
"resource": "databasePage",
"databaseId": {
"__rl": true,
"mode": "list",
"value": "2da802b9-1fa0-80ae-b132-f6314abec640",
"cachedResultUrl": "https://www.notion.so/2da802b91fa080aeb132f6314abec640",
"cachedResultName": "keyword based research analysis summery"
},
"propertiesUi": {
"propertyValues": [
{
"key": "summery|title",
"title": "={{ $json.notion_summary }}"
}
]
}
},
"credentials": {
"notionApi": {
"name": "<your credential>"
}
},
"typeVersion": 2.2
},
{
"id": "78a65ae9-6282-4cba-aee6-0bbc52cf8e59",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1648,
-848
],
"parameters": {
"width": 816,
"height": 608,
"content": "## \ud83d\udd0e Analyze Market Demand using GPT-4o and XPOZ MCP with Notion & Email Reports\n\n### How it works\nThis workflow runs on a scheduled trigger to perform automated market research for a defined niche and topic. It injects a preset niche, research query, and analyst notes, then scans public discussions across search and social platforms to identify real demand signals.\n\nAn AI market research agent analyzes public conversations to uncover customer pain points, unmet needs, buying or switching intent, and dissatisfaction with existing solutions. Low-signal noise such as tutorials, promotions, or generic chatter is ignored.\n\nThe validated insights are then transformed into two outputs: a concise Notion-ready summary for internal documentation and a professional customer-ready email that highlights key findings in simple, business-friendly language. Both outputs are generated automatically without manual review.\n\nFinally, the workflow stores insights in a Notion database for long-term research tracking and sends the email to stakeholders, enabling continuous market intelligence without repetitive manual research.\n\n### Setup steps\n1. Configure the schedule trigger frequency.\n2. Update niche, query, and research notes if needed.\n3. Connect OpenAI credentials.\n4. Add MCP (Xpoz) social intelligence credentials.\n5. Configure Notion database access.\n6. Set the stakeholder email address.\n"
},
"typeVersion": 1
},
{
"id": "5e1e7b67-ea9c-4e65-ac96-090fb75608ed",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-560,
-208
],
"parameters": {
"color": 7,
"width": 496,
"height": 512,
"content": "## Scheduling & Research Context\nControls when research runs and defines the niche, keywords, and analyst focus.\n"
},
"typeVersion": 1
},
{
"id": "733783ee-22ec-4716-8869-66067ecfe200",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
32,
-176
],
"parameters": {
"color": 7,
"width": 400,
"height": 640,
"content": "## Market Demand Signal Discovery\nAnalyzes public discussions to identify real problems, demand, and buying intent.\n"
},
"typeVersion": 1
},
{
"id": "c0448194-bf23-42fb-8003-2966f6e53e20",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
528,
-128
],
"parameters": {
"color": 7,
"width": 336,
"height": 560,
"content": "## Insight Conversion & Formatting\nTransforms raw insights into Notion summaries and customer-ready emails.\n"
},
"typeVersion": 1
},
{
"id": "8901c706-5abf-4251-a8ef-387c4b43f6cf",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
912,
-128
],
"parameters": {
"color": 7,
"width": 336,
"height": 336,
"content": "## Output Parsing & Validation\nParses and validates structured AI output for safe downstream use.\n"
},
"typeVersion": 1
},
{
"id": "cae5f79a-89c2-4980-9e53-52a8d494259f",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1280,
-352
],
"parameters": {
"color": 7,
"width": 368,
"height": 816,
"content": "## Distribution & Knowledge Storage\nStores insights in Notion and sends summaries to stakeholders.\n"
},
"typeVersion": 1
},
{
"id": "8ec07943-b901-42b4-a0ff-973c50ab1c4a",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
1056,
-992
],
"parameters": {
"color": 4,
"width": 624,
"height": 576,
"content": "## \ud83c\udfa5 Workflow Demo Video\n\nWatch a short walkthrough explaining:\n\u2022 What this automation does \n\u2022 How the data flows \n\u2022 How to set up credentials \n\u2022 Common mistakes to avoid \n\n@[youtube](QnpauEj5Ck8)"
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "aaa23dcf-c386-47bb-8d26-89ef393d4647",
"connections": {
"Workflow Error Handler": {
"main": [
[
{
"node": "Send a message1",
"type": "main",
"index": 0
}
]
]
},
"Scheduled Market Research Trigger": {
"main": [
[
{
"node": "Inject Niche, Query, and Research Notes",
"type": "main",
"index": 0
}
]
]
},
"Inject Niche, Query, and Research Notes": {
"main": [
[
{
"node": "Analyze Public Discussions for Market Demand Signals (AI)",
"type": "main",
"index": 0
}
]
]
},
"Parse Structured Insight Output from AI": {
"main": [
[
{
"node": "Save Market Research Insight to Notion Database",
"type": "main",
"index": 0
},
{
"node": "Send Market Insight Email to Stakeholder",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Reasoning Engine for Insight Formatting": {
"ai_languageModel": [
[
{
"node": "Convert Market Signals into Notion Summary and Customer Email (AI)",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Save Market Research Insight to Notion Database": {
"main": [
[]
]
},
"OpenAI Reasoning Engine for Market Signal Extraction": {
"ai_languageModel": [
[
{
"node": "Analyze Public Discussions for Market Demand Signals (AI)",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Analyze Public Discussions for Market Demand Signals (AI)": {
"main": [
[
{
"node": "Convert Market Signals into Notion Summary and Customer Email (AI)",
"type": "main",
"index": 0
}
]
]
},
"Public Search & Social Intelligence Connector (MCP Client)": {
"ai_tool": [
[
{
"node": "Analyze Public Discussions for Market Demand Signals (AI)",
"type": "ai_tool",
"index": 0
}
]
]
},
"Convert Market Signals into Notion Summary and Customer Email (AI)": {
"main": [
[
{
"node": "Parse Structured Insight Output from AI",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
gmailOAuth2httpBearerAuthnotionApiopenAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow performs automated market demand research for a defined niche on a scheduled basis and converts raw public discussions into actionable business insights. It continuously scans search engines and social platforms to identify real customer pain points, unmet needs,…
Source: https://n8n.io/workflows/12599/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This workflow automates market-driven content ideation by continuously discovering real user pain points from public discussions and converting them into execution-ready content ideas. It is designed
Transform your salon/service business with this streamlined WhatsApp automation system featuring Claude integration, zero-setup database management, and intelligent conversation handling. Claude MCP I
This workflow is designed for Scrum Masters and Agile Coaches who prepare and coordinate Sprint Planning sessions, using Google Calendar, Google Sheets, and OpenAI.
This workflow is designed for Scrum Masters, Agile Coaches, and Product Owners who want to automate backlog refinement preparation using Google Sheets, Gmail, and OpenAI. It’s ideal for teams seeking
This n8n workflow is designed for WooCommerce store owners and e-commerce managers who want to automate their store operations through an intelligent AI assistant. The workflow creates a conversationa