Facebook Mention Sentiment Tracker with Gemini, Supabase, Telegram & Slack
This workflow automatically tracks Facebook page mentions, analyzes sentiment using AI (Gemini), stores the data in Supabase and sends alerts via Telegram and Slack. Positive mentions are shared on Telegram, while critical or negative mentions trigger Slack alerts for immediate attention. It also handles storage failures by notifying via Telegram.
Quick Start (Implement in Minutes)
- Login to your n8n account.
- Connect your Facebook Page to the trigger node.
- Configure Gemini API credentials for sentiment analysis.
- Set up Supabase and create a
mentions table.
- Add Telegram bot credentials for notifications.
- Connect Slack and choose a channel for alerts.
- Test with sample data and activate the workflow.
What It Does
This workflow listens for new Facebook Page mentions in real time. When a mention is received, it sends the message to an AI model (Gemini) to analyze sentiment (positive, neutral or negative) and extract the main topic. The response is cleaned and structured into a consistent JSON format for further processing.
After processing, the workflow stores the mention data in Supabase for tracking and analytics. It then evaluates the sentiment and content of the message to determine the next action. Positive mentions are shared with your team via Telegram to highlight customer satisfaction.
For risk management, the workflow detects critical keywords (like refund, bug, slow, cancel) and also checks if the sentiment is negative. If either condition is met, a Slack alert is triggered so your team can take immediate action. Additionally, if storing data in Supabase fails, a Telegram alert is sent to notify about the issue.
Who It's For
- Social media managers monitoring brand mentions
- Customer support teams handling complaints
- Product teams tracking user feedback
- Startups and agencies managing multiple clients
- Businesses wanting real-time alerting on customer sentiment
Requirements to Use This Workflow
- n8n account (self-hosted or cloud)
- Facebook Developer App with Page access
- Google Gemini API credentials
- Supabase account and project
- Telegram Bot Token & Chat ID(s)
- Slack workspace with API access
- Basic understanding of n8n nodes and credentials
How It Works
- The workflow starts when a new Facebook mention is detected.
- The message is sent to Gemini AI for sentiment and topic analysis.
- The AI response is cleaned and normalized into structured JSON.
- The processed data is stored in Supabase.
- If sentiment is positive → Telegram notification is sent.
- Keywords are checked to detect critical intent.
- If sentiment is negative OR keywords match → Slack alert is triggered.
- If Supabase storage fails → Telegram error alert is sent.
Setup Instructions
-
Facebook Trigger
- Configure Facebook App ID.
- Enable webhook for Page mentions.
- Ensure required permissions are granted.
-
Gemini Node
- Add Google Gemini API credentials.
- Use any model (default:
gemini-2.5-flash).
- Ensure output is structured JSON.
-
Code Node (Clean AI Response)
- Keep existing logic to extract and normalize AI response.
-
Supabase Node
-
Telegram Nodes
-
Slack Node
- Connect Slack workspace.
- Select a channel for critical alerts.
-
IF Nodes
-
Configure:
- Positive sentiment check
- Critical/negative condition routing
-
Test Workflow
- Use mock or pinned data.
- Verify Telegram and Slack alerts.
- Activate workflow.
How To Customize Nodes
-
Gemini Node
- Change model (e.g., advanced models for better accuracy)
- Modify prompt to extract more fields (intent, urgency, etc.)
-
Keyword Detection
-
Update keywords array:
["refund", "cancel", "bug", "slow"]
-
Add business-specific terms
-
Slack संदेश
- Customize alert format
- Add priority levels or tagging
-
Telegram Messages
- Adjust formatting (Markdown, emojis, structure)
-
Supabase
- Add more columns if needed (e.g., region, category)
Add-ons (Extend This Workflow)
- Add sentiment trend dashboard (via Supabase + BI tools)
- Auto-create support tickets (Zendesk, Freshdesk)
- Email alerts for high-priority issues
- Auto-reply system for Facebook comments
- Weekly analytics report via email or Slack
- AI-based response suggestions for support team
Use Case Examples
- Detect and respond instantly to refund complaints
- Monitor brand reputation across social media
- Highlight positive feedback for marketing teams
- Escalate urgent issues to internal teams via Slack
- Build a centralized database of customer feedback
There can be many more use cases depending on your business needs.
Troubleshooting Guide
| Issue |
Possible Cause |
Solution |
| No Facebook data |
Webhook not configured |
Check Facebook App & permissions |
| AI not returning data |
Incorrect prompt or API issue |
Verify Gemini configuration |
| Supabase insert fails |
गलत credentials or schema mismatch |
Check table structure & API key |
| Telegram not sending |
Wrong bot token or chat ID |
Verify credentials |
| Slack alert not triggered |
Condition mismatch |
Check IF node logic |
| Keywords not detected |
Case mismatch or logic error |
Ensure .toLowerCase() is used |
Need Help?
If you need help setting up this workflow or want to extend it with advanced features like automation, dashboards or integrations then our n8n workflow development team at WeblineIndia can assist you.
We can help you:
- Customize this workflow for your business
- Integrate additional tools (CRM, Helpdesk, Analytics)
- Build scalable automation systems using n8n
Reach out to WeblineIndia to get started with tailored automation solutions.