This n8n workflow automates the process of retrieving and analyzing tweets with the hashtag ‘=#OnThisDay’ each morning at 6 AM. It searches Twitter for recent relevant tweets, stores the tweet data in MongoDB, analyzes the sentiment of each tweet using Google Cloud Natural Language API, saves sentiment scores and tweet texts into a PostgreSQL database, and sends a notification to Slack if the sentiment exceeds a certain threshold. This workflow helps monitor and analyze the mood of Twitter discussions related to specific topics daily.
**Workflow Steps:**
1. **Cron Trigger:** Initiates the workflow daily at 6 AM.
2. **Twitter Search:** Fetches the latest three tweets containing the hashtag ‘=#OnThisDay’.
3. **MongoDB Insert:** Stores the raw tweet texts into a MongoDB collection.
4. **Sentiment Analysis:** Uses Google Cloud Natural Language API to analyze each tweet’s sentiment.
5. **Set Node:** Extracts the sentiment score and magnitude, and formats the tweet text.
6. **PostgreSQL Insert:** Records the sentiment data along with the original tweet into a PostgreSQL database.
7. **Conditional Check (IF):** Checks if the sentiment score is above a specified threshold.
8. **Slack Notification:** Sends a detailed message to Slack if the sentiment is positive, displaying the tweet and sentiment scores.
9. **NoOp:** Ends the workflow gracefully if the condition is not met.
**Use Cases:**
This workflow is ideal for social media managers or analysts wanting to monitor public sentiment about specific topics or hashtags automatically each day, facilitating quick insights and enabling timely engagement.
**Nodes and Integrations:**
– Twitter API for data retrieval
– MongoDB for storing raw tweets
– Google Cloud Natural Language API for sentiment analysis
– PostgreSQL for structured sentiment data storage
– Slack for notifications
Reviews
There are no reviews yet.