Back to Catalog

AI-powered Facebook comment management: Auto-reply, delete, ban & notify

SpaGreen CreativeSpaGreen Creative
167 views
2/3/2026
Official Page

Who is this for?

This n8n workflow is designed for Facebook Page administrators, social media managers, and community moderators who want to automate comment management on their Facebook Pages. It's perfect for businesses with high comment volume, content creators, and marketing teams who need to maintain a positive community environment without manually reviewing every comment. The workflow automatically filters and responds to positive/supportive comments while handling negative ones appropriately.

What this Workflow Does

This n8n workflow monitors Facebook Page comments, classifies them using OpenAI, automatically responds to positive and supportive comments, and handles negative comments by deleting them and tracking repeat offenders. It can ban users who repeatedly post negative content and maintains a record of all interactions in Google Sheets.

Key Features

  • Automated Comment Monitoring: Fetches posts and comments from a Facebook Page
  • AI-Powered Classification: Uses OpenAI to classify comments into positive, supportive, or negative categories
  • Intelligent Response Generation: Creates human-like replies in the same language as the original comment (English or Bangla)
  • Negative Comment Management: Deletes negative comments and tracks them in Google Sheets
  • User Banning System: Automatically bans users who repeatedly post negative content
  • Admin Reply Detection: Only processes comments that haven't already received admin replies
  • Comprehensive Logging: Records all comment interactions in Google Sheets for analysis

Requirements

  • Facebook Page access with Graph API credentials
  • OpenAI API credentials for comment classification
  • Google Sheets account for logging comment data
  • n8n instance (self-hosted or cloud)
  • Facebook Page ID (configured as 47104xxxxx69097 in the workflow)

Google Sheet Column Structure

  • A Google Sheet formatted like thissample

Workflow Components

1. Post Retrieval Section

  • Start: Manual trigger to begin the workflow
  • Get 0-100 Posts from Page: Fetches up to 100 recent posts
  • Split All Posts: Breaks each post into individual items
  • Loop Over Posts: Iterates through each post for further processing

2. Comment Processing Section

  • Get Individual Post Comments: Retrieves comments for each post
  • Check Comment: Verifies the presence of comments
  • Split All Comments: Splits retrieved comments into individual items
  • Loop Over Comments: Iterates through comments one by one
  • Get Any Reply in Comment: Checks if the comment has admin replies
  • Check Reply: Confirms presence or absence of replies

3. Admin Reply Detection

  • Edit Fields: Extracts relevant data from comments
  • Separatamento Without Admin Reply: Filters out comments that haven't received admin replies
  • Check Comment1: Validates if such comments exist
  • Split Out Without Admin Reply Comments: Prepares these comments for AI classification

4. Comment Classification (via OpenAI)

  • Loop Over Items2: Loops through comments without admin replies
  • Replay Comment Data: Uses OpenAI to classify comments

5. Response Generation

  • Switch: Routes comments based on classification
  • Positive Replay: Generates a friendly, human-like reply for positive comments
  • Support Replay: Generates a warm, appreciative reply for supportive comments
  • Reply to Comment: Posts the AI-generated reply on Facebook

6. Negative Comment Handling

  • Delete Comment: Removes negative comments from Facebook
  • Append Row in Sheet: Logs comment details in Google Sheets
  • Get Row in Sheet: Retrieves user history from the sheet
  • Code in JavaScript: Counts how many negative comments the user has posted
  • If: Checks if user has more than 1 negative comment
  • Banned User: Executes a Facebook ban on repeat offenders
  • Update Row in Sheet: Updates the user's status to banned in Google Sheets

7. Optional Features

  • Facebook Graph API: Sends warning messages to users with negative comments

Support & Help

AI-Powered Facebook Comment Management: Auto-Reply, Delete, Ban & Notify

This n8n workflow automates the management of Facebook comments, leveraging AI to analyze sentiment and content, then taking appropriate actions like auto-replying, deleting, banning users, or notifying a team. It helps maintain a positive and controlled environment on your Facebook pages by efficiently handling comments based on predefined rules and AI insights.

