Are you tired of missing important emails because youβre busy coding or working on other tasks? When an urgent email comes in, you want your whole team to see it instantly so someone can reply right away.
In this post, we will walk through a very simple and powerful way to automate your workflow. We will use n8n to automatically catch new unread emails in Gmail and send them directly to your team's Slack channel.
If you prefer watching a video tutorial, you can follow along step-by-step with our video below:
π Watch the full tutorial on YouTube
Letβs dive into how to build this automation!
π€ What is n8n?
n8n is a visual workflow automation tool. It makes your life easier by acting as a bridge between your favorite apps (like Gmail and Slack). Instead of doing repetitive tasks manually, you can train n8n to do them for you automatically.
π οΈ Step-by-Step Guide
Step 1: Create a New Workflow
Sign in to your n8n account.
From your dashboard, click the "+" button to create a New Workflow.
This will open up a blank canvas where you can build your process.
Step 2: Set Up the Gmail Trigger
We want the automation to start whenever an email arrives.
Click to add a new node and search for Gmail.
Select On Message Received. This tells n8n to trigger whenever a new message lands in your inbox.
Connect your Gmail account by following the authentication steps. Make sure to allow the required permissions so n8n can read the emails.
Pro-tip: Add a filter for "Unread emails only". This ensures n8n only looks at new, unread messages, making the process much cleaner.
Click Fetch to make sure the connection is working. A green checkmark will show that Gmail is properly connected.
Step 3: Connect to Slack
Now, we need to tell n8n where to send that email.
Click the "+" button again to add the next step. Search for Slack.
Choose the action: Send a Message.
Connect and authenticate your Slack workspace.
Once connected, configure the message settings:
Resource: Message
Operation: Send
Target: Channel
Channel ID: Type in the name of your team's channel (e.g., team-alerts).
Step 4: Customize Your Message
You can choose exactly what the Slack message will look like!
Under the message type, select a Simple Message.
You can type in a custom alert at the beginning, like: π¨ ALERT: New Urgent Email!.
To include the actual email text, look at the data coming from the Gmail node. Simply drag and drop the "Snippet" (the email body) directly into the Slack message text area.
Step 5: Execute and Test!
Your nodes are now linked! It's time to test the magic.
Click Execute Workflow.
Send a test email to your connected Gmail address.
Open your Slack channel. Within a minute, you should see your automated message pop up with the exact text from the email you just sent!
π¬ Conclusion
And just like that, your days of manually checking for team emails are over! This is just one small example of how n8n can save you time and make your daily operations smoother.
Support the Channel!
If you found this guide helpful, please head over to the Astapor Technologies YouTube channel.
πΊ Watch the video
π Drop a like
π Subscribe to the channel for more awesome step-by-step automation guides and AI agent tutorials!
Top comments (0)