Automate Twitter Sentiment Analysis and Slack Notifications
detail.loadingPreview
This n8n workflow automatically fetches tweets related to a specific hashtag, analyzes their sentiment, and stores the results. It then triggers notifications in Slack based on the sentiment score, enabling real-time brand monitoring and engagement.
About This Workflow
This powerful n8n workflow revolutionizes how you track conversations and sentiment around your brand or specific topics on Twitter. It begins by scheduled retrieval of up to three tweets containing the '#OnThisDay' hashtag using the Twitter node. These tweets are then stored in a MongoDB database for safekeeping and future analysis. The workflow seamlessly integrates with Google Cloud Natural Language to determine the sentiment score and magnitude of each tweet. Subsequently, this sentiment data is formatted using a 'Set' node and stored in a PostgreSQL database for robust data management. An 'IF' condition then checks the sentiment score, triggering a Slack notification only if the sentiment is positive. This ensures you're alerted to positive mentions and can quickly engage with your audience or address any concerns.
Key Features
- Scheduled Tweet Fetching: Automatically collect tweets at a specified time each day.
- Sentiment Analysis Integration: Leverage Google Cloud Natural Language for accurate sentiment scoring.
- Data Storage: Persistently store tweet data and sentiment scores in both MongoDB and PostgreSQL.
- Conditional Slack Notifications: Receive real-time alerts in Slack for positive sentiment tweets.
- Customizable Hashtag Monitoring: Easily adapt the workflow to monitor any desired hashtag.
How To Use
- Configure the Cron Node: Set the
triggerTimesparameter to define when the workflow should run daily (e.g.,hour: 6for 6 AM). - Set up the Twitter Node: In the
searchTextparameter, replace"=#OnThisDay"with the hashtag you wish to monitor. Adjust thelimitif needed. - Configure MongoDB: Enter your MongoDB connection details and specify the
collectionname astweets. - Integrate Google Cloud Natural Language: Provide your Google Cloud credentials and ensure the
contentparameter correctly references the tweet text from the MongoDB node (e.g.,={{$node["MongoDB"].json["text"]}}). - Set up the Set Node: Map the sentiment
scoreandmagnitudefrom the Google NLP node and thetextfrom the Twitter node into thevaluesparameter. - Configure PostgreSQL: Enter your PostgreSQL connection details, specify the
tableastweets, and define thecolumnsto store. - Set up the IF Node: Configure the
conditionsto check if thescoreislargerthan your desired threshold for triggering a Slack notification (e.g.,={{$json["score"]}}). - Configure the Slack Node: Enter your Slack API credentials, specify the
channel(e.g.,tweets), and customize thetextmessage to include sentiment scores and tweet content using dynamic expressions.
Apps Used
Workflow JSON
{
"id": "efd8bc1e-6c04-417d-aae9-52d562d70705",
"name": "Automate Twitter Sentiment Analysis and Slack Notifications",
"nodes": 21,
"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: efd8bc1e-6c04...
About the Author
Crypto_Watcher
Web3 Developer
Automated trading bots and blockchain monitoring workflows.
Statistics
Related Workflows
Discover more workflows you might like
Automated AI Motion Illustration Workflow with Midjourney and Kling
Unleash your creativity with this n8n workflow that automates the generation of stunning motion illustrations. It leverages the power of Midjourney for static image creation and Kling AI to transform them into dynamic videos, all managed through the PiAPI. Perfect for content creators, marketers, and social media professionals looking to produce engaging visuals at scale.
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.