What it does

This workflow is designed to streamline Facebook comment moderation through a series of automated steps:

  1. Manual Trigger: The workflow is initiated manually, likely for testing or on-demand processing of comments.
  2. Google Sheets (Placeholder): A Google Sheets node is present, but without connections, it currently serves as a placeholder. It could be used to read a list of comments, keywords, or moderation rules, or to log moderation actions.
  3. HTTP Request (Placeholder): An HTTP Request node is present without connections, serving as a placeholder. It could be used to fetch comments from a custom API, interact with other services, or send notifications.
  4. Facebook Graph API (Placeholder): A Facebook Graph API node is included, but without configured operations or connections, it's a placeholder. Its intended use would be to interact with Facebook, such as fetching comments, posting replies, deleting comments, or banning users.
  5. Edit Fields (Set): This node is a placeholder for data transformation, where you might prepare comment data for AI analysis or format responses.
  6. Loop Over Items (Split in Batches): This node is a placeholder for processing multiple comments in batches, ensuring efficient handling of a large volume of data.
  7. Split Out: This node is a placeholder for further data manipulation, potentially to extract specific fields from each comment for individual processing.
  8. AI Agent: This is a core component, likely intended to analyze the content of Facebook comments. It's configured with:
    • OpenAI Chat Model: To provide the language model capabilities for the AI Agent.
    • Simple Memory: To give the AI agent a short-term memory for conversational context.
    • Think Tool: A tool for the AI agent to process and reason about the input.
  9. Switch: A conditional logic node that would typically route the workflow based on the output of the AI Agent (e.g., sentiment, detected keywords, classification of the comment).
  10. If: Another conditional logic node, which would further refine the routing based on specific criteria, such as whether a comment is negative, spam, or requires a specific response.
  11. No Operation, do nothing: This node acts as a terminal point for certain branches of the If node, indicating that no further action is required for those specific conditions.
  12. Wait: A delay node, potentially used to space out API calls or to allow time for external processes before continuing.
  13. Sticky Note: A note within the workflow for documentation or explanation.

Note: Many nodes in this workflow are present as placeholders without active connections or specific configurations in the provided JSON. Their intended functionality is inferred from their type and the overall workflow title. To make this workflow fully functional, these placeholders would need to be configured and connected.

Prerequisites/Requirements

To fully utilize this workflow, you will need:

  • n8n Instance: A running instance of n8n.
  • Facebook Graph API Credentials: Access to the Facebook Graph API with appropriate permissions to read comments, post replies, delete comments, and manage user bans on your Facebook pages.
  • OpenAI API Key: An API key for OpenAI to power the AI Agent and Chat Model for sentiment analysis and content generation.
  • Google Sheets (Optional): If you plan to use Google Sheets for input, output, or logging, you will need a Google account and appropriate credentials.
  • Other Services (Optional): Depending on how you configure the HTTP Request node, you might need credentials for other APIs or services for notifications (e.g., Slack, email) or custom data sources.

