Communication

Route important Gmail messages to Slack channels

43 nodes 144 73 Webhook
Download

Workflow Description

Automation that captures incoming emails from Gmail based on custom criteria and instantly forwards them to designated Slack channels with full context preserved. Includes database logging for audit trails and compliance tracking across your team communication.

How it works

  1. 1.Receive email notifications from Gmail via webhook monitoring new incoming messages
  2. 2.Apply filtering conditions to identify priority emails based on sender, subject, or content rules
  3. 3.Send formatted message to the appropriate Slack channel with sender details and email content
  4. 4.Log all forwarded messages in Postgres database for tracking and historical reference

Use cases

  • Alert sales team immediately when high-priority customer emails arrive
  • Distribute daily reports from email inbox to relevant team channels automatically
  • Route support tickets from email to dedicated Slack channels for faster response

Requirements

  • Active Gmail account with app password or OAuth credentials configured
  • Slack workspace with channel management and message posting permissions
  • Postgres database connection for storing message logs and audit history

Service Value

Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.

Apps Used

Postgres Gmail Slack

Details

Trigger Webhook
Nodes 43
Apps 3
Views 144
Downloads 73

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (43)

/

Extract relevant data

Set

#1

New /login event

Webhook

#2

Unknown threat?

If

#3

Get last 10 logins from the same user

Postgres

#4

Query IP API1

HTTP Request

#5

New location?

If

#6

Parse User Agent

HTTP Request

#7

Merge

Merge

#8

New Device/Browser?

If

#9

Complete login info

Merge

#10

Query user by ID

Postgres

#11

New Location

No Op

#12

New Device/Browser

No Op

#13

User has email?

If

#14

HTML

HTML Page

#15

Inform user

Gmail

#16

noise?

If

#17

Slack

Slack

#18

Check trust level

Switch

#19

Check classification

Switch

#20

Sticky Note2

Sticky Note

#21

Sticky Note3

Sticky Note

#22

Sticky Note4

Sticky Note

#23

Sticky Note5

Sticky Note

#24

Sticky Note9

Sticky Note

#25

Sticky Note10

Sticky Note

#26

riot?

If

#27

🔴 Priority: HIGH

Set

#28

🟡 Priority: MEDIUM

Set

#29

🟢 Priority: LOW

Set

#30

GreyNoise

HTTP Request

#31

IP API

HTTP Request

#32

UserParser

HTTP Request

#33

When clicking "Execute Workflow"

Manual Trigger

#34

Example event

Code

#35

Sticky Note7

Sticky Note

#36

Sticky Note11

Sticky Note

#37

Sticky Note12

Sticky Note

#38

Sticky Note13

Sticky Note

#39

Known, Do Nothing

No Op

#40

Known Location

No Op

#41

Old Device/Browser

No Op

#42

Not Riot

No Op

#43