Analyze Instagram profiles with Apify, Google Gemini, and Supabase
UnknownUnknown. This template uses community nodes we can't verify statically. Uses community nodes that can't be verified statically (unverified community packages are off by default in 3.0). Static check, last run 2026-10-19.
Community nodes
These come from third-party npm packages. In n8n 3.0 unverified community packages are off by default (N8N_UNVERIFIED_PACKAGES_ENABLED=false).
@apify/n8n-nodes-apify(Run an Actor and get dataset)
Nodes used (9)
- Webhook
n8n-nodes-base.webhook - Supabase
n8n-nodes-base.supabase - Respond to Webhook
n8n-nodes-base.respondToWebhook - Code
n8n-nodes-base.code - Merge
n8n-nodes-base.merge - Google Gemini
@n8n/n8n-nodes-langchain.googleGemini - If
n8n-nodes-base.if - Apify
@apify/n8n-nodes-apify.apify - Aggregate
n8n-nodes-base.aggregate
What it does
Quick overview This workflow receives an Instagram username via webhook, checks Supabase for a recent cached analysis, and if needed scrapes recent posts with Apify and generates niche, content, and engagement insights using Google Gemini before storing and returning the report. How it works 1. Receives a POST webhook request containing an Instagram username. 2. Queries the Supabase reports table for matching records updated within the last 24 hours and returns the cached analysisreport if found. 3. If no fresh cache exists, runs the Apify Instagram Scraper actor to fetch the latest 5 posts for the requested profile. 4. Cleans and bundles the scraped post data into a compact JSON payload for analysis. 5. Sends the payload to Google Gemini to generate three sub-reports: niche/frequency, content strategy, and engagement/actions. 6. Combines the three Gemini outputs into a single analysisreport object along with the scraped data. 7. Upserts the report into Supabase (update if the username exists, otherwise insert) and returns the fresh analysisreport in the webhook response. Setup 1. Create or select a Supabase project, add Supabase credentials in n8n, and ensure a reports table exists with at least username, analysisreport, scrapeddata, and updatedat columns. 2. Add an Apify API token in n8n and ensure the workflow can run the apify/instagram-scraper actor with access to the target profiles. 3. Add Google Gemini (PaLM) API credentials in n8n for the Gemini model used in the three analysis steps. 4. Copy the production webhook URL from the webhook trigger and configure your source app (e.g. Lovable) to POST a JSON body containing username to /analyze-profile.