1. Scrape ads – Pulls Facebook Ad Library data for "ai automation" keywords using Apify
2. Filter & sort – Filters ads by page likes (>1,000) and separates into videos, images, and text ads
3. Analyze creative – For videos: uploads to Gemini for detailed description. For images: analyzes with GPT-4V. For text: rewrites copy using GPT-4.1
4. Generate new ad – Creates a Veo 3 prompt from the analysis, generates an 8-second video clip, and converts it to 9:16 vertical format
5. Add captions – Overlays rewritten ad copy as captions using Creatomate
6. Log results – Uploads final video to GCS and logs all data (analysis, prompts, URLs) to Google Sheets
API Keys – Set up accounts for Apify, Google Cloud (Gemini + GCS), OpenAI, Shotstack, and Creatomate
Credentials in n8n – Add each API key as a credential in your n8n instance
Configure variables – Update the SET1 node with your Google Cloud PROJECT_ID and CLIENT_EMAIL
Set up Google Sheet – Create a sheet with columns matching the schema (ad_archive_id, page_name, summary, rewritten_ad_copy, etc.)
Test – Execute the workflow to scrape, analyze, and generate a new ad variation