Skip to main content

X (Twitter) brand sentiment analysis with Gemini AI & Slack alerts

Workflow preview

Workflow preview
100%
X (Twitter) brand sentiment analysis with Gemini AI & Slack alerts preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This workflow is the AI analysis and alerting engine for a complete social media monitoring system. It's designed to work with data scraped from X (formerly Twitter) using a tool like the Apify Twe...

Best for

  • Market Research automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.code, n8n-nodes-base.googlesheets, n8n-nodes-base.set, n8n-nodes-base.if, n8n-nodes-base.limit, n8n-nodes-base.wait, n8n-nodes-base.switch, @n8n/n8n-nodes-langchain.lmchatgooglegemini

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Saeculum Solutions.

Original n8n.io source

1.1 Workflow description

Title
X (Twitter) brand sentiment analysis with Gemini AI & Slack alerts
Workflow name
X (Twitter) brand sentiment analysis with Gemini AI & Slack alerts

This workflow is the AI analysis and alerting engine for a complete social media monitoring system. It's designed to work with data scraped from X (formerly Twitter) using a tool like the Apify Tweet Scraper, which logs the data into a Google Sheet. The workflow then automatically analyzes new tweets with Google Gemini and sends tailored alerts to Slack.

How it works

This workflow automates the analysis and reporting part of your social media monitoring:

  • tweet Hunting: It finds tweets for the query entered in the set node and passes the data to the google sheets
  • Fetches New Tweets: It gets all new rows from your Google Sheet that haven't been processed yet (it looks for "Notmarked" in the 'action taken' column).
  • Prepares for AI: It combines the data from all new tweets into a single, clean prompt for the AI to analyze.
  • AI Analysis with Gemini: It sends the compiled data to Google Gemini, asking for a full summary report and a separate, machine-readable JSON list of any urgent items.
  • Splits the Response: The workflow intelligently separates the AI's text summary from the JSON data for urgent alerts.
  • Sends Notifications:
    • The high-level summary is sent to a general Slack channel (e.g., #brand-alerts).
    • Each urgent item is sent as a separate, detailed alert to a high-priority Slack channel (e.g., #urgent).

Set up steps

It should take about 5-10 minutes to get this workflow running.

  1. Prerequisite - Data Source: Ensure you have a Google Sheet being populated with tweet data. For a complete automation, you can set up a new google sheet with the same structure for saving the tweets data and run the Tweet Scraper on a schedule.
  2. Configure Credentials: Make sure you have credentials set up in your n8n instance for Google Sheets, Google Gemini (PaLM) API, and Slack.
  3. Google Sheets Node ("Get row(s) in sheet"):
    • Select your Google Sheet containing the tweet data.
    • Choose the specific sheet name from the dropdown.
    • Ensure your sheet has a column named action taken so the filter works correctly.
  4. Google Gemini Chat Model Node: Select your Google Gemini credential from the dropdown.
  5. Slack Nodes ("Send a message" & "Send a message1"):
    • In the first Slack node, choose the channel for the summary report.
    • In the second Slack node, choose the channel for urgent alerts.
  6. Save and Activate: Once configured, save your workflow and turn it on!

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 2 - Append row in sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 3 - Count

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 4 - counter

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 5 - If

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 6 - Limit

Type / Role
n8n-nodes-base.limit - limit
Config choices
Version 1

Block 7 - set increase

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 8 - Code1

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - set count and cursor

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 10 - Wait

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 11 - Switch

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 12 - Google Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 13 - getTweetsFromDatabase

Type / Role
n8n-nodes-base.googleSheetsTool - googleSheetsTool
Config choices
Version 4.7

Block 14 - Append row in sheet1

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 15 - Aggregate

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

Block 16 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Translator

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 22 - Tweet Scraper

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 23 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Showing the first 24 of 42 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow X (Twitter) brand sentiment analysis with Gemini AI & Slack alerts
Complexity advanced
Nodes 42
Categories Market Research, AI Summarization
Author Saeculum Solutions
Published 09 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9400/9400.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does X (Twitter) brand sentiment analysis with Gemini AI & Slack alerts do?

This workflow is the AI analysis and alerting engine for a complete social media monitoring system. It's designed to work with data scraped from X (formerly Twitter) using a tool like the Apify Twe...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Market Research, AI Summarization use case.