Sistema de Inteligencia de Mercado y Competencia Impulsado por IA basado en GPT-4 y Apify
Este es unMarket Research, AI Summarizationflujo de automatización del dominio deautomatización que contiene 12 nodos.Utiliza principalmente nodos como Code, Merge, Slack, Postgres, GoogleDocs. Sistema de Inteligencia de Mercado y Competencia Impulsado por IA basado en GPT-4 y Apify
- •Bot Token de Slack o URL de Webhook
- •Información de conexión de la base de datos PostgreSQL
- •Pueden requerirse credenciales de autenticación para la API de destino
- •Clave de API de OpenAI
Nodos utilizados (12)
{
"id": "lsEzOZHxXPDvQmBS",
"meta": {
"instanceId": "a287613f1596da776459594685fbf4e2b4a12124f80ab8c8772f5e37bff103ae",
"templateCredsSetupCompleted": true
},
"name": "AI-Driven Competitor & Market Intelligence with GPT 4 & Apify",
"tags": [],
"nodes": [
{
"id": "9a08ac46-0e1c-4e7f-b83d-9e0537634aef",
"name": "Activador de Análisis Programado",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
0,
96
],
"parameters": {
"rule": {
"interval": [
{}
]
}
},
"typeVersion": 1.2
},
{
"id": "c52f9e5a-f2c9-4895-b9cc-a00fed3ae1ee",
"name": "Apify",
"type": "n8n-nodes-base.httpRequest",
"position": [
224,
0
],
"parameters": {
"url": "https://api.apify.com/v2/acts/apify~web-scraper/run-sync",
"method": "POST",
"options": {},
"jsonBody": "{\n \"startUrls\": [\n { \"url\": \"https://www.competitorA.com/pricing\" },\n { \"url\": \"https://www.g2.com/products/competitorB/reviews\" },\n { \"url\": \"https://techcrunch.com/tag/it-trends/\" }\n ],\n \"pseudoUrls\": [\n { \"url\": \"https://www.competitorA.com/blog/[.*]\", \"selector\": \"article\" }\n ],\n \"maxRequestsPerCrawl\": 100\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer [YOUR-API-KEY]"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "f055a43d-ed97-4ae9-b9f9-3cb2baf55b0e",
"name": "Obtener RSS de Noticias y Blogs",
"type": "n8n-nodes-base.rssFeedRead",
"position": [
224,
192
],
"parameters": {
"url": "[RSS_FEED_URL_1], [RSS_FEED_URL_2], [GOOGLE_ALERTS_RSS_URL]",
"options": {}
},
"typeVersion": 1.2
},
{
"id": "01962693-51f2-4e2e-8b66-e2af1c048251",
"name": "Combinar Fuentes de Datos",
"type": "n8n-nodes-base.merge",
"position": [
448,
96
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "dd1ef4a6-613f-4055-9863-b900042ff968",
"name": "Preprocesar Datos para IA",
"type": "n8n-nodes-base.code",
"position": [
656,
96
],
"parameters": {
"jsCode": "const processedItems = [];\nfor (const item of $input.item) {\n let textContent = '';\n let source = 'Unknown';\n let url = '';\n let title = '';\n\n // Example for HTTP Request output (assuming data is in 'item.json.data')\n if (item.json && item.json.data && Array.isArray(item.json.data.results)) {\n for (const result of item.json.data.results) {\n if (result.html) { // Assuming scraper returns HTML\n // Simple text extraction (consider a more robust library like 'cheerio' if needed)\n // const cheerio = require('cheerio'); // Requires custom n8n setup if not bundled\n // const $ = cheerio.load(result.html);\n // textContent = $('body').text().slice(0, 4000); // Limit text length for AI\n textContent = result.html.replace(/<[^>]*>/g, '').slice(0, 4000); // Basic HTML stripping\n } else if (result.text) { // Assuming scraper returns plain text\n textContent = result.text.slice(0, 4000);\n }\n title = result.title || '';\n url = result.url || '';\n source = result.source || 'Web Scraper Data';\n\n if (textContent.length > 50) { // Only process meaningful content\n processedItems.push({\n json: {\n content: textContent,\n title: title,\n url: url,\n source: source\n }\n });\n }\n }\n }\n\n // Example for RSS Feed output\n if (item.json.description && item.json.title && item.json.link) {\n textContent = item.json.description.slice(0, 4000);\n title = item.json.title;\n url = item.json.link;\n source = 'RSS Feed';\n if (textContent.length > 50) {\n processedItems.push({\n json: {\n content: textContent,\n title: title,\n url: url,\n source: source\n }\n });\n }\n }\n}\nreturn processedItems;"
},
"typeVersion": 2
},
{
"id": "ee5407b0-86af-45ab-a8b7-100f0a01f96b",
"name": "Análisis de IA y Perspectivas de Competencia",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
864,
96
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "id",
"value": "gpt-4"
},
"options": {},
"messages": {
"values": [
{
"role": "system",
"content": "=You are an expert market intelligence analyst. Your task is to analyze raw data about IT companies and provide concise, actionable insights for a sales team."
},
{
"content": "=Analyze the following collected data about our competitor from various sources. Each data point is clearly labeled with its source.\n\nCollected Data:\n{{ $json.map(item => `- Source: ${item.json.source}\\n Title: ${item.json.title}\\n URL: ${item.json.url}\\n Content: ${item.json.content}`).join('\\n\\n') }}\n\nBased on this, provide the following in a structured JSON format:\n1. **Competitor Name:** (Identify the primary competitor if clear, or 'General Market Trends')\n2. **Key Offerings/Features Identified:** (List new features, services, or product updates)\n3. **Pricing/Promotions:** (Any pricing changes or ongoing promotions)\n4. **Customer Sentiment (from reviews/feedback):** (Summarize overall sentiment: Positive, Negative, Mixed, with key reasons)\n5. **Strengths:** (What are their identified strengths?)\n6. **Weaknesses:** (What are their identified weaknesses or customer pain points?)\n7. **Opportunities for Our Company:** (How can we leverage this info? New market segments, specific product angles, gaps we can fill)\n8. **Threats to Our Company:** (What competitive actions should we be aware of?)\n9. **Actionable Sales Talking Points Suggestion:** (3-5 concise bullet points for our sales team to use against this competitor or about market trends)\n\nEnsure the output is valid JSON."
}
]
}
},
"credentials": {
"openAiApi": {
"id": "WbMi3ZLLBnECFAAV",
"name": "Temp"
}
},
"typeVersion": 1.8
},
{
"id": "54ab8c2c-4641-4f1d-b1b5-67a2c20f7825",
"name": "Generar Informe de Inteligencia de Mercado",
"type": "n8n-nodes-base.googleDocs",
"notes": "Value:\n\ncompetitorName: ={{ JSON.parse($json.choices[0].message.content).Competitor_Name }}\n\nstrengths: ={{ JSON.parse($json.choices[0].message.content).Strengths.join('\\n- ') }}\n\nweaknesses: ={{ JSON.parse($json.choices[0].message.content).Weaknesses.join('\\n- ') }}\n\nopportunities: ={{ JSON.parse($json.choices[0].message.content).Opportunities_for_Our_Company.join('\\n- ') }}\n\nthreats: ={{ JSON.parse($json.choices[0].message.content).Threats_to_Our_Company.join('\\n- ') }}\n\nsalesTalkingPoints: ={{ JSON.parse($json.choices[0].message.content).Actionable_Sales_Talking_Points_Suggestion.join('\\n- ') }}",
"position": [
16,
432
],
"parameters": {
"title": "=Market Intel Report - {{ new Date().toISOString().slice(0,10) }}"
},
"credentials": {
"googleDocsOAuth2Api": {
"id": "058aq7NkPlnzASX2",
"name": "temp"
}
},
"typeVersion": 2
},
{
"id": "7fb6fd4a-e27d-44cf-8dcc-34845a445cb3",
"name": "Notificación al Equipo de Ventas y Marketing",
"type": "n8n-nodes-base.slack",
"position": [
208,
432
],
"webhookId": "0ecdb2bc-dbcc-4ebd-8851-af8a5d43ef73",
"parameters": {
"text": "=New Market Intelligence Report generated! Check the latest insights on {{ JSON.parse($json.choices[0].message.content).Competitor_Name || 'market trends' }}. Report Link: {{ $json.documentUrl }}",
"select": "channel",
"channelId": {
"__rl": true,
"mode": "id",
"value": "[YOUR_SALES_TEAM_SLACK_CHANNEL_ID]"
},
"otherOptions": {}
},
"credentials": {
"slackApi": {
"id": "AFKF0YsguyhsagR0",
"name": "temp"
}
},
"typeVersion": 2.3
},
{
"id": "7d456b48-e1c0-4316-adf0-31594c49a3b4",
"name": "Almacenar Perspectivas en Base de Datos",
"type": "n8n-nodes-base.postgres",
"position": [
416,
432
],
"parameters": {
"query": "INSERT INTO competitor_profiles (\n name, last_scraped, strengths, weaknesses, opportunities, threats, sales_talking_points\n) VALUES (\n '{{ JSON.parse($json.choices[0].message.content).Competitor_Name }}',\n '{{ new Date().toISOString() }}',\n '{{ JSON.parse($json.choices[0].message.content).Strengths.join(', ') }}',\n '{{ JSON.parse($json.choices[0].message.content).Weaknesses.join(', ') }}',\n '{{ JSON.parse($json.choices[0].message.content).Opportunities_for_Our_Company.join(', ') }}',\n '{{ JSON.parse($json.choices[0].message.content).Threats_to_Our_Company.join(', ') }}',\n '{{ JSON.parse($json.choices[0].message.content).Actionable_Sales_Talking_Points_Suggestion.join(', ') }}'\n)\nON CONFLICT (name) DO UPDATE SET\n last_scraped = EXCLUDED.last_scraped,\n strengths = EXCLUDED.strengths,\n weaknesses = EXCLUDED.weaknesses,\n opportunities = EXCLUDED.opportunities,\n threats = EXCLUDED.threats,\n sales_talking_points = EXCLUDED.sales_talking_points;",
"options": {},
"operation": "executeQuery"
},
"credentials": {
"postgres": {
"id": "JWyp3nPDNolMuk3l",
"name": "temp"
}
},
"typeVersion": 2.6
},
{
"id": "fa822554-b152-4543-b05a-a1bbea1802de",
"name": "Generar Puntos de Conversación Personalizados para Ventas",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
624,
432
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "id",
"value": "gpt-4"
},
"options": {},
"messages": {
"values": [
{
"role": "system",
"content": "You are a sales coach. Based on the competitor insights provided and a specific sales context, generate highly personalized and persuasive talking points for a sales representative."
},
{
"content": "=Recent competitor insights for {{ $json.name }} show:\nStrengths: {{ $json.strengths }}\nWeaknesses: {{ $json.weaknesses }}\nNew Features: {{ $json.new_features }}\n\nOur product/service strengths are: [OUR_PRODUCT_USP_1], [OUR_PRODUCT_USP_2].\n\nThe current sales context is: We are pitching to a prospect who is currently using [COMPETITOR_NAME_FROM_CRM_CONTEXT] and values [PROSPECT_VALUE_1], [PROSPECT_VALUE_2].\n\nGenerate 3-5 concise, actionable sales talking points for our sales rep."
}
]
}
},
"credentials": {
"openAiApi": {
"id": "WbMi3ZLLBnECFAAV",
"name": "Temp"
}
},
"typeVersion": 1.8
},
{
"id": "fe1c1f20-bda7-4bf3-9c35-ee8e21241218",
"name": "Nota Adhesiva",
"type": "n8n-nodes-base.stickyNote",
"position": [
-160,
-96
],
"parameters": {
"color": 3,
"width": 1440,
"height": 816,
"content": "## Flow"
},
"typeVersion": 1
},
{
"id": "fa066b98-3e5d-4150-9ed6-c8533e49e99e",
"name": "Nota Adhesiva1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-160,
768
],
"parameters": {
"color": 5,
"width": 1440,
"height": 1728,
"content": "# Automated AI-Driven Competitor & Market Intelligence System\n\n* **Problem Solved:** Small and Medium-sized IT companies often struggle to stay ahead in a rapidly evolving market. Manually tracking competitor moves, pricing changes, product updates, and emerging market trends is time-consuming, inconsistent, and often too slow for agile sales strategies. This leads to missed sales opportunities, ineffective pitches, and a reactive rather than proactive market approach.\n\n* **Solution Overview:** This n8n workflow automates the continuous collection and AI-powered analysis of competitor data and market trends. By leveraging web scraping, RSS feeds, and advanced AI models, it transforms raw data into actionable insights for your sales and marketing teams. The system generates structured reports, notifies relevant stakeholders, and stores intelligence in your database, empowering your team with real-time, strategic information.\n\n* **For Whom:** This high-value workflow is perfect for:\n * **IT Solution Providers & SaaS Companies:** To maintain a competitive edge and tailor sales pitches based on competitor weaknesses and market opportunities.\n * **Sales & Marketing Leaders:** To gain comprehensive, automated market intelligence without extensive manual research.\n * **Product Development Teams:** To identify market gaps and validate new feature development based on competitive landscapes and customer sentiment.\n * **Business Strategists:** To inform strategic planning with data-driven insights into industry trends and competitive threats.\n\n### How It Works (Scope of the Workflow) ⚙️\n\nThis system establishes a powerful, automated pipeline for market and competitor intelligence:\n\n1. **Scheduled Data Collection:** The workflow runs automatically at predefined intervals (e.g., weekly), initiating data retrieval from various online sources.\n2. **Diverse Information Gathering:** It pulls data from competitor websites (pricing, features, blogs via web scraping services), industry news and blogs (via RSS feeds), and potentially other sources.\n3. **Intelligent Data Preparation:** Collected data is aggregated, cleaned, and pre-processed using custom code to ensure it's in an optimal format for AI analysis, removing noise and extracting relevant text.\n4. **AI-Powered Analysis:** An advanced AI model (like OpenAI's GPT-4o) performs in-depth analysis on the cleaned data. It identifies competitor strengths, weaknesses, new offerings, pricing changes, customer sentiment from reviews, emerging market trends, and suggests specific opportunities and threats for your company.\n5. **Automated Report Generation:** The AI's structured insights are automatically populated into a professional Google Docs report using a predefined template, making the intelligence easily digestible for your team.\n6. **Team Notification:** Stakeholders (sales leads, marketing managers) receive automated notifications via Slack (or email), alerting them to the new report and key insights.\n7. **Strategic Data Storage & Utilization:** All analyzed insights are stored in a central database (e.g., PostgreSQL). This builds a historical record for long-term trend analysis and can optionally trigger sub-workflows to generate personalized sales talking points directly relevant to ongoing deals or specific prospects.\n\n---\n\n### Setup Steps 🛠️ (Building the Workflow)\n\nTo implement this sophisticated workflow in your n8n instance, follow these detailed steps:\n\n1. **Prepare Your Digital Assets & Accounts:**\n * **Google Sheet (Optional, if using for CRM data):** For simpler CRM, create a sheet with `CompetitorName`, `LastAnalyzedDate`, `Strengths`, `Weaknesses`, `Opportunities`, `Threats`, `SalesTalkingPoints`.\n * **API Keys & Credentials:**\n * **OpenAI API Key:** Essential for the AI analysis.\n * **Web Scraping Service API Key:** For services like Apify, Crawlbase, or similar (e.g., Bright Data, ScraperAPI).\n * **Database Access:** Credentials for your PostgreSQL/MySQL database. Ensure you've created necessary tables (`competitor_profiles`, `market_trends`) with appropriate columns.\n * **Google Docs Credential:** To link n8n to your Google Drive for report generation. Create a template Google Doc with placeholders (e.g., `{{competitorName}}`, `{{strengths}}`).\n * **Slack Credential:** For sending team notifications to specific channels.\n * **CRM API Key (Optional):** If directly integrating with HubSpot, Salesforce, or custom CRM via API.\n\n2. **Identify Data Sources for Intelligence:**\n * Compile a list of **competitor website URLs** you want to monitor (e.g., pricing pages, blog sections, news).\n * Identify relevant **online review platforms** (e.g., G2, Capterra) for competitor products.\n * Gather **RSS Feed URLs** from key industry news sources, tech blogs, and competitor's own blogs.\n * Define **keywords** for general market trends or competitor mentions, if using tools that provide RSS feeds (like Google Alerts).\n\n3. **Build the n8n Workflow (10 Key Nodes):**\n * Start a new workflow in n8n and add the following nodes, configuring their parameters and connections carefully:\n\n 1. **Cron (`Scheduled Analysis Trigger`):** Set this to trigger daily or weekly at a specific time (e.g., `Every Week`, `At Hour: 0`, `At Minute: 0`).\n 2. **HTTP Request (`Fetch Competitor Web Data`):** Configure this to call your chosen web scraping service's API. Set `Method` to `POST`, `URL` to the service's API endpoint, and build the `JSON/Raw Body` with the `startUrls` (competitor websites, review sites) for scraping, including your API Key in `Authentication` (e.g., `Header Auth`).\n 3. **RSS Feed (`Fetch News & Blog RSS`):** Add the URLs of competitor blogs and industry news RSS feeds.\n 4. **Merge (`Combine Data Sources`):** Connect inputs from both `Fetch Competitor Web Data` and `Fetch News & Blog RSS`. Use `Merge By Position`.\n 5. **Code (`Pre-process Data for AI`):** Write JavaScript code to iterate through merged items, extract relevant text content, perform basic cleaning (e.g., HTML stripping), and limit text length for AI input. Output should be an array of objects with `content`, `title`, `url`, and `source`.\n 6. **OpenAI (`AI Analysis & Competitor Insights`):** Select your OpenAI credential. Set `Resource` to `Chat Completion` and `Model` to `gpt-4o`. In `Messages`, create a `System` message defining AI's role and a `User` message containing the dynamic prompt (referencing `{{ $json.map(item => ... ).join('\\\\n\\\\n') }}` for `content`, `title`, `url`, `source`) and requesting a structured JSON output for analysis. Set `Output` to `Raw Data`.\n 7. **Google Docs (`Generate Market Intelligence Report`):** Select your Google Docs credential. Set `Operation` to `Create document from template`. Provide your `Template Document ID` and map the `Values` from the parsed AI output (using `JSON.parse($json.choices[0].message.content).PropertyName`) to your template placeholders.\n 8. **Slack (`Sales & Marketing Team Notification`):** Select your Slack credential. Set `Chat ID` to your team's Slack channel ID. Compose the `Text` message, referencing the report link (`{{ $json.documentUrl }}`) and key AI insights (e.g., `{{ JSON.parse($json.choices[0].message.content).Competitor_Name }}`).\n 9. **PostgreSQL (`Store Insights to Database`):** Select your PostgreSQL credential. Set `Operation` to `Execute Query`. Write an `INSERT ... ON CONFLICT DO UPDATE` SQL query to store the AI insights into your `competitor_profiles` or `market_trends` table, mapping values from the parsed AI output.\n 10. **OpenAI (`Generate Personalized Sales Talking Points` - Optional Branch):** This node can be part of the main workflow or a separate, manually triggered workflow. Configure it similarly to the main AI node, but with a prompt tailored to generate sales talking points based on a specific sales context and the stored insights.\n\n4. **Final Testing & Activation:**\n * **Run a Test:** Before going live, manually trigger the workflow from the first node. Carefully review the data at each stage to ensure correct processing and output. Verify that reports are generated, notifications are sent, and data is stored correctly.\n * **Activate Workflow:** Once testing is complete and successful, activate the workflow in n8n.\n\nThis system will empower your IT company's sales team with invaluable, data-driven intelligence, enabling them to close more deals and stay ahead in the market."
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "258df6c1-e558-4476-b32f-f94ff2620d10",
"connections": {
"c52f9e5a-f2c9-4895-b9cc-a00fed3ae1ee": {
"main": [
[
{
"node": "01962693-51f2-4e2e-8b66-e2af1c048251",
"type": "main",
"index": 0
}
]
]
},
"01962693-51f2-4e2e-8b66-e2af1c048251": {
"main": [
[
{
"node": "dd1ef4a6-613f-4055-9863-b900042ff968",
"type": "main",
"index": 0
}
]
]
},
"f055a43d-ed97-4ae9-b9f9-3cb2baf55b0e": {
"main": [
[
{
"node": "01962693-51f2-4e2e-8b66-e2af1c048251",
"type": "main",
"index": 1
}
]
]
},
"dd1ef4a6-613f-4055-9863-b900042ff968": {
"main": [
[
{
"node": "ee5407b0-86af-45ab-a8b7-100f0a01f96b",
"type": "main",
"index": 0
}
]
]
},
"9a08ac46-0e1c-4e7f-b83d-9e0537634aef": {
"main": [
[
{
"node": "c52f9e5a-f2c9-4895-b9cc-a00fed3ae1ee",
"type": "main",
"index": 0
},
{
"node": "f055a43d-ed97-4ae9-b9f9-3cb2baf55b0e",
"type": "main",
"index": 0
}
]
]
},
"7d456b48-e1c0-4316-adf0-31594c49a3b4": {
"main": [
[
{
"node": "fa822554-b152-4543-b05a-a1bbea1802de",
"type": "main",
"index": 0
}
]
]
},
"ee5407b0-86af-45ab-a8b7-100f0a01f96b": {
"main": [
[
{
"node": "54ab8c2c-4641-4f1d-b1b5-67a2c20f7825",
"type": "main",
"index": 0
}
]
]
},
"54ab8c2c-4641-4f1d-b1b5-67a2c20f7825": {
"main": [
[
{
"node": "7fb6fd4a-e27d-44cf-8dcc-34845a445cb3",
"type": "main",
"index": 0
}
]
]
},
"7fb6fd4a-e27d-44cf-8dcc-34845a445cb3": {
"main": [
[
{
"node": "7d456b48-e1c0-4316-adf0-31594c49a3b4",
"type": "main",
"index": 0
}
]
]
}
}
}¿Cómo usar este flujo de trabajo?
Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.
¿En qué escenarios es adecuado este flujo de trabajo?
Intermedio - Investigación de mercado, Resumen de IA
¿Es de pago?
Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.
Flujos de trabajo relacionados recomendados
Marth
@marthSimplifying Business with Smart Automation. I create and share user-friendly, highly efficient n8n workflow templates for SMEs, focusing on digital marketing, sales, and operational excellence. Get ready to automate, innovate, and elevate your business. Connect me on Linkedin for custom solutions.
Compartir este flujo de trabajo