10 - Rastreador del panorama empresarial
Este es unMarket Research, Multimodal AIflujo de automatización del dominio deautomatización que contiene 15 nodos.Utiliza principalmente nodos como If, Code, Airtable, HttpRequest, GoogleSheets. Investigación diaria de competencia automatizada usando SerpAPI, Google Sheets y Airtable
- •Clave de API de Airtable
- •Pueden requerirse credenciales de autenticación para la API de destino
- •Credenciales de API de Google Sheets
Nodos utilizados (15)
{
"name": "10 - Business Landscape Tracker",
"tags": [],
"nodes": [
{
"id": "1be5e364-b985-4ce4-bb52-5f4d4afc8481",
"name": "🕒 Ejecución Automática (Programada)",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-2040,
0
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 9
}
]
}
},
"typeVersion": 1.2
},
{
"id": "7e5d5597-0e13-477d-af55-2847cdd4b89c",
"name": "📄 Leer Hoja de Empresas",
"type": "n8n-nodes-base.googleSheets",
"position": [
-1820,
0
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID_HERE/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID_HERE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID_HERE/edit?usp=drivesdk",
"cachedResultName": "Companies List"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "YOUR_GOOGLE_SHEETS_CREDENTIAL_ID",
"name": "Google Sheets account"
}
},
"typeVersion": 4
},
{
"id": "0942f8f7-220c-48fc-bda0-43b250981475",
"name": "🧹 Limpiar y Formatear Lista de Empresas",
"type": "n8n-nodes-base.code",
"position": [
-1600,
0
],
"parameters": {
"jsCode": "const companies = [];\n\nfor (const item of $input.all()) {\n // Get company name from the correct field key: \"List\"\n const companyName = item.json.List;\n\n if (companyName && companyName.trim() !== '') {\n companies.push({\n company: companyName.trim(),\n row: item.json.row_number || companies.length + 2\n });\n }\n}\n\n// Return each company as a separate item\nreturn companies.map(company => ({ json: company }));"
},
"typeVersion": 2
},
{
"id": "dd0127ef-28ef-4928-8cdc-6cf0627ac365",
"name": "🔁 Bucle sobre Empresas",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-1380,
0
],
"parameters": {
"options": {},
"batchSize": 100
},
"typeVersion": 3
},
{
"id": "ee903349-6643-4c97-862c-bd50d2abcd8d",
"name": "🌍 Buscar Competidores de Empresa (SerpAPI)",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1160,
0
],
"parameters": {
"url": "https://serpapi.com/search.json",
"options": {
"response": {
"response": {
"responseFormat": "json"
}
}
},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "q",
"value": "={{ $json.company }} competitors"
},
{
"name": "hl",
"value": "en"
},
{
"name": "gl",
"value": "us"
},
{
"name": "api_key",
"value": "YOUR_SERPAPI_KEY_HERE"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "a5f9d7d7-a7b2-4325-bbe9-c2feb053f98a",
"name": "🧠 Extraer Datos de Competidores de Búsqueda",
"type": "n8n-nodes-base.code",
"position": [
-940,
0
],
"parameters": {
"jsCode": "const inputData = $input.all();\nconst results = [];\n\nfor (const item of inputData) {\n const searchResults = item.json;\n\n // === Helper Functions (same as before) ===\n\n function extractCompanyName(searchData) {\n if (searchData.search_parameters?.q) {\n const query = searchData.search_parameters.q.toLowerCase();\n const cleanQuery = query\n .replace(/competitors?/gi, '')\n .replace(/competition/gi, '')\n .replace(/vs/gi, '')\n .replace(/alternatives?/gi, '')\n .trim();\n const companyName = cleanQuery.split(' ')[0];\n return companyName.charAt(0).toUpperCase() + companyName.slice(1);\n }\n\n if (searchData.organic_results?.[0]?.title) {\n const title = searchData.organic_results[0].title;\n const match = title.match(/(\\w+)\\s+competitors?/i);\n if (match) return match[1];\n }\n\n return \"Unknown Company\";\n }\n\n function extractCompetitors(searchData) {\n const competitors = new Set();\n\n if (searchData.related_questions) {\n searchData.related_questions.forEach(q => {\n q.list?.forEach(item => {\n const clean = item.replace(/\\.$/, '').trim();\n if (clean.length > 1) competitors.add(clean);\n });\n });\n }\n\n if (searchData.ai_overview?.text_blocks) {\n searchData.ai_overview.text_blocks.forEach(block => {\n block.list?.forEach(item => {\n const clean = item.title?.replace(/:$/, '').trim();\n if (clean?.length > 1) competitors.add(clean);\n });\n });\n }\n\n if (searchData.organic_results) {\n searchData.organic_results.forEach(result => {\n const snippet = result.snippet;\n if (snippet) {\n const patterns = [\n /competitors?[^.]*?include[^.]*?([A-Z][a-zA-Z\\s,&.]+)/gi,\n /rivals?[^.]*?include[^.]*?([A-Z][a-zA-Z\\s,&.]+)/gi,\n /competition[^.]*?from[^.]*?([A-Z][a-zA-Z\\s,&.]+)/gi\n ];\n patterns.forEach(pattern => {\n const matches = snippet.match(pattern);\n if (matches) {\n matches.forEach(match => {\n match\n .split(/,|\\sand\\s|&/)\n .map(name => name.replace(/[^a-zA-Z\\s]/g, '').trim())\n .forEach(name => {\n if (name.length > 2 && !name.toLowerCase().includes('competitor'))\n competitors.add(name);\n });\n });\n }\n });\n }\n });\n }\n\n if (searchData.answer_box?.expanded_list) {\n searchData.answer_box.expanded_list.forEach(item => {\n if (item.title) competitors.add(item.title);\n });\n }\n\n return Array.from(competitors).slice(0, 10);\n }\n\n function getTopSource(searchData) {\n return searchData.organic_results?.[0]?.link || null;\n }\n\n // === Main Logic ===\n try {\n const company = extractCompanyName(searchResults);\n const competitorsList = extractCompetitors(searchResults);\n const topSource = getTopSource(searchResults);\n\n results.push({\n json: {\n company,\n competitors: competitorsList.join(', ') || 'No competitors found',\n competitor_count: competitorsList.length,\n top_source: topSource,\n search_query: searchResults.search_parameters?.q || 'N/A',\n total_results: searchResults.search_information?.total_results || 0,\n extraction_timestamp: new Date().toISOString()\n }\n });\n } catch (err) {\n results.push({\n json: {\n error: `Extraction failed: ${err.message}`,\n company: \"Unknown\",\n competitors: \"\",\n competitor_count: 0,\n top_source: null\n }\n });\n }\n}\n\nreturn results;"
},
"typeVersion": 2
},
{
"id": "20193daa-c689-4311-ad39-9f696794712d",
"name": "🧐 ¿Tiene Competidores?",
"type": "n8n-nodes-base.if",
"position": [
-720,
0
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "8a7b6c5d-4321-0987-6543-210fedcba987",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.competitors }}",
"rightValue": "No competitors found"
}
]
}
},
"typeVersion": 2
},
{
"id": "1f513736-3963-4045-9eaa-4df3cebfc0e3",
"name": "📊 Registrar en Hoja de Resultados",
"type": "n8n-nodes-base.googleSheets",
"position": [
-500,
-100
],
"parameters": {
"columns": {
"value": {
"Source": "={{ $json.top_source }}",
"Company": "={{ $json.company }}",
"Competitors": "={{ $json.competitors }}",
"Total Results": "={{ $json.total_results }}"
},
"schema": [
{
"id": "Company",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Company",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Competitors",
"type": "string",
"display": true,
"required": false,
"displayName": "Competitors",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Total Results",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Total Results",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Source",
"type": "string",
"display": true,
"required": false,
"displayName": "Source",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Company"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {
"useAppend": true,
"cellFormat": "USER_ENTERED"
},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_RESULTS_GOOGLE_SHEET_ID_HERE/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_RESULTS_GOOGLE_SHEET_ID_HERE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_RESULTS_GOOGLE_SHEET_ID_HERE/edit?usp=drivesdk",
"cachedResultName": "Companies Result"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "YOUR_GOOGLE_SHEETS_CREDENTIAL_ID",
"name": "Google Sheets account"
}
},
"typeVersion": 4
},
{
"id": "d39b91c7-a3c0-45eb-b926-2d668262a899",
"name": "❌ Registrar Empresas Sin Resultados",
"type": "n8n-nodes-base.googleSheets",
"position": [
-500,
100
],
"parameters": {
"columns": {
"value": {
"Source": "Null",
"Company": "={{ $json.company }}",
"Competitors": "No Competetitors Found",
"Total Results": "0"
},
"schema": [
{
"id": "Company",
"type": "string",
"display": true,
"required": false,
"displayName": "Company",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Competitors",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Competitors",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Total Results",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Total Results",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Source",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Source",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {
"useAppend": true,
"cellFormat": "USER_ENTERED"
},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_RESULTS_GOOGLE_SHEET_ID_HERE/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_RESULTS_GOOGLE_SHEET_ID_HERE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_RESULTS_GOOGLE_SHEET_ID_HERE/edit?usp=drivesdk",
"cachedResultName": "Companies Result"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "YOUR_GOOGLE_SHEETS_CREDENTIAL_ID",
"name": "Google Sheets account"
}
},
"typeVersion": 4
},
{
"id": "7910cb3e-88e7-4716-82ad-89bec10409a8",
"name": "🗃️ Sincronizar con Airtable",
"type": "n8n-nodes-base.airtable",
"position": [
-280,
0
],
"parameters": {
"base": {
"__rl": true,
"mode": "list",
"value": "YOUR_AIRTABLE_BASE_ID_HERE",
"cachedResultUrl": "https://airtable.com/YOUR_AIRTABLE_BASE_ID_HERE",
"cachedResultName": "Test"
},
"table": {
"__rl": true,
"mode": "list",
"value": "YOUR_AIRTABLE_TABLE_ID_HERE",
"cachedResultUrl": "https://airtable.com/YOUR_AIRTABLE_BASE_ID_HERE/YOUR_AIRTABLE_TABLE_ID_HERE",
"cachedResultName": "Table 1"
},
"columns": {
"value": {
"Source": "={{ $json.Source }}",
"Company": "={{ $json.Company }}",
"Competitors": "={{ $json.Competitors }}",
"Total Results": "={{ $json[\"Total Results\"] }}"
},
"schema": [
{
"id": "id",
"type": "string",
"display": true,
"removed": false,
"readOnly": true,
"required": false,
"displayName": "id",
"defaultMatch": true
},
{
"id": "Company",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Company",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Competitors",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Competitors",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Total Results",
"type": "number",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Total Results",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Source",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Source",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Company"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "upsert"
},
"credentials": {
"airtableTokenApi": {
"id": "YOUR_AIRTABLE_CREDENTIAL_ID",
"name": "Airtable Personal Access Token account"
}
},
"typeVersion": 2.1
},
{
"id": "b299cf8f-6b5e-48f2-adb4-2794ad4220aa",
"name": "Nota Adhesiva",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2140,
-340
],
"parameters": {
"color": 5,
"width": 280,
"height": 640,
"content": "## Auto Run (Scheduled)\n\n**Description:**\n\n⏰ This is the starting point of the workflow. It runs automatically based on your configured schedule—no manual trigger needed."
},
"typeVersion": 1
},
{
"id": "e21ba623-5589-4781-a131-31afbee80431",
"name": "Nota Adhesiva1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1840,
-340
],
"parameters": {
"color": 3,
"width": 600,
"height": 640,
"content": "## Loop Over Companies\n\n**Description:**\n\n📋 Fetch companies from a Google Sheet (List column).\n\n🧹 Clean and format data, removing empty entries and attaching row numbers.\n\n🔁 Send companies into the flow using a Lopp Over node for processing.\n"
},
"typeVersion": 1
},
{
"id": "38ce6a00-5b57-47a2-9cce-e2deaa67e285",
"name": "Nota Adhesiva2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1220,
-340
],
"parameters": {
"color": 4,
"width": 220,
"height": 640,
"content": "## Search Company Competitors (SerpAPI)\n\n**Description:**\n\n🔍 For each company, this node sends a GET request to SerpAPI with the query {company} competitors, returning structured search result JSON for further parsing."
},
"typeVersion": 1
},
{
"id": "78b206db-221d-426c-aa15-1115c2266cc8",
"name": "Nota Adhesiva3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-980,
-340
],
"parameters": {
"width": 420,
"height": 640,
"content": "## Extract & Check Competitors\n\n**Description:**\n\nExtracts the company name, up to 10 competitors, and top source from SerpAPI results.\nThen checks if any competitors were found:\n\n✅ Yes → Send to Google Sheet + Airtable\n\n❌ No → Log as failed search"
},
"typeVersion": 1
},
{
"id": "6ef49329-b2a7-44ad-9226-d2c61dc996e7",
"name": "Nota Adhesiva4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-540,
-340
],
"parameters": {
"color": 6,
"width": 460,
"height": 640,
"content": "## Log Results to Sheets & Airtable\n\n**Description:**\n\nLogs successful competitor data to Google Sheets ✅\n\nLogs failed searches separately ❌\n\nBoth flows sync to Airtable for unified storage 📥"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"connections": {
"20193daa-c689-4311-ad39-9f696794712d": {
"main": [
[
{
"node": "1f513736-3963-4045-9eaa-4df3cebfc0e3",
"type": "main",
"index": 0
}
],
[
{
"node": "d39b91c7-a3c0-45eb-b926-2d668262a899",
"type": "main",
"index": 0
}
]
]
},
"1f513736-3963-4045-9eaa-4df3cebfc0e3": {
"main": [
[
{
"node": "7910cb3e-88e7-4716-82ad-89bec10409a8",
"type": "main",
"index": 0
}
]
]
},
"dd0127ef-28ef-4928-8cdc-6cf0627ac365": {
"main": [
[],
[
{
"node": "ee903349-6643-4c97-862c-bd50d2abcd8d",
"type": "main",
"index": 0
}
]
]
},
"7e5d5597-0e13-477d-af55-2847cdd4b89c": {
"main": [
[
{
"node": "0942f8f7-220c-48fc-bda0-43b250981475",
"type": "main",
"index": 0
}
]
]
},
"1be5e364-b985-4ce4-bb52-5f4d4afc8481": {
"main": [
[
{
"node": "7e5d5597-0e13-477d-af55-2847cdd4b89c",
"type": "main",
"index": 0
}
]
]
},
"0942f8f7-220c-48fc-bda0-43b250981475": {
"main": [
[
{
"node": "dd0127ef-28ef-4928-8cdc-6cf0627ac365",
"type": "main",
"index": 0
}
]
]
},
"d39b91c7-a3c0-45eb-b926-2d668262a899": {
"main": [
[
{
"node": "7910cb3e-88e7-4716-82ad-89bec10409a8",
"type": "main",
"index": 0
}
]
]
},
"a5f9d7d7-a7b2-4325-bbe9-c2feb053f98a": {
"main": [
[
{
"node": "20193daa-c689-4311-ad39-9f696794712d",
"type": "main",
"index": 0
}
]
]
},
"ee903349-6643-4c97-862c-bd50d2abcd8d": {
"main": [
[
{
"node": "a5f9d7d7-a7b2-4325-bbe9-c2feb053f98a",
"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, IA Multimodal
¿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
Avkash Kakdiya
@itechnotion🚀 Founder of iTechNotion — we build custom AI-powered automation workflows for startups, agencies, and founders. 💡 Specializing in agentic AI systems, content automation, sales funnels, and digital workers. 🔧 14+ years in tech | Building scalable no-code/low-code solutions using n8n, OpenAI, and other API-first tools. 📬 Let’s automate what slows you down.
Compartir este flujo de trabajo