What This Workflow Does
This workflow automates the analysis of Facebook ad performance by leveraging AI to generate actionable insights. It retrieves ad data through the Facebook API, processes it with Google Gemini AI, and automatically stores the results in Google Sheets and NocoDB for easy tracking and reporting.
How It Works
The workflow follows a multi-step process to deliver comprehensive ad performance analysis:
- Securely manages your Facebook API token with automatic refresh capabilities to ensure continuous access to your ad accounts
- Retrieves Facebook ad performance metrics through HTTP requests to the Facebook Graph API
- Processes raw ad data through sorting and filtering nodes to organize information by relevant metrics
- Sends filtered data to Google Gemini AI for intelligent analysis and insight generation
- Structures the AI-generated insights using an output parser for consistency and clarity
- Splits the analyzed data and distributes it to multiple destinations simultaneously
- Stores insights in Google Sheets for spreadsheet-based reporting and further analysis
- Records data in NocoDB for database-level management and custom views
Use Cases
- Social Media Marketing Teams: Automatically generate daily or weekly performance summaries for multiple Facebook ad campaigns without manual analysis
- E-commerce Businesses: Monitor ad ROI across product categories and receive AI-powered recommendations for budget optimization
- Digital Agencies: Streamline client reporting by delivering consistent, data-driven insights across multiple ad accounts in one workflow
- Performance Marketing Teams: Identify underperforming ads quickly and receive suggestions for creative or targeting adjustments
- Startup Growth Teams: Track early-stage marketing performance and maintain organized records of campaign metrics for growth analysis
Nodes Used
- Manual Trigger: Initiates the workflow on demand
- Code: Executes custom JavaScript logic for data transformation
- Google Gemini Chat: Provides AI analysis of ad performance data
- Output Parser Structured: Formats AI responses into organized data structures
- Split Out: Distributes data to multiple output destinations
- Google Sheets: Stores insights in your spreadsheet for reporting
- Sticky Note: Adds documentation and notes within the workflow
- NocoDB: Manages data in a database interface for advanced organization
- HTTP Request: Connects to the Facebook Graph API to retrieve ad metrics
- Set: Defines variables and data values throughout the workflow
- Sort: Organizes ad performance data by selected metrics
- Filter: Removes irrelevant data and focuses on key performance indicators
- Chain LLM: Sequences multiple AI operations for complex analysis
- Merge: Combines data from multiple sources into unified records
- If: Creates conditional logic to handle different data scenarios
- Aggregate: Summarizes and consolidates performance metrics
Prerequisites
- Active Facebook Business Account with advertising access and ad campaigns running
- Facebook App with Graph API permissions enabled and a long-term access token
- Google Account with Google Sheets and access to create new spreadsheets
- NocoDB account or self-hosted NocoDB instance for database management
- n8n account with HTTP Request, Google Sheets, and AI node capabilities
- Basic understanding of API tokens and how to configure credential management systems
- Familiarity with Facebook ad metrics such as CTR, conversion rate, and cost per result
Difficulty Level
Advanced – This workflow requires configuration of multiple external services including Facebook API, Google Sheets, NocoDB, and credential management. Users should have experience with API authentication, spreadsheet integration, and understanding of advertising metrics to fully customize and maintain this workflow.
This workflow template is shared under the n8n fair-code license. Free to use and modify.
Leave a Reply