What This Workflow Does
Manual monitoring of Facebook comments is time-consuming, inconsistent, and misses critical insights buried in hundreds of responses. This n8n workflow solves that by automating the entire process of collecting, analyzing, and organizing Facebook post comments using AI-powered sentiment analysis.
The system connects to the Facebook Graph API to extract every comment from your specified posts, processes them through Google Gemini's advanced natural language model to determine sentiment (positive, negative, neutral), and stores the structured results in Google Sheets for easy reporting and trend analysis. It handles pagination automatically, ensuring no comment is missed, even on highly active posts.
Beyond simple sentiment scoring, this automation provides actionable business intelligence. Marketing teams can measure campaign reception, customer support can identify urgent issues, and brand managers can track reputation shifts—all without manual data collection or spreadsheet work.
How It Works
The workflow operates in two complementary modes, giving you flexibility for both ad-hoc analysis and ongoing monitoring.
1. Manual Execution Mode
Start by entering a specific Facebook Post ID. The workflow fetches the post details, then retrieves all comments (including nested replies) using pagination handling. It batches comments for efficient processing and calls a sub-workflow to analyze each batch through Google Gemini's sentiment classification.
2. Triggered Execution Mode
When activated by another workflow or scheduled trigger, it receives comment data directly, splits it into manageable batches, processes sentiment analysis, and updates your Google Sheet with "append or update" logic to prevent duplicates while allowing sentiment re-evaluation if comments are edited.
3. Data Storage & Output
Each analyzed comment is saved with its Post ID, Comment ID, original text, sentiment classification, and timestamp. The Google Sheet becomes a searchable database of audience sentiment that can be connected to dashboards, alert systems, or CRM platforms for further action.
Who This Is For
This template is ideal for social media managers, marketing teams, brand managers, customer support leads, and agencies managing multiple client accounts. If you regularly analyze Facebook engagement, track brand sentiment, measure campaign performance, or need to identify customer issues quickly, this automation eliminates hours of manual work each week.
Businesses running product launches, promotional campaigns, or community management will find particular value. The system scales effortlessly—whether you're monitoring a single post or dozens across multiple pages—providing consistent, unbiased sentiment analysis at any volume.
What You'll Need
- Facebook Graph API Access: A Facebook App with Page access token and appropriate permissions (pages_read_engagement, pages_read_user_content).
- Google Gemini API Key: Access to Google's AI Studio or Vertex AI to generate an API key for sentiment analysis.
- Google Sheets: A spreadsheet (new or existing) with write permissions via Google OAuth credentials.
- n8n Instance: Self-hosted n8n or n8n.cloud account with workflow execution capabilities.
- Facebook Page ID: The numeric ID of the Facebook Page you want to monitor (found in Page settings).
Pro tip: For ongoing monitoring, schedule this workflow to run daily or weekly. Combine it with a dashboard tool like Google Data Studio or Tableau to visualize sentiment trends over time and share insights with stakeholders.
Quick Setup Guide
Import and configure this workflow in under 15 minutes:
- Download & Import: Click the download button above to get the JSON file. In your n8n instance, create a new workflow and import the JSON.
- Configure Facebook Credentials: Add your Facebook Graph API credentials to both the "Get Fb Post" and "Get Fb comments" nodes. Test with a recent post ID.
- Set Up Google Gemini: Add your Google Gemini API key to the "Google Gemini Chat Model" node. Adjust the prompt if needed for your industry terminology.
- Connect Google Sheets: Authenticate with Google OAuth and specify your target spreadsheet ID. The workflow will create columns if they don't exist.
- Test & Schedule: Run the workflow manually with a test post ID. Once confirmed, add a Schedule Trigger node for automatic periodic execution.
Key Benefits
Save 10+ hours weekly on manual comment monitoring. What previously required a team member to read and categorize hundreds of comments now happens automatically in minutes, freeing up resources for strategic work.
Gain real-time brand sentiment visibility. Instead of quarterly sentiment reports, get daily or weekly insights that let you respond to emerging issues before they escalate, protecting brand reputation.
Eliminate human bias in sentiment classification. AI applies consistent criteria across all comments, removing the variability and fatigue that affects manual rating, leading to more reliable trend data.
Create actionable marketing intelligence. Transform unstructured social comments into structured data that integrates with your CRM, support ticketing, or business intelligence tools for comprehensive customer understanding.
Scale monitoring without proportional cost increases. Whether you're analyzing 100 comments or 10,000, the workflow handles the volume with minimal additional setup, making it cost-effective for growing businesses.