Analyze competitor Facebook ads with Apify, OpenAI, and Google Sheets
Ready for 3.0What this workflow does
This AI workflow has 22 nodes and runs manually, when you click “Execute workflow”. Along the way it connects OpenAI, OpenAI Chat Model and Google Sheets. It also calls api.apify.com over HTTP.
How it runs
Trigger: Manually, when you click “Execute workflow”.
- Configuration (Edit Fields (Set)): sets 7 fields: search_keywords, facebook_country, ad_active_status…
- Scrape Facebook Ad Library with Apify (HTTP Request): calls api.apify.com (POST)
- Filter: keeps only the items that match a condition
- Route by Ad Content Type (Switch): routes items into 2 branches
- Loop Over Video Ads (Loop Over Items (Split in Batches)): loops over the items in batches
- Loop Over Image Ads (Loop Over Items (Split in Batches)): loops over the items in batches
- Loop Over Text Ads (Loop Over Items (Split in Batches)): loops over the items in batches
- Analyze Video Preview Image (GPT Vision) (OpenAI): analyze (image)
- Analyze Image Ad (GPT Vision) (OpenAI): analyze (image)
- Generate Text Ad Intelligence (AI Agent): runs an AI agent, with model: Text Analysis Model; output parser: Text Analysis Output Format
…plus 5 more steps. See the full node list below.
Services it uses
HTTP calls to: api.apify.com
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (11)
- Manual Trigger
n8n-nodes-base.manualTrigger - Edit Fields (Set)
n8n-nodes-base.set - HTTP Request
n8n-nodes-base.httpRequest - Filter
n8n-nodes-base.filter - Switch
n8n-nodes-base.switch - OpenAI
@n8n/n8n-nodes-langchain.openAi - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Google Sheets
n8n-nodes-base.googleSheets - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches
From the author
Quick overview This workflow manually scrapes Facebook Ad Library results via apify, filters for high-like advertisers, analyzes video/image/text ads with OpenAI (vision + text), and appends a strategic summary plus rewritten ad copy for each ad to Google…