n8n: Gmail to Slack Automation
Reads Gmail on a schedule, filters important emails, and forwards digests to Slack.
Template
{
"name": "Gmail to Slack Automation",
"nodes": [
{
"name": "Schedule",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1,
"position": [250, 300],
"parameters": {
"rule": { "interval": [{ "field": "minutes", "minutesInterval": 30 }] }
}
},
{
"name": "Read Gmail",
"type": "n8n-nodes-base.gmail",
"typeVersion": 2,
"position": [450, 300],
"parameters": {
"operation": "getAll",
"filters": {
"labelIds": ["INBOX"],
"readStatus": "unread",
"receivedAfter": "={{ $now.minus(30, 'minutes').toISO() }}"
},
"limit": 50
}
},
{
"name": "Filter Important",
"type": "n8n-nodes-base.filter",
"typeVersion": 1,
"position": [650, 300],
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json.from }}",
"operation": "notContains",
"value2": "noreply"
}
]
}
}
},
{
"name": "Format Digest",
"type": "n8n-nodes-base.code",
"typeVersion": 1,
"position": [850, 300],
"parameters": {
"jsCode": "const msgs = items.map(i => `- *${i.json.subject}* from ${i.json.from}`).join('\n'); return [{ json: { text: `:email: *New emails (last 30 min):*\n${msgs || 'No new important emails.'}` } }];"
}
},
{
"name": "Post to Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2,
"position": [1050, 300],
"parameters": {
"resource": "message",
"operation": "post",
"channel": "#email-alerts",
"text": "={{ $json.text }}"
}
}
],
"connections": {
"Schedule": { "main": [[{ "node": "Read Gmail" }]] },
"Read Gmail": { "main": [[{ "node": "Filter Important" }]] },
"Filter Important": { "main": [[{ "node": "Format Digest" }]] },
"Format Digest": { "main": [[{ "node": "Post to Slack" }]] }
},
"active": false,
"settings": {}
}Setup
- 1
Copy the workflow JSON above.
- 2
In n8n, go to Workflows and click Import.
- 3
Paste the JSON and update credential references.
- 4
Activate the workflow.
Import into n8n
This is an n8n workflow. Import it directly into your n8n instance.
- 1
Open your n8n instance (localhost:5678 or your cloud URL).
- 2
Go to Workflows and click the + New button.
- 3
Click the three-dot menu in the top right, then select "Import from JSON".
- 4
Paste the workflow JSON from the template above.
- 5
Update any placeholder values (channel names, webhook URLs, credentials).
- 6
Activate the workflow with the toggle in the top right.
# Alternatively, import via n8n CLI:
n8n import:workflow --input=workflow.jsonVersion History
Framework
N8nRequirements
File type
Version
Updated Mar 16, 2026
You might also like
Email Triage Bot
Scan your inbox every morning. Flag what matters, summarize the rest.
~$0.30/day · ~5 min setup
Daily Standup Reporter
Generate standup reports from git, calendar, and tasks. Post to your team channel.
~$0.15/day · ~5 min setup
Calendar Prep
Brief you on upcoming meetings with context from email and docs.
~$0.25/day · ~5 min setup