What This Workflow Does
This workflow checks Twitter every minute to find new tweets mentioning “n8n_io”. It stops repeated tweets and sends new tweet info to a Mattermost channel. This saves lots of time from looking manually and helps teams act fast on important tweets.
The workflow works by receiving input from Twitter, organizing tweet details, filtering old tweets, and finally posting fresh tweets to Mattermost. You get quick, clean updates about mentions without missing any.
Tools and Services Used
- Twitter API: To search recent tweets containing “n8n_io” keyword.
- Mattermost API: To post tweet messages into a team chat channel.
- n8n automation platform: To build and run the workflow nodes.
- OAuth1 credentials: For Twitter API authentication.
- Mattermost API token: For permission to send messages.
Inputs, Processing Steps, and Output
Inputs
- Twitter API credentials with read access.
- Search keyword “n8n_io”.
- Mattermost API token and target channel ID.
Processing Steps
- Cron node triggers workflow every minute.
- Twitter node searches tweets mentioning “n8n_io”.
- Set node extracts key tweet data like ID, URL, username, text, photo, name, and profile color.
- Function node filters out tweets already processed to avoid duplicates.
- Mattermost node posts formatted messages with tweet info into a Mattermost channel.
Output
Fresh tweets about “n8n_io” are posted live and cleaned in a dedicated Mattermost channel for the team.
Beginner Step-by-Step: How to Use This Workflow in n8n
Importing and Setup
- Download the workflow file using the Download button on this page.
- Open n8n editor and click “Import from File” to load the downloaded workflow.
- After import, open each node and add required credentials or API Keys:
- Insert Twitter OAuth1 credentials in the Twitter node.
- Insert Mattermost API token in the Mattermost node.
- Update the Mattermost Channel ID in the Mattermost node to your target channel.
- Check that the Code expression in the Function node matches this:
const new_items = [];
const data = this.getWorkflowStaticData('node');
data.ids = data.ids || [];
for (var i=0; i item.json.id)
return new_items;
Testing and Activation
- Run the workflow once manually to test if tweets are fetched and posted to Mattermost correctly.
- Look for any errors in the execution tab. Fix credential or node config if needed.
- When tests pass, activate the workflow by switching it to Active mode.
This ready-to-use setup saves time by automating tweet monitoring and team alerts without building from zero.
Common Problems and Fixes
No tweets found even though recent mentions exist
This may happen if Twitter API limits are reached or search query is invalid.
Check your Twitter OAuth1 credentials and API quota.
Make sure the search keyword “n8n_io” is correct and there are tweets matching.
Mattermost node fails to send messages
Wrong API token, channel ID, or permission issues cause errors.
Verify the Mattermost API token and update the channel ID to the right one.
Ensure your token has posting rights.
Customization Ideas
- Change keyword “n8n_io” in the Twitter node to track other topics.
- Adjust the Cron node to run every 5 or 10 minutes instead of every minute.
- Add more data fields in the Set node to include extra tweet info like retweet count.
- Alter message style or colors in the Mattermost node to match team branding.
- Duplicate the Mattermost node to post in multiple channels.
Deployment and Production Notes
Turn on the workflow in n8n to run live on schedule.
Use cloud or self-host n8n options depending on your preference.
Watch executions and errors after deployment to ensure stable operation.
Adjust frequency or keywords later to fit team needs.
Summary of Workflow Benefits
✓ Saves hours weekly by automating tweet finding and sharing.
✓ Prevents duplicate notifications with smart filtering.
✓ Keeps team quickly informed in Mattermost about Twitter mentions.
✓ Easy to import, configure, test, and activate in n8n.
