# X (Twitter) Sentiment Monitor

**Category:** Social Media  
**Tools:** Slack, OpenAI, HTTP  
**Nodes:** 15  
**Built by:** Forgent Systems

Pulls fresh posts for your keywords from X, skips the ones already seen, scores the sentiment with AI, drafts replies for positive posts, alerts Slack on negative ones and logs everything.

![Workflow](preview.webp)

## How it works

1. On schedule, a scraper fetches recent posts for your search.
2. Each post is checked against the sheet to skip duplicates.
3. AI classifies the sentiment.
4. Positive posts get a drafted reply and negative posts alert Slack.
5. All results are saved to Google Sheets.

## Use cases

- Brand monitoring
- PR and crisis alerts
- Competitor tracking

## Data setup

**Google Sheets** (tab: columns)

- **Google Map Scraper → Twitter(hashtag)**: `ID`, `TweetUrl`, `TweetText`, `Sentiment`, `Post Reply`

## Setup

1. In n8n open **Workflows → Import from File** and choose `workflow.json`.
2. Connect these credentials:
   - Google Sheets account
   - OpenAI account
   - Slack account
3. Point the Sheets / Airtable / Drive / Slack nodes at your own resources (structure above).
4. Replace placeholder emails, phone numbers and `YOUR-FORM-ID` links with your own.
5. Times use the America/New_York timezone and dates use MM/DD/YYYY. Adjust if needed.
6. Run a test execution, then activate.

## Nodes

- **Loop Over Items** — `n8n-nodes-base.splitInBatches`
- **OpenAI** — `@n8n/n8n-nodes-langchain.openAi`
- **Structured Output Parser** — `@n8n/n8n-nodes-langchain.outputParserStructured`
- **Get Post Data** — `n8n-nodes-base.googleSheets`
- **Sentiment Analyst** — `@n8n/n8n-nodes-langchain.agent`
- **Switch According Analyst** — `n8n-nodes-base.switch`
- **Add Post Data** — `n8n-nodes-base.googleSheets`
- **Schedule Trigger** — `n8n-nodes-base.scheduleTrigger`
- **Set Field for Loop** — `n8n-nodes-base.set`
- **Send negative post message on slack** — `n8n-nodes-base.slack`
- **Request for Twitter Post via Apify** — `n8n-nodes-base.httpRequest`
- **Get Requested Post from Apify** — `n8n-nodes-base.httpRequest`
- **Sticky Note** — `n8n-nodes-base.stickyNote`
- **OpenAI Chat Model** — `@n8n/n8n-nodes-langchain.lmChatOpenAi`
- **If Duplicate** — `n8n-nodes-base.if`