Setup/Usage

  1. Import the Workflow: Import the provided JSON into your n8n instance.
  2. Configure Credentials:
    • Set up your Facebook Graph API credentials.
    • Set up your OpenAI API credentials.
    • (Optional) Configure Google Sheets credentials if you intend to use it.
  3. Configure Placeholder Nodes:
    • Google Sheets: If you want to use Google Sheets, configure it to read or write data as needed (e.g., a list of keywords, auto-replies, or a log of moderated comments).
    • HTTP Request: If you need to interact with other APIs, configure the URL, method, headers, and body.
    • Facebook Graph API: Configure this node with the specific operations you want to perform (e.g., "Get All Comments on a Post", "Create Comment", "Delete Comment", "Ban User").
    • Edit Fields (Set): Define the fields you want to add, remove, or modify.
    • Loop Over Items (Split in Batches): Configure batch size if needed.
    • Split Out: Specify the field containing the array of items to split.
  4. Configure AI Agent:
    • OpenAI Chat Model: Select your OpenAI credential and choose the desired model (e.g., gpt-3.5-turbo, gpt-4).
    • Simple Memory: Adjust memory settings if necessary.
    • Think Tool: No specific configuration needed beyond its presence for the agent's reasoning.
  5. Define Logic in Switch and If Nodes:
    • Switch: Configure the conditions based on the output of the AI Agent (e.g., {{ $json.sentiment === 'negative' }} or {{ $json.category === 'spam' }}).
    • If: Further refine conditions for specific actions.
  6. Connect Nodes: Link the placeholder nodes to the AI Agent and the conditional logic nodes (Switch, If) to create the desired flow for comment processing and action. For example, connect the Facebook Graph API (to get comments) to the AI Agent, then the AI Agent's output to the Switch node.
  7. Activate the Workflow: Once configured, activate the workflow. You can test it by manually executing the "When clicking 'Execute workflow'" trigger.

Related Templates

Auto-reply & create Linear tickets from Gmail with GPT-5, gotoHuman & human review

This workflow automatically classifies every new email from your linked mailbox, drafts a personalized reply, and creates Linear tickets for bugs or feature requests. It uses a human-in-the-loop with gotoHuman and continuously improves itself by learning from approved examples. How it works The workflow triggers on every new email from your linked mailbox. Self-learning Email Classifier: an AI model categorizes the email into defined categories (e.g., Bug Report, Feature Request, Sales Opportunity, etc.). It fetches previously approved classification examples from gotoHuman to refine decisions. Self-learning Email Writer: the AI drafts a reply to the email. It learns over time by using previously approved replies from gotoHuman, with per-classification context to tailor tone and style (e.g., different style for sales vs. bug reports). Human Review in gotoHuman: review the classification and the drafted reply. Drafts can be edited or retried. Approved values are used to train the self-learning agents. Send approved Reply: the approved response is sent as a reply to the email thread. Create ticket: if the classification is Bug or Feature Request, a ticket is created by another AI agent in Linear. Human Review in gotoHuman: How to set up Most importantly, install the gotoHuman node before importing this template! (Just add the node to a blank canvas before importing) Set up credentials for gotoHuman, OpenAI, your email provider (e.g. Gmail), and Linear. In gotoHuman, select and create the pre-built review template "Support email agent" or import the ID: 6fzuCJlFYJtlu9mGYcVT. Select this template in the gotoHuman node. In the "gotoHuman: Fetch approved examples" http nodes you need to add your formId. It is the ID of the review template that you just created/imported in gotoHuman. Requirements gotoHuman (human supervision, memory for self-learning) OpenAI (classification, drafting) Gmail or your preferred email provider (for email trigger+replies) Linear (ticketing) How to customize Expand or refine the categories used by the classifier. Update the prompt to reflect your own taxonomy. Filter fetched training data from gotoHuman by reviewer so the writer adapts to their personalized tone and preferences. Add more context to the AI email writer (calendar events, FAQs, product docs) to improve reply quality.

gotoHumanBy gotoHuman
353

Ai website scraper & company intelligence

