Analyze Facebook Ads & send insights to Google Sheets with Gemini AI
Ready for 3.0What this workflow does
This AI workflow has 26 nodes and runs manually, when you click “Execute workflow”. Along the way it connects Google Gemini Chat Model, Google Sheets and NocoDB. It also calls graph.facebook.com over HTTP.
How it runs
Trigger: Manually, when you click “Execute workflow”.
- Getting Long-Term Token (NocoDB): get many
- Does it Need A Token Refresh? (Code): runs custom JavaScript code
- Does Token Needs Refreshing? (If): checks a condition and branches into true / false
- Getting Long-Lived Access Token (HTTP Request): calls graph.facebook.com (POST)
- Getting Long-Term Token (Edit Fields (Set)): sets 1 field: longAccessToken
- Calculating End Date of Token (Code): runs custom JavaScript code
- Extracting Access Token (Edit Fields (Set)): sets 1 field: accessToken
- Updating Token (NocoDB): update
- Getting Data For the Past 28 Days Segemented Per Campaign Adset and Ad (HTTP Request): calls an HTTP API
- Extracting Long Term Token (Edit Fields (Set)): sets 1 field: longAccessToken
…plus 13 more steps. See the full node list below.
Services it uses
HTTP calls to: graph.facebook.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 (15)
- Manual Trigger
n8n-nodes-base.manualTrigger - Code
n8n-nodes-base.code - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Split Out
n8n-nodes-base.splitOut - Google Sheets
n8n-nodes-base.googleSheets - NocoDB
n8n-nodes-base.nocoDb - HTTP Request
n8n-nodes-base.httpRequest - Edit Fields (Set)
n8n-nodes-base.set - Sort
n8n-nodes-base.sort - Filter
n8n-nodes-base.filter - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Merge
n8n-nodes-base.merge - If
n8n-nodes-base.if - Aggregate
n8n-nodes-base.aggregate
From the author
Stop manually digging through Meta Ads data and spending hours trying to connect the dots. This workflow turns n8n into an AI-powered media buyer that automatically analyzes your ad performance, categorizes your creatives, and delivers insights directly into…