Automate Twitter Mention Alerts with n8n & RocketChat

Struggling to keep up with every @mention on Twitter? This n8n workflow automatically tracks new mentions of @n8n_io and instantly sends alerts to your RocketChat channel, saving you precious monitoring time and ensuring no conversation slips past unnoticed.
twitter
rocketchat
cron
+3
Workflow Identifier: 1479
NODES in Use: Manual Trigger, Set, Function, Twitter, RocketChat, Cron

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

1. The Real Challenge: Keeping Track of Twitter Mentions for Jane

This workflow checks Twitter every minute for new mentions of @n8n_io. It finds new tweets mentioning the handle, filters out duplicates, and sends alerts to a RocketChat channel. This way, the team stays updated in real time without manual tracking.

It helps avoid missed tweets, late responses, and saves about 2 hours daily of manual work.


2. What This Automation Does for Jane

This workflow runs every minute to search for fresh Twitter mentions of @n8n_io.

It collects tweet text, tweet ID, and builds the tweet URL.

It keeps a saved list of old tweet IDs, so only brand new mentions trigger alerts.

Alerts are formatted nicely and sent right to a RocketChat channel.

The result is instant team notification, faster replies, and no missed tweets.


3. Prerequisites ⚙️

  • Twitter account with developer access: the OAuth1 API Key is needed to search Twitter mentions.
  • RocketChat workspace and API credentials: needed to post messages automatically.
  • n8n account: use cloud or self-host n8n to run the workflow.
  • Optional hosting provider like Hostinger to control your n8n instance.

4. Beginner Step-by-step: How to Use This Workflow in n8n Production

Download and Import Workflow

  1. Click the Download button on this page to save the workflow file.
  2. Open the n8n editor where you want to run the workflow.
  3. Use Import from File to upload the saved workflow.

Configure the Workflow

  1. Add Twitter OAuth1 credentials under n8n Settings > Credentials.
  2. Add RocketChat API credentials for message posting.
  3. Update any channel names or IDs, such as the RocketChat channel, if different from the default.
  4. If the workflow uses expressions or code, verify and update them as needed.

Test and Activate

  1. Run the workflow once manually to confirm it fetches tweets and sends messages.
  2. If all works, Activate the workflow to let it run automatically.
  3. Monitor activity and check RocketChat for new alerts.

5. Workflow Inputs, Processing, and Outputs

Inputs

  • Twitter API returns recent tweets that mention @n8n_io.
  • Cron trigger runs every 1 minute to start the workflow.

Processing Steps

  • The workflow extracts Tweet text, Tweet ID, and builds Tweet URL.
  • A Function node compares current Tweet IDs to stored ones to find new tweets only.
  • New mentions are formatted and prepared for sending.

Outputs

  • Formatted messages are posted automatically to the defined RocketChat channel.
  • The team receives alerts instantly to respond.

6. Edge Cases and Common Failures

  • If Twitter API credentials are wrong, the workflow fails with 401 errors.
  • If RocketChat channel name is wrong or API token is revoked, messages do not appear.
  • Clearing the static data causes duplicate tweet alerts.
  • Missing to activate the workflow or nodes will stop automation.

7. Customization Ideas ✏️

  • Change the Twitter handle in the Twitter node to watch other accounts.
  • Adjust Cron timing for less frequent tweet checks, like every 5 or 10 minutes.
  • Send alerts to different RocketChat channels for different teams.
  • Add more tweet details such as username, follower count, or tweet creation time.

8. Deployment Guide

After testing, activate the workflow in n8n.

Cron runs every minute checking Twitter automatically.

Watch logs for errors or performance issues.

Change Cron frequency based on team needs.

Use error alerting if this workflow is critical.


9. Conclusion

This workflow helps save time by automating Twitter mention alerts.

It lets teams respond faster and keep track easily.

It works inside n8n with simple setup and real-time updates.

Consider adding automated replies or analytics next.

With this setup, managing Twitter mentions becomes easier for any team.


10. Code Snippet for Filtering New Tweets

The Function node below compares fetched tweet IDs with stored IDs to keep only new tweets for alerts.

const staticData = getWorkflowStaticData('global');
const newTweetIds = items.map(item => item.json["Tweet ID"]);
const oldTweetIds = staticData.oldTweetIds;

if (!oldTweetIds) {
  staticData.oldTweetIds = newTweetIds;
  return items;
}

const actualNewTweetIds = newTweetIds.filter((id) => !oldTweetIds.includes(id));
const actualNewTweets = items.filter((data) => actualNewTweetIds.includes(data.json['Tweet ID']));
staticData.oldTweetIds = [...actualNewTweetIds, ...oldTweetIds];

return actualNewTweets;

This code keeps track of seen tweet IDs so duplicates do not trigger alerts again.


Frequently Asked Questions

Re-create or refresh Twitter OAuth1 API credentials in the n8n Credentials settings. Test the connection before use.
The RocketChat channel name may be incorrect or the API token is revoked. Verify channel naming and update API credentials.
Clearing workflow static data or modifying the Function node code incorrectly can cause duplicate alerts. Keep the static data intact.
Yes, by duplicating the workflow or modifying the Twitter node to accept a list and using a SplitInBatches node to loop.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free