Huashu Design
alchaincyf · Skill
Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…
An n8n workflow that studies the Facebook ads for a search word and country. Apify scrapes the Ad Library, Gemini and OpenAI describe each video, image and text ad, and GPT-4.1 writes a summary and new ad ideas into Google Sheets.
Facebook Ad Library spy with AI ad ideas is an n8n workflow in the Marketing & SEO category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.
Ad search form
It starts when someone sends the Details form with:
Rows in Google Sheets with each ad’s type, a summary, its Ad Library link and new ad ideas for your product
What you need before you start.
Ad scraping
Runs an actor through one HTTP Request node and returns the active ads for the word and country, with their details.
NeedsApify API token
Language and image models
Runs GPT-4o to describe each image ad and GPT-4.1 to summarize every ad and write its ideas.
NeedsOpenAI API key
Video analysis
Takes each uploaded video through its Files API and describes it in detail with the Flash model named in Video Analyse2.
NeedsGemini API key, in three request nodes
File storage
Keeps each video ad and supplies the file size that the Gemini upload needs, then hands the file back.
NeedsGoogle account with Drive access, and a folder
Spreadsheet
Adds a row per ad with its type, summary, Ad Library link and ideas.
NeedsGoogle account with Sheets access, and a sheet with four columns
Checked by Mindket on 13 Nov 2026
This n8n workflow reads the Facebook ads your rivals run and writes new ad ideas from them. You send a form with a search word, a country and a few lines about your product. Apify scrapes the matching active ads from the Facebook Ad Library, and a filter keeps those from pages that have likes. The ads then split by type. Video ads are saved to Google Drive and described by Gemini, image ads are described by GPT-4o, and text ads go straight on. GPT-4.1 writes a summary of each ad and up to five fresh ideas for your product, and each ad gets a row in Google Sheets. The three loop nodes come with Execute Once switched on, so until you turn it off a run reads only the first ad of each type.
Media buyers, small advertisers and agencies that study what rivals run before they plan their own creative. It suits someone happy to read a long sheet, since with the loops running in full one search can fill 200 rows. Skip it for a quick look at one rival: an Apify token, a Gemini key and two Google credentials take longer to set up than a search in the Ad Library does.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Online retail | Store owners | Search the product word and read the ideas beside each rival ad | A shop that sells backpacks searches backpack and sees which ad styles keep repeating. |
| Performance marketing | Media buyers | Run the same search each week and compare the rows | A buyer runs one search every Monday and sorts the sheet by Type. |
| Agencies | Creative strategists | Send a client’s niche through the form before a pitch | A strategist brings a sheet of rival summaries and ideas to a pitch. |
| Software and apps | Product marketers | Describe the product in the form so the ideas fit it | An app team describes its product and gets ideas written for it, not for the rival. |
| Courses and coaching | Course creators | Search a topic in one country to see how others pitch it | A course creator looks at how rival courses are pitched in Canada. |
Any n8n that can reach Apify, Google and OpenAI will run it. The form is the front door, so you share its address with whoever does the searching.
Collect data node to send each row onGet it saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. Its author puts setup at about 21 minutes.
| Need | Detail |
|---|---|
| n8n | On n8n Cloud or on a server of your own |
| Apify | An account and its API token |
| Gemini | An API key from Google AI Studio |
| OpenAI | An API key that can use GPT-4.1 and GPT-4o |
| An account for Drive and Sheets credentials | |
| A spreadsheet | A tab named Sheet1 with Type, summary, ad_url and ad_Ideas in row 1 |
| A Drive folder | Where the video ads are kept |
workflow.json./d/ and /edit. Add a Google Sheets OAuth2 credential. In Collect data, Collect data1 and Collect data2, select it and replace YOUR_SHEET_ID with the ID.Upload video and Download Video1. In Upload video, replace YOUR_FOLDER_ID with your folder’s ID.Video Analyse, Video Analyse1 and Video Analyse2, replace <YOUR_GEMINI_API_KEY> in the key query field with your Gemini key. The brackets go too.Video Analyse2, change gemini-2.0-flash to a current model such as gemini-3.6-flash.Ads Scraping, replace <YOUR_APIFY_TOKEN> in the Authorization header with your token, so the header reads Bearer, a space and the token.Analyze Image1, Video Ad Ideas, Image Ad Ideas and Text Ad Ideas.Open the form from On form submission and fill in all three fields. query is the word to search for, Country is the country and About Your Product is a few lines on what you sell. The form confirms at once. The run goes on behind it. As the file comes, a run adds up to three rows, one each for the first video, image and text ad. Once the loops run in full, rows keep arriving as each ad is finished.
| To change | Where |
|---|---|
| How many ads | count in the body of Ads Scraping, set to 200 |
| How far back | period, set to last7d, and the fixed start_date[min] in the address inside that body |
| Which pages | The likes condition in Filter Ads, which keeps pages with more than zero |
| The ideas | The prompt in the three Ad Ideas nodes, which asks for at most 5 ideas in a set style |
| Every ad, not one of each | Execute Once in the settings of Video Ads, Image Ads and Text Ads, switched on in the file |
| Columns | The mapping in the three Google Sheets nodes |
A form entry from a shop that sells bike gear:
query: backpack Country: US About Your Product: Waterproof commuter backpacks for cyclists
Apify returns the active ads that match. For each one, the idea node answers in this shape, with every idea in one cell of the sheet:
{
"summary": "…",
"adIdeas": "1. <title>: <concept>\n Execution: <execution>\n\n2. …"
}The row for a video ad holds the type Video, that summary, the ad’s Ad Library link and the ideas.
If you are new. n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. A credential is a key n8n keeps for you and hands to the node you pick it in. Several keys here sit in node fields instead, which is why the setup lists each node by name. Test with a small count first. Each node then shows what it received and sent, which is where a wrong key or a missing column turns up.
For experts. Three ad types take three routes, and three models share the reading.
| Step | Model | What to know |
|---|---|---|
Video Analyse2 | gemini-2.0-flash in the file. Google’s deprecations page, read on 2 November 2026, lists it as shut down on 1 June 2026 | Reads the video that Video Analyse and Video Analyse1 uploaded, through the Gemini API directly, and retries when the call fails |
Analyze Image1 | gpt-4o | Describes each image ad in detail |
Video Ad Ideas, Image Ad Ideas, Text Ad Ideas | gpt-4.1, temperature 0.7 | One prompt in all three. The ad’s scraped data goes in as JSON, plus the video or image description |
The Drive round trip for a video supplies the file size that Gemini’s upload asks for. Upload video gives the size, Video Analyse opens a resumable upload with it, Download Video1 fetches the file back and Video Analyse1 sends the bytes. Each route is a Loop Over Items node that takes one ad, writes its row and comes back after a one-second Wait. With Execute Once on, that node lets in only the first ad, so its second pass ends the loop.
A big search costs real money, and a few details of the file need a test with your own searches.
count before you let the loops run in fullcountry= in the Ad Library address, and its example is a name. The Library’s own addresses use a two-letter code such as US there, so try the code if a search finds nothingstart_date[min]=2025-06-12, so older ads may be left outSwitch1 checks the second card for a video address and the first card for an image address, and Download Video reads the first card. Try a few real ads before you trust the splitExample File and none is deletedAn n8n workflow. Send its form a search word, a country and a few lines about your product. It scrapes the matching
ads from the Facebook Ad Library, has AI describe each video, image and text ad, and writes a summary and new ad ideas
for each ad it reads into Google Sheets.
workflow.json: the workflow as n8n exports it, 30 nodes, four of them sticky notes. It holds no credential. TheREADME.md: these notes.Sheet1 and these column names in row 1: Type, summary, ad_url and ad_Ideas.workflow.json./d/ and /edit. Add a Google Sheets OAuth2Collect data, Collect data1 and Collect data2, select it and replace YOUR_SHEET_ID with the ID.Sheet1.Upload video and Download Video1. In Upload video, replace YOUR_FOLDER_ID with the folder's ID.Video Analyse, Video Analyse1 and Video Analyse2, replace <YOUR_GEMINI_API_KEY> in the key query fieldVideo Analyse2, also change gemini-2.0-flash to agemini-3.6-flash. Google's deprecations page, read on 2 November 2026, lists 2.0 Flash asAds Scraping, replace <YOUR_APIFY_TOKEN> in the Authorization header with your token. The header then readsAnalyze Image1, Video Ad Ideas, Image Ad Ideas and Text Ad Ideas.On form submission asks for query, Country and About Your Product. Code turns the search word intoAds Scraping asks an Apify actor for the active ads that match, up to 200 of them.Filter Ads keeps the ads whose advertiser page has more than zero likes. Switch1 sends each one down the Video,Video Ads, Image Ads or Text Ads, which hands on one ad at a time. As theExample File, uploaded to Gemini through Video Analyse andVideo Analyse1, and described by Video Analyse2 after a 15-second wait. An image is downloaded and described byAnalyze Image1. A text ad skips this step.Video Ad Ideas, Image Ad Ideas and Text Ad Ideas send the ad and its description to GPT-4.1, which returns asummary and adIdeas as JSON. Then Collect data, Collect data1 and Collect data2 append a row each. A Waitcount in the body of Ads Scraping, set to 200.period, set to last7d, and the fixed start_date[min]=2025-06-12 in the address inside the sameFilter Ads.Ad Ideas nodes. It asks for at most 5 ideas and sets a style. temperature isgpt-4.1 in the three idea nodes, gpt-4o in Analyze Image1, and the Gemini model in the address ofVideo Analyse2 (step 4).Video Ads, Image Ads and Text Ads.count first. Apify, OpenAI and Gemini each bill their own part.Ads Scraping waits for the actor in a single request, so a big search may time out. A smaller count helps.Country is typed straight into country= in the Ad Library address, and the form's example shows a name. Facebook'sUS, so try the code if a search finds nothing.start_date[min]=2025-06-12, so older ads may be left out. Change the dateSwitch1 looks at the second card (cards[1]) for a video address and at the first card for an image address, whileDownload Video reads the first card. Try a few real ads, and change the paths if a single-card video lands inWait7 pauses 15 seconds. Raise Wait7 if Gemini has not finished reading the video by then.Example File and none is deleted afterwards. Clear the folder from time to time.Ad Ideas<concept>n Execution. This one has them back.README.md 6 KB workflow.json 34 KB
alchaincyf · Skill
Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…
op7418 · Skill
Skill that makes single-file HTML slide decks, slide illustrations and platform covers in two visual styles, with a presenter mode for rehearsal. For speakers…
alirezarezvani · Skill
Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…
nerijs · Kit
A pixel art style add-on for Stable Diffusion XL that turns text prompts into pixel-style images, with an optional LCM LoRA for faster runs. For game makers, d…
LiconStudio · Kit
Keeps characters, clothing, objects and backgrounds consistent in generated video by feeding the model up to five reference images. A LoRA for LTX-2.5 in Comfy…
nhathoangfoto · Kit
A LoRA for FLUX.2 Klein 9B that puts a character into the pose shown by a mannequin reference while keeping the character's face and style. For artists and des…