Opening Problem Statement
Meet Sarah, an online store manager running a WooCommerce shop that sells custom art supplies. Every time a customer places an order, Sarah had to manually notify her sales and fulfillment teams by sending messages on Mattermost. This process was not only time-consuming, often taking up 15-20 minutes per order, but also prone to delays and errors. Sometimes, team members missed orders because manual notifications were delayed or overlooked, leading to longer processing times and unhappy customers.
Sarah needed a way to send instant, automatic alerts to her Mattermost channels whenever a new WooCommerce order was created, freeing up her time and ensuring her team never missed a sale. This exact challenge is what our n8n workflow solves.
What This Automation Does
This automation seamlessly connects your WooCommerce store to Mattermost to send instant order notifications. Here’s what happens when this workflow runs:
- Monitors WooCommerce for every newly created order (trigger).
- Extracts key customer information from the order, like the buyer’s first name.
- Fetches details of the first item purchased in the order.
- Automatically crafts a friendly message for your Mattermost team channel.
- Sends this message immediately to a specified Mattermost channel, such as your sales or fulfillment team chat.
- Keeps the team updated in real time to speed up order processing and improve collaboration.
This workflow saves you about 15-20 minutes per order notification and boosts team responsiveness by eliminating manual communication.
Prerequisites ⚙️
- WooCommerce: Your online store must be running on WooCommerce with API access enabled.
- Mattermost account: Have an account and a channel where you want to send order alerts.
- n8n account: Use n8n automation platform (cloud or self-hosted) to build and run the workflow.
- WooCommerce API Credentials: Ensure API keys with read access for your store.
- Mattermost API Token: Generate a bot token with permission to post messages in the desired channel.
- Optional: Self-hosting your n8n instance can be done via providers like Hostinger (https://buldrr.com/hostinger) for more control and security.
Step-by-Step Guide to Build This Workflow
Step 1: Create Your n8n Workflow
Log in to your n8n environment, click New Workflow. You should see a blank canvas ready for your nodes.
Step 2: Add WooCommerce Trigger Node
Click on the ‘+’ icon → Select WooCommerce Trigger node.
Configure it as follows:
- Event: Select
order.createdso the workflow triggers whenever a new order is placed. - Webhook ID: Let n8n generate or use your own unique webhook ID.
- Credentials: Link your WooCommerce API credentials here.
Once configured, save the node. You should see the trigger waiting for incoming data.
Common mistake: Forgetting to enable the webhook or incorrect API credentials will prevent the trigger from activating.
Step 3: Add Mattermost Node to Send Message
Click ‘+’ → Choose Mattermost node.
Configure the message to include buyer and product info as follows:
- In the
Messagefield, enter:={{$node["WooCommerce Trigger"].json["billing"]["first_name"]}} bought {{$node["WooCommerce Trigger"].json["line_items"][0]["name"]}}! - Set the
Channel IDto your target Mattermost channel (e.g.,pj1p95ebei8g3ro5p84kxxuuio). - Leave
Attachmentsempty or customize as desired. - Attach your Mattermost API credentials.
After saving, this node will send chat messages when triggered.
Common mistake: Incorrect channel ID or missing API token causes message delivery failure.
Step 4: Connect the Nodes
Drag from WooCommerce Trigger node output to the Mattermost node input to create a connection.
This defines the workflow path for data.
Step 5: Activate the Workflow
Toggle the workflow status to Active.
Test by placing a new order on your WooCommerce store to see if the Mattermost channel receives the alert.
Customizations ✏️
1. Customize Message Content
In the Mattermost node, modify the Message field to include more order details, like total price or customer email:
={{$node["WooCommerce Trigger"].json["billing"]["first_name"]}} bought {{$node["WooCommerce Trigger"].json["line_items"][0]["name"]}} for ${{$node["WooCommerce Trigger"].json["total"]}} ({{$node["WooCommerce Trigger"].json["billing"]["email"]}})!This gives a fuller context to your team.
2. Notify Multiple Channels
Add additional Mattermost nodes targeting other channels, such as the fulfillment or marketing teams.
3. Include Attachments
Attach images or invoices by adding attachments in the Mattermost node’s Attachments property.
Troubleshooting 🔧
Problem: “Webhook never receives data from WooCommerce.”
Cause: Incorrect webhook URL or WooCommerce settings.
Solution: Double-check the webhook URL from WooCommerce trigger node. Ensure your WooCommerce store has the webhook properly set to send order.created events to n8n’s webhook URL.
Problem: “Messages do not post in Mattermost channel.”
Cause: Invalid Mattermost API token or wrong channel ID.
Solution: Verify your Mattermost bot token has posting permissions and confirm the channel ID matches the channel in your Mattermost workspace.
Pre-Production Checklist ✅
- Confirm WooCommerce API keys have read permissions and webhooks are enabled.
- Test Mattermost API credentials by sending a test message through the node.
- Run test orders in WooCommerce to verify workflow triggers and delivers messages.
- Backup your workflow configurations before major edits.
Deployment Guide
Once you confirm all tests work, activate your workflow in n8n.
Monitor initial orders and Mattermost messages to ensure consistent delivery.
Regularly review logs in n8n to catch any silent failures.
FAQs
Q: Can I use Slack instead of Mattermost?
A: Yes, but you’ll need to replace the Mattermost node with Slack node and update credentials and channel IDs accordingly.
Q: Does this workflow consume API credits?
A: WooCommerce and Mattermost APIs typically don’t have strict limits for regular usage, but keep an eye on your API rate limits if your store is very busy.
Q: Is my data secure?
A: Since you control the API credentials and n8n environment, ensure your instance is secured by using HTTPS and strong authentication methods.
Conclusion
By following this guide, you’ve automated the tedious task of notifying your Mattermost channels when new WooCommerce orders arrive. For Sarah and online store owners like her, this saves precious time daily and ensures the team acts faster on orders, reducing errors and delays.
Next, consider automating order status updates, inventory alerts, or customer feedback collection to further streamline your WooCommerce operations.
With n8n, the possibilities to enhance your e-commerce workflow are only limited by your imagination!