We use cookies to understand how you use our site and improve your experience. Privacy Policy

Back to Blog
Automation Workflows

How to Build an n8n Gmail + Slack Integration Workflow (Step-by-Step)

n8n
n8n Resources Team
July 11, 2026

Ready to automate?

Browse 5,000+ copy-paste n8n workflow templates.

Want new emails to land as Slack messages automatically? In n8n, connect a Gmail Trigger node to a Slack node and every matching email posts to the channel you choose within seconds. Add an IF node in the middle to filter by sender, subject, or keyword so only the emails that matter interrupt your team. The full workflow takes about ten minutes to build, and the paste-ready JSON is at the bottom of this guide.

This is one of the most common automations people ask for, and it is a perfect first "real" n8n workflow because it touches three things you will reuse everywhere: an app trigger, a conditional filter, and an outbound message.

What You Need

  • n8n (self-hosted or n8n Cloud)
  • A Gmail account with API access enabled (OAuth2 credential in n8n)
  • A Slack workspace where you can create an app or use an incoming webhook
  • Two credentials configured in n8n: Gmail OAuth2 and Slack API

If you have not connected Gmail or Slack to n8n before, open Credentials, add a new Gmail OAuth2 API credential, and follow the Google consent screen. For Slack, add a Slack API credential using a bot token with chat:write scope.

Part 1: The Instant Alert Workflow

The core build is three nodes: watch Gmail, check a condition, post to Slack.

Step 1: Add the Gmail Trigger

Add a Gmail Trigger node. Set the poll interval to every minute for near-instant alerts, or every 15 minutes if you are on a rate-limited plan. Under Filters, you can narrow to a specific label (for example Support or Sales) so the workflow only fires on the inbox segment you care about. This keeps noise out before any other node runs.

Step 2: Filter with an IF node

Add an IF node after the trigger. Set a condition on the incoming email fields. A common setup is String, with value 1 as {{ $json.subject }} and an "contains" operator matching a keyword like invoice, urgent, or a client name. You can stack multiple conditions with AND or OR to build a precise filter. Emails that fail the condition simply stop, so nothing reaches Slack.

Step 3: Post to Slack

Add a Slack node on the IF node's true output. Set the operation to Send Message, pick the target channel (for example #support-inbox), and build the message text from the email fields:

New email from {{ $json.from }}
Subject: {{ $json.subject }}

{{ $json.snippet }}

Activate the workflow. The next email matching your filter posts to Slack automatically.

Part 2: Three Variations Worth Building

Once the base flow works, these three adjustments cover most real requests:

(a) Instant alert (the build above). Best for time-sensitive inboxes: support escalations, failed payments, VIP customers. Poll every minute and keep the filter tight.

(b) Daily digest. Swap the Gmail Trigger for a Schedule Trigger set to once per day. Use the Gmail node with the Get Many operation and a date filter for the last 24 hours, then loop the results into a single Slack message. This avoids notification fatigue when the volume is high but not urgent.

(c) Direct message by lookup. Instead of posting to a channel, add a Slack node with the Get User operation to resolve an email address to a Slack user ID, then send a DM. This routes each email to the right person rather than a shared channel, which is useful for lead assignment or on-call rotations.

Paste-Ready Workflow JSON

Copy the JSON below, then in n8n open a new workflow, click the three-dot menu, choose Import from Clipboard, and paste. Reconnect your Gmail and Slack credentials on the two nodes after importing.

{
  "name": "Gmail to Slack Alert",
  "nodes": [
    {
      "parameters": {
        "pollTimes": { "item": [{ "mode": "everyMinute" }] },
        "filters": { "labelIds": ["INBOX"] }
      },
      "id": "gmail-trigger",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "typeVersion": 1,
      "position": [420, 300]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.subject }}",
              "operation": "contains",
              "value2": "urgent"
            }
          ]
        }
      },
      "id": "if-keyword",
      "name": "Keyword Filter",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [660, 300]
    },
    {
      "parameters": {
        "resource": "message",
        "operation": "post",
        "channelId": "#support-inbox",
        "text": "=New email from {{ $json.from }}\nSubject: {{ $json.subject }}\n\n{{ $json.snippet }}"
      },
      "id": "slack-post",
      "name": "Post to Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2,
      "position": [900, 220]
    }
  ],
  "connections": {
    "Gmail Trigger": {
      "main": [[{ "node": "Keyword Filter", "type": "main", "index": 0 }]]
    },
    "Keyword Filter": {
      "main": [[{ "node": "Post to Slack", "type": "main", "index": 0 }]]
    }
  }
}

Change the value2 in the Keyword Filter to your own keyword, and set channelId to your channel. That is the entire workflow.

Troubleshooting

  • No messages arrive in Slack. Confirm the Slack credential has the chat:write scope and that the bot has been invited to the target channel.
  • The trigger never fires. Check that the Gmail label filter matches a label that actually receives mail, and that the workflow is set to Active, not just saved.
  • Too many alerts. Tighten the IF condition, switch to the daily digest variation, or add a second condition on {{ $json.from }} to limit senders.

Frequently Asked Questions

Can I connect Gmail to Slack in n8n without code? Yes. This entire workflow is built with n8n's visual nodes (Gmail Trigger, IF, Slack). No code node is required. The only text you type is the message template and the keyword filter.

How fast does the Slack alert arrive after an email? With the Gmail Trigger polling every minute, alerts arrive within about a minute of the email landing. On rate-limited plans, set a longer poll interval such as 15 minutes.

Can I send the alert to a specific person instead of a channel? Yes. Use the Slack Get User operation to resolve the sender's email to a Slack user ID, then send a direct message instead of posting to a channel.

Is this Gmail to Slack workflow free? The workflow itself runs on your own n8n instance at no extra cost. On n8n Resources you can browse and search related templates for free; copying the paste-ready JSON beyond the free tier needs an n8n Resources Pro subscription.


Want more ready-made building blocks? Explore the full library of Gmail templates and Slack templates, see more email automation use cases, browse 5,000+ n8n workflow templates, or subscribe to unlock unlimited copying of workflow JSON into your n8n instance.

Enjoyed this article?

Share it with others who might find it useful