Automate Twitter Sentiment Analysis and Notifications
detail.loadingPreview
This workflow automatically monitors Twitter for specific hashtags, analyzes the sentiment of tweets, stores the data, and sends alerts for positive sentiment. It's perfect for tracking brand mentions or trending topics with actionable insights.
About This Workflow
This n8n workflow automates the process of gathering and analyzing Twitter data. It begins by searching for tweets containing the hashtag #OnThisDay daily. These tweets are then stored in MongoDB for further processing. Utilizing Google Cloud Natural Language, the sentiment score and magnitude of each tweet are extracted. This sentiment data is then saved into a PostgreSQL database, alongside the original tweet text. An IF node checks if the sentiment score is positive. If it is, a notification is sent to a designated Slack channel, highlighting the tweet's sentiment and content. This creates a closed-loop system for monitoring and reacting to social media sentiment in real-time.
Key Features
- Real-time Twitter Monitoring: Automatically fetches tweets based on specific search queries.
- Advanced Sentiment Analysis: Leverages Google Cloud Natural Language to determine tweet sentiment score and magnitude.
- Data Persistence: Stores tweet data and sentiment scores in both MongoDB and PostgreSQL databases.
- Conditional Slack Notifications: Sends targeted alerts to Slack for tweets with positive sentiment, enabling prompt engagement.
- Scheduled Execution: Configurable to run at specific times, ensuring timely data collection and analysis.
How To Use
- Cron Node: Configure the
Cronnode to set the schedule for when the workflow should run (e.g., daily at 6 AM). - Twitter Node: Set up your Twitter credentials and configure the
Twitternode to search for your desired hashtag (e.g.,#OnThisDay). Adjust thelimitas needed. - MongoDB Node: Connect your MongoDB instance and specify the collection (e.g.,
tweets) where the raw tweet data will be inserted. - Google Cloud Natural Language Node: Configure your Google Cloud credentials and ensure the
contentparameter correctly pulls the tweet text from the MongoDB output. - Set Node: Map the sentiment
scoreandmagnitudefrom the Natural Language output, and the original tweettextfrom the Twitter node to new fields. - Postgres Node: Connect your PostgreSQL database and define the table (
tweets) and columns to store the processed data. - IF Node: Set up a condition to check if the
scorefrom theSetnode islargerthan a defined value (e.g., 0 for positive sentiment). - Slack Node: Configure your Slack credentials and set the message content to include the tweet
text,score, andmagnitudefor positive sentiment tweets. - NoOp Node: This node serves as a placeholder for workflows where no action is needed for non-positive sentiment tweets.
Apps Used
Workflow JSON
{
"id": "3fc50d25-8ea9-408c-8465-5de48428fc3a",
"name": "Automate Twitter Sentiment Analysis and Notifications",
"nodes": 16,
"category": "Marketing",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 3fc50d25-8ea9...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
Automated Multi-Platform Social Media Publisher
Streamline your social media content creation and publishing with this n8n workflow. Simply fill out a web form with your caption, media (image or video), and target platforms, and let n8n automate the posting process across multiple social networks.
WhatsApp AI Assistant: LLaMA 4 & Google Search for Real-Time Insights
Instantly deploy a smart AI assistant on WhatsApp, powered by Groq's lightning-fast LLaMA 4 model. This workflow enables real-time conversations, remembers context, and provides up-to-date answers by integrating live Google Search results.
AI-Powered On-Page SEO Audit & Report Automation
Instantly generate comprehensive on-page SEO technical and content audits for any website URL. This AI-powered workflow automates the entire process, from scraping the page to delivering a detailed report directly to your inbox, empowering you to optimize for better search rankings and user engagement.