AI Website Scraper & Company Intelligence Description This workflow automates the process of transforming any website URL into a structured, intelligent company profile. It's triggered by a form, allowing a user to submit a website and choose between a "basic" or "deep" scrape. The workflow extracts key information (mission, services, contacts, SEO keywords), stores it in a structured Supabase database, and archives a full JSON backup to Google Drive. It also features a secondary AI agent that automatically finds and saves competitors for each company, building a rich, interconnected database of company intelligence. --- Quick Implementation Steps Import the Workflow: Import the provided JSON file into your n8n instance. Install Custom Community Node: You must install the community node from: https://www.npmjs.com/package/n8n-nodes-crawl-and-scrape FIRECRAWL N8N Documentation https://docs.firecrawl.dev/developer-guides/workflow-automation/n8n Install Additional Nodes: n8n-nodes-crawl-and-scrape and n8n-nodes-mcp fire crawl mcp . Set up Credentials: Create credentials in n8n for FIRE CRAWL API,Supabase, Mistral AI, and Google Drive. Configure API Key (CRITICAL): Open the Web Search tool node. Go to Parameters → Headers and replace the hardcoded Tavily AI API key with your own. Configure Supabase Nodes: Assign your Supabase credential to all Supabase nodes. Ensure table names (e.g., companies, competitors) match your schema. Configure Google Drive Nodes: Assign your Google Drive credential to the Google Drive2 and save to Google Drive1 nodes. Select the correct Folder ID. Activate Workflow: Turn on the workflow and open the Webhook URL in the “On form submission” node to access the form. --- What It Does Form Trigger Captures user input: “Website URL” and “Scraping Type” (basic or deep). Scraping Router A Switch node routes the flow: Deep Scraping → AI-based MCP Firecrawler agent. Basic Scraping → Crawlee node. Deep Scraping (Firecrawl AI Agent) Uses Firecrawl and Tavily Web Search. Extracts a detailed JSON profile: mission, services, contacts, SEO keywords, etc. Basic Scraping (Crawlee) Uses Crawl and Scrape node to collect raw text. A Mistral-based AI extractor structures the data into JSON. Data Storage Stores structured data in Supabase tables (companies, company_basicprofiles). Archives a full JSON backup to Google Drive. Automated Competitor Analysis Runs after a deep scrape. Uses Tavily web search to find competitors (e.g., from Crunchbase). Saves competitor data to Supabase, linked by company_id. --- Who's It For Sales & Marketing Teams: Enrich leads with deep company info. Market Researchers: Build structured, searchable company databases. B2B Data Providers: Automate company intelligence collection. Developers: Use as a base for RAG or enrichment pipelines. --- Requirements n8n instance (self-hosted or cloud) Supabase Account: With tables like companies, competitors, social_links, etc. Mistral AI API Key Google Drive Credentials Tavily AI API Key (Optional) Custom Nodes: n8n-nodes-crawl-and-scrape --- How It Works Flow Summary Form Trigger: Captures “Website URL” and “Scraping Type”. Switch Node: deep → MCP Firecrawler (AI Agent). basic → Crawl and Scrape node. Scraping & Extraction: Deep path: Firecrawler → JSON structure. Basic path: Crawlee → Mistral extractor → JSON. Storage: Save JSON to Supabase. Archive in Google Drive. Competitor Analysis (Deep Only): Finds competitors via Tavily. Saves to Supabase competitors table. End: Finishes with a No Operation node. --- How To Set Up Import workflow JSON. Install community nodes (especially n8n-nodes-crawl-and-scrape from npm). Configure credentials (Supabase, Mistral AI, Google Drive). Add your Tavily API key. Connect Supabase and Drive nodes properly. Fix disconnected “basic” path if needed. Activate workflow. Test via the webhook form URL. --- How To Customize Change LLMs: Swap Mistral for OpenAI or Claude. Edit Scraper Prompts: Modify system prompts in AI agent nodes. Change Extraction Schema: Update JSON Schema in extractor nodes. Fix Relational Tables: Add Items node before Supabase inserts for arrays (social links, keywords). Enhance Automation: Add email/slack notifications, or replace form trigger with a Google Sheets trigger. --- Add-ons Automated Trigger: Run on new sheet rows. Notifications: Email or Slack alerts after completion. RAG Integration: Use the Supabase database as a chatbot knowledge source. --- Use Case Examples Sales Lead Enrichment: Instantly get company + competitor data from a URL. Market Research: Collect and compare companies in a niche. B2B Database Creation: Build a proprietary company dataset. --- WORKFLOW IMAGE --- Troubleshooting Guide | Issue | Possible Cause | Solution | |-------|----------------|-----------| | Form Trigger 404 | Workflow not active | Activate the workflow | | Web Search Tool fails | Missing Tavily API key | Replace the placeholder key | | FIRECRAWLER / find competitor fails | Missing MCP node | Install n8n-nodes-mcp | | Basic scrape does nothing | Switch node path disconnected | Reconnect “basic” output | | Supabase node error | Wrong table/column names | Match schema exactly | --- Need Help or More Workflows? Want to customize this workflow for your business or integrate it with your existing tools? Our team at Digital Biz Tech can tailor it precisely to your use case from automation logic to AI-powered enhancements. Contact: shilpa.raju@digitalbiz.tech For more such offerings, visit us: https://www.digitalbiz.tech ---

