Análisis automatizado de anuncios de Meta
Este es unMarket Research, AI Summarizationflujo de automatización del dominio deautomatización que contiene 17 nodos.Utiliza principalmente nodos como Limit, SplitOut, HttpRequest, GoogleSheets, ManualTrigger. Análisis automatizado de anuncios de Meta usando Gemini AI, ScrapingFlash y Google Sheets
- •Pueden requerirse credenciales de autenticación para la API de destino
- •Credenciales de API de Google Sheets
- •Clave de API de Google Gemini
Nodos utilizados (17)
{
"meta": {
"instanceId": "1f5ba07b3d13878feccf2edc6715cb776b71c7f07f9111b940d134cc0b5c944e"
},
"nodes": [
{
"id": "84fd2525-1a80-42e8-b0c1-d179b96d5d31",
"name": "README",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1520,
-2400
],
"parameters": {
"width": 500,
"height": 980,
"content": "## AI Meta Ads Analyst\n\n### This workflow automates the analysis of Meta (Facebook) ads. It scrapes ads from a provided list of Facebook Ad Library URLs, uses Gemini AI to perform an in-depth analysis of each ad creative and text, and then stores the structured results in a Google Sheet.\n\n### How it works\n1. **Trigger & Fetch URLs:** The workflow starts on a schedule (e.g., daily) and fetches a list of Facebook Ad Library URLs from a Google Sheet.\n2. **Scrape Ads:** It uses the ScrapingFlash API to scrape the ads found at each URL.\n3. **Process Ads:** The workflow splits the scraped data into individual ads and loops through them (limited to 10 per run in this template to manage costs).\n4. **AI Analysis with Gemini:** For each ad, it sends the image and text to Google's Gemini AI model. A detailed prompt guides the AI to act as an expert analyst, evaluating strengths, weaknesses, and suggesting improvements.\n5. **Structured Output:** A Structured Output Parser ensures the AI's response is in a clean, consistent JSON format.\n6. **Save to Google Sheets:** The final, structured analysis for each ad is appended as a new row in a designated Google Sheet.\n\n### How to use\n1. **Set up Credentials:**\n * **ScrapingFlash:** Create a Header Auth credential for ScrapingFlash. Set the `Name` to `x-api-key` and the `Value` to your actual API key.\n * **Google Gemini:** Add your Google Gemini API key credential.\n * **Google Sheets:** Authenticate your Google account for the Sheets nodes.\n2. **Configure Google Sheets:**\n * In the \"Get URL to scrap\" node, select your Sheet and specify the column with the Facebook Ad Library URLs.\n * In the \"Add row in Sheet\" node, select the Sheet and worksheet where you want to save the analysis. Map the columns to the output from the Gemini node.\n3. **Activate Workflow:** Enable the workflow. It will run automatically based on the schedule set in the \"Schedule Trigger\" node. You can also run it manually using the \"When clicking ‘Execute workflow’\" button for testing.\n\n### Requirements\n* A ScrapingFlash account and API key.\n* A Google account with access to the Gemini API.\n* A Google account for Google Sheets.\n\n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!\n\nHappy Hacking!"
},
"typeVersion": 1
},
{
"id": "501e6350-a65e-4e61-a9ca-0ec2efcb9c8b",
"name": "Al hacer clic en 'Ejecutar flujo de trabajo'",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-848,
-1920
],
"parameters": {},
"typeVersion": 1
},
{
"id": "6b82376a-d57a-4be2-9354-6f891f474238",
"name": "Activador Programado",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-848,
-2128
],
"parameters": {
"rule": {
"interval": [
{}
]
}
},
"typeVersion": 1.2
},
{
"id": "38c384ad-f9ad-4ccd-8a20-3ceefc8eec82",
"name": "Nota Adhesiva",
"type": "n8n-nodes-base.stickyNote",
"position": [
-848,
-2400
],
"parameters": {
"color": 7,
"width": 316,
"height": 240,
"content": "## 1. Trigger & Get URLs\n\nThis workflow can be triggered manually or on a schedule.\n\nThe Google Sheets node fetches a list of Facebook Ad Library URLs that you want to analyze. Make sure your sheet has a column with these URLs."
},
"typeVersion": 1
},
{
"id": "54543b50-a2cb-44c7-8152-4be093167276",
"name": "Obtener URL para raspar",
"type": "n8n-nodes-base.googleSheets",
"position": [
-560,
-2032
],
"parameters": {
"sheetName": {
"__rl": true,
"mode": "list",
"value": ""
},
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"typeVersion": 4.6
},
{
"id": "2edfce52-e8c7-41a3-ae21-8516cf7e8957",
"name": "Solicitud a scrapingflash.com",
"type": "n8n-nodes-base.httpRequest",
"position": [
-288,
-2032
],
"parameters": {
"url": "https://api.scrapingflash.com/v1/facebook_ads",
"method": "POST",
"options": {},
"authentication": "predefinedCredentialType",
"nodeCredentialType": "headerAuth"
},
"typeVersion": 4.2
},
{
"id": "c70a0c61-d6f6-44e1-9ab2-da906b67a9c7",
"name": "Nota Adhesiva1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-400,
-2400
],
"parameters": {
"color": 7,
"width": 332,
"height": 224,
"content": "## 2. Scrape Meta Ads\n\nThe HTTP Request node calls the ScrapingFlash API to scrape the ads from the URL provided by the previous step.\n\n**Important:** You must create a \"Header Auth\" credential and add your ScrapingFlash API key there."
},
"typeVersion": 1
},
{
"id": "b020da3e-8f9a-4af0-8f2e-0986725bbd45",
"name": "Dividir todos los anuncios",
"type": "n8n-nodes-base.splitOut",
"position": [
-48,
-2032
],
"parameters": {
"options": {},
"fieldToSplitOut": "body.ads"
},
"typeVersion": 1
},
{
"id": "0765638f-61e9-40d3-b1a1-dd5b261566b6",
"name": "Iterar sobre elementos",
"type": "n8n-nodes-base.splitInBatches",
"position": [
160,
-2032
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "d42b014e-63cc-41d8-8741-b7b028e74d02",
"name": "Nota Adhesiva2",
"type": "n8n-nodes-base.stickyNote",
"position": [
64,
-2400
],
"parameters": {
"color": 7,
"width": 444,
"height": 224,
"content": "## 3. Process & Loop Through Ads\n\n- **Split all the ads:** This node takes the list of ads from the scraper and creates a separate item for each one.\n- **Loop Over Items:** This utility node processes each ad one by one.\n- **Limit:** To control costs and execution time, this node limits the workflow to analyzing only the first 10 ads per run. You can adjust or remove this."
},
"typeVersion": 1
},
{
"id": "9e197a15-e01f-479a-a149-76887d4f2fcc",
"name": "Limitarar a 10 anuncios",
"type": "n8n-nodes-base.limit",
"position": [
368,
-2032
],
"parameters": {},
"typeVersion": 1
},
{
"id": "cbf96cba-eccb-4e5a-ba88-f8a6dd9a6fd7",
"name": "Categorizar cada anuncio de Meta",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
608,
-2032
],
"parameters": {
"text": "Analyse this D2C newsletter",
"messages": {
"messageValues": [
{
"message": "=You are a highly skilled Meta Ads Analyst, possessing a deep understanding of advertising principles, consumer psychology, and Meta's advertising platform. Your expertise lies in evaluating ad creatives (images and text) to predict their performance and provide actionable insights. Your analysis will culminate in a score (out of 5) and a concise TL;DR summarizing the ad's strengths and weaknesses.\n\nHere's the format you will use to analyze the provided Meta ad and deliver your assessment:\n\n---\n\n## Meta Ad Analysis\n\n**Ad Image:**\n**Ad Text:** \n\n\n**Analysis:**\n\n* **Strengths:** [Identify at least three strengths of the ad, explaining why they are effective. Consider elements like visual appeal, clarity of message, value proposition, call to action, and relevance to the target audience.]\n* **Weaknesses:** [Identify at least three weaknesses of the ad, explaining why they might hinder performance. Consider elements like confusing messaging, lack of visual appeal, weak call to action, irrelevance to the target audience, and potential for misinterpretation.]\n* **Potential Improvements:** [Suggest specific, actionable improvements to address the identified weaknesses. Be practical and consider the limitations of the Meta Ads platform.]\n\n**Scoring:**\n\n* **Overall Score (out of 5):** [Provide a score between 1 and 5, with 5 being an exceptionally strong ad and 1 being a very weak ad.]\n* **Justification:** [Briefly explain the reasoning behind your score, highlighting the key factors that influenced your assessment.]\n\n**TL;DR:** [Provide a concise summary (one or two sentences) of the ad's overall effectiveness and key areas for improvement.]\n\n---\n\nHere is the Meta Ad you are tasked with analyzing: [ENTER META AD IMAGE DESCRIPTION AND TEXT HERE]"
},
{
"type": "HumanMessagePromptTemplate",
"imageUrl": "=",
"messageType": "imageUrl"
}
]
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.4
},
{
"id": "ac7d5925-9115-4fbf-8108-0c8a1c17a9fb",
"name": "Nota Adhesiva3",
"type": "n8n-nodes-base.stickyNote",
"position": [
592,
-2400
],
"parameters": {
"color": 7,
"width": 348,
"height": 224,
"content": "## 4. Analyze Ad with Gemini AI\n\nThis is the core of the workflow. The LangChain chain sends the ad image and text to Google's Gemini model.\n\nA detailed prompt instructs the AI on how to perform the analysis, and a Structured Output Parser ensures the response is in a usable JSON format."
},
"typeVersion": 1
},
{
"id": "303cc507-4916-4340-a824-85ca0a90b9af",
"name": "Modelo de Chat Google Gemini",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
608,
-1792
],
"parameters": {
"options": {},
"modelName": "models/gemini-pro-vision"
},
"typeVersion": 1
},
{
"id": "23e184a4-81a9-49bf-9d62-618e8c2febc5",
"name": "Analizador de Salida Estructurada",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
864,
-1792
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"ad_image\": {\n \"type\": \"string\",\n \"description\": \"Description of the ad image.\"\n },\n \"ad_text\": {\n \"type\": \"string\",\n \"description\": \"Text used in the Meta ad.\"\n },\n \"analysis\": {\n \"type\": \"object\",\n \"properties\": {\n \"strengths\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"List of at least 3 strengths with explanations.\"\n },\n \"weaknesses\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"List of at least 3 weaknesses with explanations.\"\n },\n \"potential_improvements\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" },\n \"description\": \"Specific, actionable improvement suggestions.\"\n }\n },\n \"required\": [\"strengths\", \"weaknesses\", \"potential_improvements\"]\n },\n \"scoring\": {\n \"type\": \"object\",\n \"properties\": {\n \"overall_score\": {\n \"type\": \"number\",\n \"minimum\": 1,\n \"maximum\": 5,\n \"description\": \"Overall score from 1 to 5.\"\n },\n \"justification\": {\n \"type\": \"string\",\n \"description\": \"Reasoning behind the given score.\"\n }\n },\n \"required\": [\"overall_score\", \"justification\"]\n },\n \"tldr\": {\n \"type\": \"string\",\n \"description\": \"One or two sentence summary of effectiveness and key improvements.\"\n }\n },\n \"required\": [\"ad_image\", \"ad_text\", \"analysis\", \"scoring\", \"tldr\"]\n}\n"
},
"typeVersion": 1.2
},
{
"id": "08482067-31af-4586-a89e-48f493149b21",
"name": "Agregar fila en Hoja",
"type": "n8n-nodes-base.googleSheets",
"position": [
1152,
-2032
],
"parameters": {
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": ""
},
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"typeVersion": 4.6
},
{
"id": "4304793b-6545-4cd8-b35f-9143090a4897",
"name": "Nota Adhesiva4",
"type": "n8n-nodes-base.stickyNote",
"position": [
992,
-2400
],
"parameters": {
"color": 7,
"width": 412,
"height": 224,
"content": "## 5. Save Analysis to Google Sheets\n\nThe final step takes the structured output from the Gemini AI analysis and appends it as a new row to your Google Sheet.\n\nYou'll need to configure this node to point to your desired sheet and map the data from the AI node to the correct columns."
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"Limitar a 10 anuncios": {
"main": [
[
{
"node": "cbf96cba-eccb-4e5a-ba88-f8a6dd9a6fd7",
"type": "main",
"index": 0
}
]
]
},
"0765638f-61e9-40d3-b1a1-dd5b261566b6": {
"main": [
[
{
"node": "Limitar a 10 anuncios",
"type": "main",
"index": 0
}
]
]
},
"54543b50-a2cb-44c7-8152-4be093167276": {
"main": [
[
{
"node": "2edfce52-e8c7-41a3-ae21-8516cf7e8957",
"type": "main",
"index": 0
}
]
]
},
"6b82376a-d57a-4be2-9354-6f891f474238": {
"main": [
[
{
"node": "54543b50-a2cb-44c7-8152-4be093167276",
"type": "main",
"index": 0
}
]
]
},
"b020da3e-8f9a-4af0-8f2e-0986725bbd45": {
"main": [
[
{
"node": "0765638f-61e9-40d3-b1a1-dd5b261566b6",
"type": "main",
"index": 0
}
]
]
},
"303cc507-4916-4340-a824-85ca0a90b9af": {
"ai_languageModel": [
[
{
"node": "cbf96cba-eccb-4e5a-ba88-f8a6dd9a6fd7",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"23e184a4-81a9-49bf-9d62-618e8c2febc5": {
"ai_outputParser": [
[
{
"node": "cbf96cba-eccb-4e5a-ba88-f8a6dd9a6fd7",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"cbf96cba-eccb-4e5a-ba88-f8a6dd9a6fd7": {
"main": [
[
{
"node": "08482067-31af-4586-a89e-48f493149b21",
"type": "main",
"index": 0
}
]
]
},
"2edfce52-e8c7-41a3-ae21-8516cf7e8957": {
"main": [
[
{
"node": "b020da3e-8f9a-4af0-8f2e-0986725bbd45",
"type": "main",
"index": 0
}
]
]
},
"501e6350-a65e-4e61-a9ca-0ec2efcb9c8b": {
"main": [
[
{
"node": "54543b50-a2cb-44c7-8152-4be093167276",
"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?
Avanzado - 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
Paul-François GORIAUX
@pfgopeCompartir este flujo de trabajo