Automate Google Sheets Updates to Mattermost with n8n

Struggling to keep your Mattermost team updated with fresh Google Sheets data? This n8n workflow automates checking and posting new sheet entries every 45 minutes, eliminating manual updates and ensuring your team never misses key info.
googleSheets
mattermost
function
+1
Workflow Identifier: 1627
NODES in Use: interval, googleSheets, function, mattermost

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

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What This Automation Does

This workflow reads a Google Sheet every 45 minutes and finds new rows added since last check.
Then it sends messages about these new entries to a Mattermost channel.
This saves manual copying and posting, avoiding duplicates and delays.

It stores which rows were sent using static data, so it only alerts for new items.
The messages include important info like ID, Name, and Email.


Who Should Use This Workflow

This is for people who want to automatically watch a shared Google Sheet for changes.
Anyone tired of copying data by hand and sending manual updates will save time.

It is good for teams using Google Sheets as a data source and Mattermost as their chat tool.
It works well if frequent updates come in and timely notifications are needed.


Tools and Services Used

  • n8n: The automation platform running the workflow.
  • Google Sheets API: Provides access to the spreadsheet data.
  • Mattermost API: Sends messages to the team chat.
  • OAuth2 Credentials: For secure Google Sheets access.

Inputs, Processing, and Output

Inputs

  • Google Sheet with columns named “ID”, “Name”, and “Email”.
  • Mattermost channel details and API credentials.
  • n8n workflow scheduled to run every 45 minutes.

Processing Steps

  • Interval timer triggers every 45 minutes.
  • Google Sheets node reads all rows.
  • Function node compares current row IDs with stored IDs to find new entries.
  • Static data in Function node stores seen IDs to prevent repeats.
  • Mattermost node sends messages to the channel with new info.

Output

  • Formatted messages posted in Mattermost for each new Google Sheet data row.
  • No duplicate messages for rows already sent.

Beginner Step-by-Step: How to Use This Workflow in n8n

Download and Import Workflow

  1. Click the Download button on this page to get the workflow file.
  2. Open n8n editor.
  3. Use “Import from File” to upload the workflow.

Configure Credentials and IDs

  1. Add Google Sheets OAuth2 credentials inside n8n.
  2. Add Mattermost API credentials with correct URL and API Key.
  3. Update the Google Sheet ID to match your sheet.
  4. Update Mattermost channel or team information if needed.

Test and Activate

  1. Run the workflow manually once to check if data pulls and messages send.
  2. Look for messages in the Mattermost channel.
  3. Fix any errors in credentials or sheet ID if no messages appear.
  4. Activate the workflow to run automatically every 45 minutes.

If self hosting n8n, make sure server uptime is good to avoid missed runs. See self-host n8n info for help.


Details of the Check for New Data Code

The Function node runs JavaScript code that compares current rows with saved row IDs.
Rows with IDs already saved are skipped.

Only rows with unseen IDs get sent as new items.
After processing, the saved IDs list updates to current row IDs.

const new_items = [];
const data = this.getWorkflowStaticData("node");
data.ids = data.ids || [];
for (let i = items.length - 1; i >= 0; i--) {
  if (data.ids.includes(items[i].json.ID)) {
    break;
  } else {
    new_items.push({
      json: {
        id: items[i].json.ID,
        name: items[i].json.Name,
        email: items[i].json.Email
      },
    });
  }
}
data.ids = items.map((item) => item.json.ID);
return new_items;

Column names like “ID”, “Name”, and “Email” must match exactly with your sheet.
Otherwise the code won’t find data properly.


Customization Ideas

  • Change how often the Interval node runs; for example, every 30 or 60 minutes.
  • Add extra Google Sheet columns in the Function node code and Mattermost message.
  • Filter rows in the Function code to send only based on criteria like a status column.

Common Problems and Fixes

Function Node Returns No Data

Possible cause is the Google Sheets node returned no data or column names mismatched.
Check Sheet ID and OAuth2 credentials.
Verify that sheet columns are exactly “ID”, “Name”, and “Email”.

Mattermost Node Fails to Send Message

This happens due to wrong API credentials or wrong API URL.
Check Mattermost API token and base URL.
Try sending a simple test message.


Pre-Production Checklist

  • Confirm correct Google Sheet ID and OAuth2 permissions to read data.
  • Make sure Mattermost API token has permission to post messages.
  • Test the Function node logic with sample data before activating.
  • Run a manual test to verify messages post in Mattermost.
  • Backup Google Sheet data in case rollback is needed.

Deployment Guide

After testing is complete, activate the workflow.
It will run every 45 minutes automatically.

Watch the execution history in n8n dashboard to catch errors quickly.
Set error notifications in n8n if possible.
If running on your own server, visit self-host n8n to ensure reliable uptime.


Summary

✓ Saves time by automatically reading Google Sheets and posting updates.
✓ Prevents repeated notifications by tracking processed data.
✓ Keeps team informed regularly every 45 minutes.
✓ Easy to set up with clear configuration steps.
✓ Can customize frequency and data fields.
✓ Works well for those using Google Sheets and Mattermost together.


Frequently Asked Questions

The workflow uses static data storage inside a Function node to track processed row IDs. It compares current sheet IDs with saved IDs and sends messages only for new ones.
OAuth2 credentials are required for Google Sheets access. Mattermost needs an API token and proper API URL configured in the workflow credentials.
Download the prebuilt workflow file, import it into n8n using “Import from File,” add Google Sheets and Mattermost credentials, update IDs and channels, then test and activate.
Yes. Change the Interval node timing to adjust frequency. Update the Function node code and Mattermost message template to include extra or different columns from Google Sheets.

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