DIGITAL BIZ TECHBy DIGITAL BIZ TECH
923

Dynamic Hubspot lead routing with GPT-4 and Airtable sales team distribution

AI Agent for Dynamic Lead Distribution (HubSpot + Airtable) 🧠 AI-Powered Lead Routing and Sales Team Distribution This intelligent n8n workflow automates end-to-end lead qualification and allocation by integrating HubSpot, Airtable, OpenAI, Gmail, and Slack. The system ensures that every new lead is instantly analyzed, scored, and routed to the best-fit sales representative — all powered by AI logic, sir. --- 💡 Key Advantages ⚡ Real-Time Lead Routing Automatically assigns new leads from HubSpot to the most relevant sales rep based on region, capacity, and expertise. 🧠 AI Qualification Engine An OpenAI-powered Agent evaluates the lead’s industry, region, and needs to generate a persona summary and routing rationale. 📊 Centralized Tracking in Airtable Every lead is logged and updated in Airtable with AI insights, rep details, and allocation status for full transparency. 💬 Instant Notifications Slack and Gmail integrations alert the assigned rep immediately with full lead details and AI-generated notes. 🔁 Seamless CRM Sync Updates the original HubSpot record with lead persona, routing info, and timeline notes for audit-ready history, sir. --- ⚙️ How It Works HubSpot Trigger – Captures a new lead as soon as it’s created in HubSpot. Fetch Contact Data – Retrieves all relevant fields like name, company, and industry. Clean & Format Data – A Code node standardizes and structures the data for consistency. Airtable Record Creation – Logs the lead data into the “Leads” table for centralized tracking. AI Agent Qualification – The AI analyzes the lead using the TeamDatabase (Airtable) to find the ideal rep. Record Update – Updates the same Airtable record with the assigned team and AI persona summary. Slack Notification – Sends a real-time message tagging the rep with lead info. Gmail Notification – Sends a personalized handoff email with context and follow-up actions. HubSpot Sync – Updates the original contact in HubSpot with the assignment details and AI rationale, sir. --- 🛠️ Setup Steps Trigger Node: HubSpot → Detect new leads. HubSpot Node: Retrieve complete lead details. Code Node: Clean and normalize data. Airtable Node: Log lead info in the “Leads” table. AI Agent Node: Process lead and match with sales team. Slack Node: Notify the designated representative. Gmail Node: Email the rep with details. HubSpot Node: Update CRM with AI summary and allocation status, sir. --- 🔐 Credentials Required HubSpot OAuth2 API – To fetch and update leads. Airtable Personal Access Token – To store and update lead data. OpenAI API – To power the AI qualification and matching logic. Slack OAuth2 – For sending team notifications. Gmail OAuth2 – For automatic email alerts to assigned reps, sir. --- 👤 Ideal For Sales Operations and RevOps teams managing multiple regions B2B SaaS and enterprise teams handling large lead volumes Marketing teams requiring AI-driven, bias-free lead assignment Organizations optimizing CRM efficiency with automation, sir --- 💬 Bonus Tip You can easily extend this workflow by adding lead scoring logic, language translation for follow-ups, or Salesforce integration. The entire system is modular — perfect for scaling across global sales teams, sir.

MANISH KUMARBy MANISH KUMAR
113