Integration with Slack, Google Sheets, and Email
Integration with Slack, Google Sheets, and Email
{
"name": "Multi-Channel Notification System",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "notify",
"responseMode": "responseNode"
},
"id": "webhook",
"name": "Incoming Notification",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1.1,
"position": [240, 300]
},
{
"parameters": {
"jsCode": "// Determine notification channels\nconst payload = $input.item.json;\n\nconst channels = [];\n\n// Add channels based on priority\nif (payload.priority === 'high' || payload.priority === 'critical') {\n channels.push('slack');\n channels.push('email');\n}\n\nif (payload.log_to_sheet) {\n channels.push('sheets');\n}\n\nif (channels.length === 0) {\n channels.push('slack'); // Default\n}\n\nreturn {\n ...payload,\n channels,\n processed_at: new Date().toISOString()\n};"
},
"id": "router",
"name": "Route Notification",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [460, 300]
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json.channels.join(',') }}",
"operation": "contains",
"value2": "slack"
}
]
}
},
"id": "slack-filter",
"name": "Send to Slack?",
"type": "n8n-nodes-base.filter",
"typeVersion": 2,
"position": [680, 200]
},
{
"parameters": {
"channel": "={{ $json.priority === 'critical' ? '#critical-alerts' : '#notifications' }}",
"text": "=*{{ $json.title }}*\n\n{{ $json.message }}\n\nPriority: {{ $json.priority }}\nSource: {{ $json.source }}",
"attachments": [],
"otherOptions": {}
},
"id": "slack",
"name": "Post to Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2.1,
"position": [900, 200],
"credentials": {
"slackApi": {
"id": "3",
"name": "Slack Bot"
}
}
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json.channels.join(',') }}",
"operation": "contains",
"value2": "email"
}
]
}
},
"id": "email-filter",
"name": "Send Email?",
"type": "n8n-nodes-base.filter",
"typeVersion": 2,
"position": [680, 300]
},
{
"parameters": {
"sendTo": "={{ $json.recipient_email || 'team@example.com' }}",
"subject": "=[{{ $json.priority.toUpperCase() }}] {{ $json.title }}",
"emailType": "html",
"html": "=<h2>{{ $json.title }}</h2>\n<p>{{ $json.message }}</p>\n<hr>\n<p><strong>Priority:</strong> {{ $json.priority }}</p>\n<p><strong>Source:</strong> {{ $json.source }}</p>\n<p><strong>Time:</strong> {{ $json.processed_at }}</p>"
},
"id": "email",
"name": "Send Email",
"type": "n8n-nodes-base.emailSend",
"typeVersion": 2.1,
"position": [900, 300],
"credentials": {
"smtp": {
"id": "5",
"name": "SMTP"
}
}
},
{
"parameters": {
"conditions": {
"string": [
{
"value1": "={{ $json.channels.join(',') }}",
"operation": "contains",
"value2": "sheets"
}
]
}
},
"id": "sheets-filter",
"name": "Log to Sheets?",
"type": "n8n-nodes-base.filter",
"typeVersion": 2,
"position": [680, 400]
},
{
"parameters": {
"operation": "append",
"documentId": {
"__rl": true,
"value": "={{ $env.GOOGLE_SHEET_ID }}",
"mode": "id"
},
"sheetName": {
"__rl": true,
"value": "Notifications",
"mode": "list"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"Timestamp": "={{ $json.processed_at }}",
"Title": "={{ $json.title }}",
"Message": "={{ $json.message }}",
"Priority": "={{ $json.priority }}",
"Source": "={{ $json.source }}"
}
}
},
"id": "sheets",
"name": "Log to Google Sheets",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.1,
"position": [900, 400],
"credentials": {
"googleSheetsOAuth2Api": {
"id": "6",
"name": "Google Sheets"
}
}
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{ JSON.stringify({ success: true, channels: $json.channels }) }}"
},
"id": "respond",
"name": "Respond",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1,
"position": [1120, 300]
}
],
"connections": {
"Incoming Notification": {
"main": [
[{ "node": "Route Notification", "type": "main", "index": 0 }]
]
},
"Route Notification": {
"main": [
[
{ "node": "Send to Slack?", "type": "main", "index": 0 },
{ "node": "Send Email?", "type": "main", "index": 0 },
{ "node": "Log to Sheets?", "type": "main", "index": 0 }
]
]
},
"Send to Slack?": {
"main": [
[{ "node": "Post to Slack", "type": "main", "index": 0 }]
*Content truncated — see parent skill for full reference.*
1---2name: n8n-integration-with-slack-google-sheets-and-email3description: Sub-skill of n8n: Integration with Slack, Google Sheets, and Email.4---56# Integration with Slack, Google Sheets, and Email78## Integration with Slack, Google Sheets, and Email91011```json12{13 "name": "Multi-Channel Notification System",14 "nodes": [15 {16 "parameters": {17 "httpMethod": "POST",18 "path": "notify",19 "responseMode": "responseNode"20 },21 "id": "webhook",22 "name": "Incoming Notification",23 "type": "n8n-nodes-base.webhook",24 "typeVersion": 1.1,25 "position": [240, 300]26 },27 {28 "parameters": {29 "jsCode": "// Determine notification channels\nconst payload = $input.item.json;\n\nconst channels = [];\n\n// Add channels based on priority\nif (payload.priority === 'high' || payload.priority === 'critical') {\n channels.push('slack');\n channels.push('email');\n}\n\nif (payload.log_to_sheet) {\n channels.push('sheets');\n}\n\nif (channels.length === 0) {\n channels.push('slack'); // Default\n}\n\nreturn {\n ...payload,\n channels,\n processed_at: new Date().toISOString()\n};"30 },31 "id": "router",32 "name": "Route Notification",33 "type": "n8n-nodes-base.code",34 "typeVersion": 2,35 "position": [460, 300]36 },37 {38 "parameters": {39 "conditions": {40 "string": [41 {42 "value1": "={{ $json.channels.join(',') }}",43 "operation": "contains",44 "value2": "slack"45 }46 ]47 }48 },49 "id": "slack-filter",50 "name": "Send to Slack?",51 "type": "n8n-nodes-base.filter",52 "typeVersion": 2,53 "position": [680, 200]54 },55 {56 "parameters": {57 "channel": "={{ $json.priority === 'critical' ? '#critical-alerts' : '#notifications' }}",58 "text": "=*{{ $json.title }}*\n\n{{ $json.message }}\n\nPriority: {{ $json.priority }}\nSource: {{ $json.source }}",59 "attachments": [],60 "otherOptions": {}61 },62 "id": "slack",63 "name": "Post to Slack",64 "type": "n8n-nodes-base.slack",65 "typeVersion": 2.1,66 "position": [900, 200],67 "credentials": {68 "slackApi": {69 "id": "3",70 "name": "Slack Bot"71 }72 }73 },74 {75 "parameters": {76 "conditions": {77 "string": [78 {79 "value1": "={{ $json.channels.join(',') }}",80 "operation": "contains",81 "value2": "email"82 }83 ]84 }85 },86 "id": "email-filter",87 "name": "Send Email?",88 "type": "n8n-nodes-base.filter",89 "typeVersion": 2,90 "position": [680, 300]91 },92 {93 "parameters": {94 "sendTo": "={{ $json.recipient_email || 'team@example.com' }}",95 "subject": "=[{{ $json.priority.toUpperCase() }}] {{ $json.title }}",96 "emailType": "html",97 "html": "=<h2>{{ $json.title }}</h2>\n<p>{{ $json.message }}</p>\n<hr>\n<p><strong>Priority:</strong> {{ $json.priority }}</p>\n<p><strong>Source:</strong> {{ $json.source }}</p>\n<p><strong>Time:</strong> {{ $json.processed_at }}</p>"98 },99 "id": "email",100 "name": "Send Email",101 "type": "n8n-nodes-base.emailSend",102 "typeVersion": 2.1,103 "position": [900, 300],104 "credentials": {105 "smtp": {106 "id": "5",107 "name": "SMTP"108 }109 }110 },111 {112 "parameters": {113 "conditions": {114 "string": [115 {116 "value1": "={{ $json.channels.join(',') }}",117 "operation": "contains",118 "value2": "sheets"119 }120 ]121 }122 },123 "id": "sheets-filter",124 "name": "Log to Sheets?",125 "type": "n8n-nodes-base.filter",126 "typeVersion": 2,127 "position": [680, 400]128 },129 {130 "parameters": {131 "operation": "append",132 "documentId": {133 "__rl": true,134 "value": "={{ $env.GOOGLE_SHEET_ID }}",135 "mode": "id"136 },137 "sheetName": {138 "__rl": true,139 "value": "Notifications",140 "mode": "list"141 },142 "columns": {143 "mappingMode": "defineBelow",144 "value": {145 "Timestamp": "={{ $json.processed_at }}",146 "Title": "={{ $json.title }}",147 "Message": "={{ $json.message }}",148 "Priority": "={{ $json.priority }}",149 "Source": "={{ $json.source }}"150 }151 }152 },153 "id": "sheets",154 "name": "Log to Google Sheets",155 "type": "n8n-nodes-base.googleSheets",156 "typeVersion": 4.1,157 "position": [900, 400],158 "credentials": {159 "googleSheetsOAuth2Api": {160 "id": "6",161 "name": "Google Sheets"162 }163 }164 },165 {166 "parameters": {167 "respondWith": "json",168 "responseBody": "={{ JSON.stringify({ success: true, channels: $json.channels }) }}"169 },170 "id": "respond",171 "name": "Respond",172 "type": "n8n-nodes-base.respondToWebhook",173 "typeVersion": 1,174 "position": [1120, 300]175 }176 ],177 "connections": {178 "Incoming Notification": {179 "main": [180 [{ "node": "Route Notification", "type": "main", "index": 0 }]181 ]182 },183 "Route Notification": {184 "main": [185 [186 { "node": "Send to Slack?", "type": "main", "index": 0 },187 { "node": "Send Email?", "type": "main", "index": 0 },188 { "node": "Log to Sheets?", "type": "main", "index": 0 }189 ]190 ]191 },192 "Send to Slack?": {193 "main": [194 [{ "node": "Post to Slack", "type": "main", "index": 0 }]195196*Content truncated — see parent skill for full reference.*