Recap AI - Sistema de clonación de anuncios de Facebook
Este es unContent Creation, Multimodal AIflujo de automatización del dominio deautomatización que contiene 18 nodos.Utiliza principalmente nodos como If, Set, Merge, Aggregate, FormTrigger. Clonación y personalización de anuncios de Facebook de la competencia con Gemini AI y Apify
- •Credenciales de API de Google Drive
- •Pueden requerirse credenciales de autenticación para la API de destino
Nodos utilizados (18)
Categoría
{
"id": "qvBUGGr9hb1LlVuX",
"meta": {
"instanceId": "06e5009344f682419c20ccd4ecdcb5223bbb91761882af93ac6d468dbc2cbf8d",
"templateCredsSetupCompleted": true
},
"name": "The Recap AI - Facebook Ad Cloning System",
"tags": [],
"nodes": [
{
"id": "02aa1570-98cc-4e51-8984-7078b67f8e69",
"name": "form_trigger",
"type": "n8n-nodes-base.formTrigger",
"position": [
224,
224
],
"webhookId": "739f6e4b-c69f-4baf-b6fe-f671f8ba6279",
"parameters": {
"options": {},
"formTitle": "Facebook Ad Thief Form",
"formFields": {
"values": [
{
"fieldLabel": "Facebook Ad Library Url",
"placeholder": "https://www.facebook.com/",
"requiredField": true
},
{
"fieldType": "file",
"fieldLabel": "Your Product Image",
"multipleFiles": false,
"requiredField": true
}
]
},
"formDescription": "Upload your product image and submit a facebook ad library url for the ads you want to clone/spin for your produc.t"
},
"typeVersion": 2.2
},
{
"id": "3b44e844-211b-435e-b559-b86f50c969bc",
"name": "iterate_ads",
"type": "n8n-nodes-base.splitInBatches",
"position": [
224,
448
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "a647a369-8233-4bf1-9fb4-12d40376672c",
"name": "download_image",
"type": "n8n-nodes-base.httpRequest",
"position": [
864,
464
],
"parameters": {
"url": "={{ $node['iterate_ads'].json.snapshot.cards.first().original_image_url }}",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "01df58ea-a0b6-4282-ae66-681bc2dd3ace",
"name": "convert_ad_image_to_base64",
"type": "n8n-nodes-base.extractFromFile",
"position": [
1152,
464
],
"parameters": {
"options": {},
"operation": "binaryToPropery"
},
"typeVersion": 1
},
{
"id": "508fdd2d-1d9e-437b-83ea-a234eb755195",
"name": "upload_ad_reference",
"type": "n8n-nodes-base.googleDrive",
"position": [
1152,
288
],
"parameters": {
"name": "={{ $node['iterate_ads'].json.snapshot.cards.first().title }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "id",
"value": "1HoXBHX3gvz5TxhczPwI0d5gWI3mxJT7h"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "PgwI1k1VFnoEhOi6",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "6145dd1e-1b1e-4acf-b41c-acdcbcc938d6",
"name": "merge",
"type": "n8n-nodes-base.merge",
"position": [
1424,
448
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "a01db21f-c4b1-481b-a55b-31ede9b7814d",
"name": "aggregate",
"type": "n8n-nodes-base.aggregate",
"position": [
224,
704
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{}
]
}
},
"typeVersion": 1
},
{
"id": "3b1c6a2e-eca8-494d-837a-3d09cc482c3d",
"name": "get_image",
"type": "n8n-nodes-base.convertToFile",
"position": [
1424,
720
],
"parameters": {
"options": {},
"operation": "toBinary",
"sourceProperty": "image_result"
},
"typeVersion": 1.1
},
{
"id": "2805dfd1-dce7-4d5d-86c9-dc3b925e9249",
"name": "upload_image",
"type": "n8n-nodes-base.googleDrive",
"position": [
1712,
784
],
"parameters": {
"name": "=Cloned Ad #{{ $runIndex + 1 }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive",
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
"cachedResultName": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "url",
"value": "https://drive.google.com/drive/u/0/folders/1qY588PqswUfGTl3dZ_FbZhiDwK0Kv2Mz"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "PgwI1k1VFnoEhOi6",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "2e6a04de-1329-41bb-967a-73aade05fef8",
"name": "set_result",
"type": "n8n-nodes-base.set",
"position": [
1152,
720
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "524da01b-f8b9-4c2c-9e28-319455903e4d",
"name": "=image_result",
"type": "string",
"value": "={{ $json.candidates[0].content.parts.filter(item => item.inlineData).first().inlineData.data }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "23c1e641-04d7-4540-8336-77b24c29007d",
"name": "check_if_prohibited",
"type": "n8n-nodes-base.if",
"position": [
864,
704
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "f46e65cf-d695-4e2e-a64c-be500cd788dd",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.candidates.first().finishReason }}",
"rightValue": "PROHIBITED_CONTENT"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "d09e9817-e30f-4239-b105-e394e0b60d40",
"name": "convert_product_image_to_base64",
"type": "n8n-nodes-base.extractFromFile",
"position": [
528,
224
],
"parameters": {
"options": {},
"operation": "binaryToPropery",
"binaryPropertyName": "Your_Product_Image"
},
"typeVersion": 1
},
{
"id": "f9af4c0e-e2d9-479a-a360-703407c0eba3",
"name": "generate_ad_image_prompt",
"type": "n8n-nodes-base.httpRequest",
"position": [
528,
704
],
"parameters": {
"url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent",
"method": "POST",
"options": {},
"jsonBody": "={\n \"contents\": [{\n \"parts\": [\n { \"text\": {{ JSON.stringify($json.prompt) }} },\n {\n \"inline_data\": {\n \"mime_type\": \"image/png\",\n \"data\": \"{{ $node['convert_product_image_to_base64'].json.data }}\"\n }\n },\n {\n \"inline_data\": {\n \"mime_type\": \"image/jpeg\",\n \"data\": \"{{ $node['convert_ad_image_to_base64'].json.data }}\"\n }\n }\n ]\n }]\n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth"
},
"credentials": {
"httpHeaderAuth": {
"id": "abcMckGk9RG9i0Ba",
"name": "Google Gemini"
}
},
"retryOnFail": true,
"typeVersion": 4.2,
"waitBetweenTries": 5000
},
{
"id": "43ae4270-b8d8-4d1d-9e30-024f5b0c1a17",
"name": "generate_ad_image",
"type": "n8n-nodes-base.httpRequest",
"position": [
704,
704
],
"parameters": {
"url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image-preview:generateContent",
"method": "POST",
"options": {},
"jsonBody": "={\n \"contents\": [{\n \"parts\": [\n { \"text\": {{ JSON.stringify($json.candidates.first().content.parts.first().text) }} },\n {\n \"inline_data\": {\n \"mime_type\": \"image/png\",\n \"data\": \"{{ $node['convert_product_image_to_base64'].json.data }}\"\n }\n },\n {\n \"inline_data\": {\n \"mime_type\": \"image/jpeg\",\n \"data\": \"{{ $node['convert_ad_image_to_base64'].json.data }}\"\n }\n }\n ]\n }]\n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth"
},
"credentials": {
"httpHeaderAuth": {
"id": "abcMckGk9RG9i0Ba",
"name": "Google Gemini"
}
},
"retryOnFail": true,
"typeVersion": 4.2,
"waitBetweenTries": 5000
},
{
"id": "47fa9f9a-6699-4944-9ad0-531ad34b4ead",
"name": "build_prompt",
"type": "n8n-nodes-base.set",
"position": [
368,
704
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "2fcf84d7-4a17-4899-9bea-a7d3b6027acd",
"name": "prompt",
"type": "string",
"value": "You are an expert in image I need your help to write a perfect prompt that is going to help me generate/edit an image for my company's product called Thrive Mix. Attached to this request are two images: 1. Product picture of Thrive Mix (our product) 2. Reference image of the competitor's ad we're trying to replicate In your analysis of these images, I want you to come up with a plan and write a very detailed prompt on how we can clone and spin the ad from image number two (our competitor AG1) to make an identical ad that features our product with our packaging (ThriveMix) and image number one. We need to replicate the same style used on the AG1 competitor ad, but it should always be our packaging that's included. Some tricky edge cases you need to handle are: Partial branding items of the AG1 text (there can be text that says AG1, labels on products that say AG1, multiple products, multiple packages that are different from ours). Please check for all placements in the AG1 ad that need to be replaced. You need to figure out how to write a specific prompt that is going to detail this image generator how to replace it and create the ad for our product. The end result we're going for is a new ad that promotes our product ThriveMix. Make sure your prompt includes changes that need to be changed on the text of the image like labels and calls to action. It's possible that the source ad image for our competitor AG1 will have partial text on the product or packaging like \"A\", \"AG\", \"G, \"G\" (standalone), \"G1\", or some other partial text that needs to be checked for and analyzed in your plan. Keep the ad copy the same EXCEPT for switching \"AG1\" to \"ThriveMix\" to Think deeply about the prompt you are going to write."
}
]
}
},
"typeVersion": 3.4
},
{
"id": "1086bf1c-2495-45a2-93cf-2cefd2e51735",
"name": "scrape_ads",
"type": "@apify/n8n-nodes-apify.apify",
"position": [
864,
224
],
"parameters": {
"memory": 512,
"actorId": {
"__rl": true,
"mode": "list",
"value": "XtaWFhbtfxyzqrFmd",
"cachedResultUrl": "https://console.apify.com/actors/XtaWFhbtfxyzqrFmd/input",
"cachedResultName": "Facebook Ad Library Scraper (curious_coder/facebook-ads-library-scraper)"
},
"operation": "Run actor and get dataset",
"customBody": "={\n \"limitPerSource\": 20,\n \"scrapeAdDetails\": false,\n \"scrapePageAds.activeStatus\": \"all\",\n \"scrapePageAds.countryCode\": \"ALL\",\n \"urls\": [\n {\n \"url\": \"{{ $('form_trigger').item.json['Facebook Ad Library Url'] }}\",\n \"method\": \"GET\"\n }\n ]\n}",
"actorSource": "store",
"authentication": "apifyOAuth2Api"
},
"credentials": {
"apifyOAuth2Api": {
"id": "H654WxAlFsyNy0MJ",
"name": "Apify"
}
},
"typeVersion": 1
},
{
"id": "1041b268-c792-4c66-b4b4-18bc477fe4d5",
"name": "Nota adhesiva",
"type": "n8n-nodes-base.stickyNote",
"position": [
144,
96
],
"parameters": {
"color": 4,
"width": 1792,
"height": 960,
"content": "## Nano Banana Facebook Ad Cloning System"
},
"typeVersion": 1
},
{
"id": "24fb842b-4b2d-4c4b-85e3-67a9c2932e6a",
"name": "Nota adhesiva1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-480,
96
],
"parameters": {
"width": 608,
"height": 960,
"content": "## Setup & Overview\n\nThis n8n template demonstrates how to automatically clone and adapt competitor Facebook ads for your own product using AI. Simply provide a Facebook Ad Library URL and your product image, and the workflow scrapes competitor ads, analyzes their design and messaging, then generates new versions featuring your product while maintaining the original ad's style and effectiveness.\n\n## Use cases\n* Adapt successful competitor ad creatives for your own products\n* Test proven ad formats without starting from scratch\n* Quickly produce multiple ad variations based on high-performing competitors\n* Scale ad creative production by leveraging competitor insights\n* A/B test different visual approaches inspired by market leaders\n\n## Good to know\n* The workflow processes up to 20 ads from the provided Facebook Ad Library URL\n* Gemini's image generation may occasionally flag content as prohibited (workflow handles this automatically)\n* Generated ads maintain the original style while swapping product branding and packaging\n* All competitor reference ads and generated clones are automatically saved to Google Drive\n* Image generation takes approximately 10-30 seconds per ad\n\n## How it works\n1. **Form Submission**: User submits a Facebook Ad Library URL and uploads their product image\n2. **Product Processing**: The product image is converted to base64 for AI processing\n3. **Ad Scraping**: Apify's Facebook Ad Library Scraper extracts up to 20 ads from the provided URL\n4. **Iteration Setup**: The workflow processes each scraped ad individually\n5. **Image Download**: Each competitor ad image is downloaded and converted to base64\n6. **Reference Storage**: Original competitor ads are uploaded to Google Drive for reference\n7. **Prompt Generation**: Gemini 2.5 Pro analyzes both images and creates detailed instructions for cloning the ad while replacing competitor branding with your product\n8. **Ad Generation**: Gemini 2.5 Flash Image Preview generates the new ad image based on the instructions\n9. **Content Filter**: Checks if generation was blocked for prohibited content\n10. **Upload & Loop**: Successfully generated ads are uploaded to Google Drive, then the workflow moves to the next ad\n\n## How to use\n1. Click the form trigger URL to access the submission form\n2. Enter a Facebook Ad Library URL (e.g., from a competitor's page showing active ads)\n3. Upload your product image with clear branding and packaging\n4. Submit the form and wait for processing to complete\n5. Find your cloned ads and reference images organized in Google Drive folders\n6. Review generated ads and select the best performers for your campaigns\n\n## Requirements\n* **Apify** account for Facebook Ad Library scraping\n* **Google Gemini API** account for ad analysis and image generation\n* **Google Drive** account for storing reference ads and generated clones\n* Valid Facebook Ad Library URL with accessible ads\n\n## Customizing this workflow\n* Adjust the **number of ads scraped** in the scrape_ads node (currently set to 20 per source)\n* Modify the **prompt instructions** in build_prompt node to emphasize different aspects (e.g., color schemes, layouts, text placement)\n* Change the **Google Drive folders** in upload_ad_reference and upload_image nodes to organize by campaign or product line\n* Add **text overlay generation** to include custom headlines or CTAs on generated images\n* Implement **quality scoring** to automatically filter and rank generated ad variations\n* Add **Slack/email notifications** when ad generation completes or fails\n* Include **metadata extraction** to capture ad copy and targeting insights from scraped adsRetryClaude does not have the ability to run the code it generates yet."
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "5e3b14f9-6688-444c-b973-43aaf9342aae",
"connections": {
"6145dd1e-1b1e-4acf-b41c-acdcbcc938d6": {
"main": [
[
{
"node": "a01db21f-c4b1-481b-a55b-31ede9b7814d",
"type": "main",
"index": 0
}
]
]
},
"a01db21f-c4b1-481b-a55b-31ede9b7814d": {
"main": [
[
{
"node": "47fa9f9a-6699-4944-9ad0-531ad34b4ead",
"type": "main",
"index": 0
}
]
]
},
"3b1c6a2e-eca8-494d-837a-3d09cc482c3d": {
"main": [
[
{
"node": "2805dfd1-dce7-4d5d-86c9-dc3b925e9249",
"type": "main",
"index": 0
}
]
]
},
"1086bf1c-2495-45a2-93cf-2cefd2e51735": {
"main": [
[
{
"node": "3b44e844-211b-435e-b559-b86f50c969bc",
"type": "main",
"index": 0
}
]
]
},
"2e6a04de-1329-41bb-967a-73aade05fef8": {
"main": [
[
{
"node": "3b1c6a2e-eca8-494d-837a-3d09cc482c3d",
"type": "main",
"index": 0
}
]
]
},
"3b44e844-211b-435e-b559-b86f50c969bc": {
"main": [
[],
[
{
"node": "a647a369-8233-4bf1-9fb4-12d40376672c",
"type": "main",
"index": 0
}
]
]
},
"47fa9f9a-6699-4944-9ad0-531ad34b4ead": {
"main": [
[
{
"node": "f9af4c0e-e2d9-479a-a360-703407c0eba3",
"type": "main",
"index": 0
}
]
]
},
"02aa1570-98cc-4e51-8984-7078b67f8e69": {
"main": [
[
{
"node": "d09e9817-e30f-4239-b105-e394e0b60d40",
"type": "main",
"index": 0
}
]
]
},
"2805dfd1-dce7-4d5d-86c9-dc3b925e9249": {
"main": [
[
{
"node": "3b44e844-211b-435e-b559-b86f50c969bc",
"type": "main",
"index": 0
}
]
]
},
"a647a369-8233-4bf1-9fb4-12d40376672c": {
"main": [
[
{
"node": "508fdd2d-1d9e-437b-83ea-a234eb755195",
"type": "main",
"index": 0
},
{
"node": "01df58ea-a0b6-4282-ae66-681bc2dd3ace",
"type": "main",
"index": 0
}
]
]
},
"43ae4270-b8d8-4d1d-9e30-024f5b0c1a17": {
"main": [
[
{
"node": "23c1e641-04d7-4540-8336-77b24c29007d",
"type": "main",
"index": 0
}
]
]
},
"23c1e641-04d7-4540-8336-77b24c29007d": {
"main": [
[
{
"node": "3b44e844-211b-435e-b559-b86f50c969bc",
"type": "main",
"index": 0
}
],
[
{
"node": "2e6a04de-1329-41bb-967a-73aade05fef8",
"type": "main",
"index": 0
}
]
]
},
"508fdd2d-1d9e-437b-83ea-a234eb755195": {
"main": [
[
{
"node": "6145dd1e-1b1e-4acf-b41c-acdcbcc938d6",
"type": "main",
"index": 0
}
]
]
},
"f9af4c0e-e2d9-479a-a360-703407c0eba3": {
"main": [
[
{
"node": "43ae4270-b8d8-4d1d-9e30-024f5b0c1a17",
"type": "main",
"index": 0
}
]
]
},
"01df58ea-a0b6-4282-ae66-681bc2dd3ace": {
"main": [
[
{
"node": "6145dd1e-1b1e-4acf-b41c-acdcbcc938d6",
"type": "main",
"index": 1
}
]
]
},
"d09e9817-e30f-4239-b105-e394e0b60d40": {
"main": [
[
{
"node": "1086bf1c-2495-45a2-93cf-2cefd2e51735",
"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 - Creación de contenido, 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
Lucas Walter
@lucaswalterChief Automation Officer at The Recap AI. I build the AI systems and agents that power our business and teach others how to use n8n. Check out our YouTube channel linked below!
Compartir este flujo de trabajo