This workflow follows the Gmail → Google Sheets recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "Cold email Agent",
"nodes": [
{
"parameters": {
"path": "unsubscribe",
"responseMode": "responseNode",
"options": {}
},
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
-3904,
-1120
],
"id": "16616cb7-6640-48a5-9cab-3e35f679dfcf",
"name": "Webhook"
},
{
"parameters": {
"respondWith": "redirect",
"redirectURL": "https://your-privacy-is-importan-n27zrwo.gamma.site/",
"options": {}
},
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.1,
"position": [
-3200,
-1120
],
"id": "f5cdc6ad-e831-4cfd-9893-61c2bea3868b",
"name": "Respond to Webhook"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "2ab238a7-b568-428d-a6d7-f855b8adcdf8",
"name": "token",
"value": "={{ $json.query.tkn }}",
"type": "number"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-3680,
-1120
],
"id": "911704f5-fb02-4a99-b2d3-dc30b1e8747b",
"name": "Edit Fields2"
},
{
"parameters": {
"operation": "update",
"documentId": {
"__rl": true,
"value": "1pY5nJihyUUObA1LpbhdgANq0DSX7A9TLOTWlEr9PMBk",
"mode": "list",
"cachedResultName": "Research",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pY5nJihyUUObA1LpbhdgANq0DSX7A9TLOTWlEr9PMBk/edit?usp=drivesdk"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "Sheet1",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pY5nJihyUUObA1LpbhdgANq0DSX7A9TLOTWlEr9PMBk/edit#gid=0"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"Token": "={{ $json.token }}",
"Opted Out": "Yes"
},
"matchingColumns": [
"Token"
],
"schema": [
{
"id": "First Name",
"displayName": "First Name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Last Name",
"displayName": "Last Name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email Address",
"displayName": "Email Address",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Phone Number",
"displayName": "Phone Number",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Country ",
"displayName": "Country ",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Location",
"displayName": "Location",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Industry",
"displayName": "Industry",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Company Name",
"displayName": "Company Name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Job Title",
"displayName": "Job Title",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Seniority",
"displayName": "Seniority",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Website URL",
"displayName": "Website URL",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "LinkedIn URL",
"displayName": "LinkedIn URL",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Analysed",
"displayName": "Analysed",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Research Report",
"displayName": "Research Report",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#1 Body",
"displayName": "Email#1 Body",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#1 Subject",
"displayName": "Email#1 Subject",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email #2 Body",
"displayName": "Email #2 Body",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#3 Body",
"displayName": "Email#3 Body",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#3 Subject",
"displayName": "Email#3 Subject",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Sender Email",
"displayName": "Sender Email",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Time Zone",
"displayName": "Time Zone",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#1 Sent",
"displayName": "Email#1 Sent",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#2 Sent",
"displayName": "Email#2 Sent",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#3 Sent",
"displayName": "Email#3 Sent",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Message ID",
"displayName": "Message ID",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Replied",
"displayName": "Replied",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Token",
"displayName": "Token",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "Opted Out",
"displayName": "Opted Out",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "row_number",
"displayName": "row_number",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"readOnly": true,
"removed": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
-3408,
-1120
],
"id": "16241a8e-2eb4-4d36-8335-71665a22d2f0",
"name": "Google Sheets2",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"rule": {
"interval": [
{
"field": "cronExpression",
"expression": "0 11 * * Mon"
}
]
}
},
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.2,
"position": [
-1376,
-1472
],
"id": "8d8642a2-25fd-468e-9289-d06121dd86c0",
"name": "Schedule Trigger"
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"leftValue": "={{ $json['Sender Email'] }}",
"rightValue": "kiaghasem.dev@gmail.com",
"operator": {
"type": "string",
"operation": "equals"
},
"id": "b895fd00-6f66-41d1-ab55-b1337e744a7f"
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "kgd"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "b90ae81e-e015-4138-955b-f8efae253fba",
"leftValue": "={{ $json['Sender Email'] }}",
"rightValue": "kia@kamexa.ai",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "k"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "93b60147-610f-4c3c-adf6-a7f8b2159096",
"leftValue": "={{ $json['Sender Email'] }}",
"rightValue": "youremail@gmail.com",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "h"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.switch",
"typeVersion": 3.2,
"position": [
-944,
-1488
],
"id": "9072ed19-175f-4a98-bdd1-43fa57782b9f",
"name": "Switch"
},
{
"parameters": {
"sendTo": "=kiaghasem.dev@gmail.com",
"subject": "={{ $json['Email#1 Subject'] }}",
"message": "={{ $json['Email#1 Body'] }}<br><br>\n<a href=\"https://kiaghasem.app.n8n.cloud/webhook/unsubscribe?tkn={{ $json.Token }}\">Click Here to Unsubscribe</a>",
"options": {
"appendAttribution": false
}
},
"type": "n8n-nodes-base.gmail",
"typeVersion": 2.1,
"position": [
-128,
-1712
],
"id": "d60bd46b-b4aa-48f8-b1fb-b3a3e60d362a",
"name": "Gmail",
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "appendOrUpdate",
"documentId": {
"__rl": true,
"value": "1pY5nJihyUUObA1LpbhdgANq0DSX7A9TLOTWlEr9PMBk",
"mode": "list",
"cachedResultName": "Research",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pY5nJihyUUObA1LpbhdgANq0DSX7A9TLOTWlEr9PMBk/edit?usp=drivesdk"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "Sheet1",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pY5nJihyUUObA1LpbhdgANq0DSX7A9TLOTWlEr9PMBk/edit#gid=0"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"LinkedIn URL": "={{ $('Switch').item.json['LinkedIn URL'] }}",
"Email#1 Sent": "Yes",
"Message ID": "={{ $json.id }}"
},
"matchingColumns": [
"LinkedIn URL"
],
"schema": [
{
"id": "First Name",
"displayName": "First Name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Last Name",
"displayName": "Last Name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email Address",
"displayName": "Email Address",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Phone Number",
"displayName": "Phone Number",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Country ",
"displayName": "Country ",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Location",
"displayName": "Location",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Industry",
"displayName": "Industry",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Company Name",
"displayName": "Company Name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Job Title",
"displayName": "Job Title",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Seniority",
"displayName": "Seniority",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Website URL",
"displayName": "Website URL",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "LinkedIn URL",
"displayName": "LinkedIn URL",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "Analysed",
"displayName": "Analysed",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Research Report",
"displayName": "Research Report",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#1 Body",
"displayName": "Email#1 Body",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#1 Subject",
"displayName": "Email#1 Subject",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email #2 Body",
"displayName": "Email #2 Body",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#3 Body",
"displayName": "Email#3 Body",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#3 Subject",
"displayName": "Email#3 Subject",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Sender Email",
"displayName": "Sender Email",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Time Zone",
"displayName": "Time Zone",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#1 Sent",
"displayName": "Email#1 Sent",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#2 Sent",
"displayName": "Email#2 Sent",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#3 Sent",
"displayName": "Email#3 Sent",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Message ID",
"displayName": "Message ID",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "Replied",
"displayName": "Replied",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Token",
"displayName": "Token",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "Opted Out",
"displayName": "Opted Out",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
0,
-1920
],
"id": "4ff62505-8aa7-42e4-82b3-08d8b9c65572",
"name": "Google Sheets4",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"options": {}
},
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 3,
"position": [
-352,
-1792
],
"id": "75aa8419-d246-4eaf-89bc-556ad4147ee1",
"name": "Loop Over Items"
},
{
"parameters": {
"amount": "={{ Math.floor(Math.random() * (7 - 2 + 1)) + 2 }}\n"
},
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
48,
-1648
],
"id": "76dc9f74-16f8-4ec3-a832-f5951e0a946a",
"name": "Wait"
},
{
"parameters": {
"sendTo": "=kiaghasem.dev@gmail.com",
"subject": "={{ $json['Email#1 Subject'] }}",
"message": "={{ $json['Email#1 Body'] }}<br><br>\n<a href=\"https://kiaghasem.app.n8n.cloud/webhook/unsubscribe?tkn={{ $json.Token }}\">Click Here to Unsubscribe</a>",
"options": {
"appendAttribution": false
}
},
"type": "n8n-nodes-base.gmail",
"typeVersion": 2.1,
"position": [
752,
-1312
],
"id": "bcb4deb2-926c-4b97-9ca4-b3d8214d3310",
"name": "Gmail3",
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "appendOrUpdate",
"documentId": {
"__rl": true,
"value": "1pY5nJihyUUObA1LpbhdgANq0DSX7A9TLOTWlEr9PMBk",
"mode": "list",
"cachedResultName": "Research",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pY5nJihyUUObA1LpbhdgANq0DSX7A9TLOTWlEr9PMBk/edit?usp=drivesdk"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "Sheet1",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pY5nJihyUUObA1LpbhdgANq0DSX7A9TLOTWlEr9PMBk/edit#gid=0"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"LinkedIn URL": "={{ $('Switch').item.json['LinkedIn URL'] }}",
"Email#1 Sent": "Yes",
"Message ID": "={{ $json.id }}"
},
"matchingColumns": [
"LinkedIn URL"
],
"schema": [
{
"id": "First Name",
"displayName": "First Name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Last Name",
"displayName": "Last Name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email Address",
"displayName": "Email Address",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Phone Number",
"displayName": "Phone Number",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Country ",
"displayName": "Country ",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Location",
"displayName": "Location",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Industry",
"displayName": "Industry",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Company Name",
"displayName": "Company Name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Job Title",
"displayName": "Job Title",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Seniority",
"displayName": "Seniority",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Website URL",
"displayName": "Website URL",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "LinkedIn URL",
"displayName": "LinkedIn URL",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "Analysed",
"displayName": "Analysed",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Research Report",
"displayName": "Research Report",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#1 Body",
"displayName": "Email#1 Body",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#1 Subject",
"displayName": "Email#1 Subject",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email #2 Body",
"displayName": "Email #2 Body",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#3 Body",
"displayName": "Email#3 Body",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#3 Subject",
"displayName": "Email#3 Subject",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Sender Email",
"displayName": "Sender Email",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Time Zone",
"displayName": "Time Zone",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#1 Sent",
"displayName": "Email#1 Sent",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#2 Sent",
"displayName": "Email#2 Sent",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#3 Sent",
"displayName": "Email#3 Sent",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Message ID",
"displayName": "Message ID",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "Replied",
"displayName": "Replied",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Token",
"displayName": "Token",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "Opted Out",
"displayName": "Opted Out",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
832,
-1600
],
"id": "b402e30b-7062-46ae-bee5-0e16423a0a4a",
"name": "Google Sheets6",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"options": {}
},
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 3,
"position": [
496,
-1472
],
"id": "ec1b9e32-d92f-4e07-ad29-20096bb52eac",
"name": "Loop Over Items1"
},
{
"parameters": {
"amount": "={{ Math.floor(Math.random() * (7 - 2 + 1)) + 2 }}\n",
"unit": "minutes"
},
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
960,
-1312
],
"id": "7a61e395-f142-4b98-a41e-93e69347d2d1",
"name": "Wait1"
},
{
"parameters": {
"sendTo": "=kiaghasem.dev@gmail.com",
"subject": "={{ $json['Email#1 Subject'] }}",
"message": "={{ $json['Email#1 Body'] }}<br><br>\n<a href=\"https://kiaghasem.app.n8n.cloud/webhook/unsubscribe?tkn={{ $json.Token }}\">Click Here to Unsubscribe</a>",
"options": {
"appendAttribution": false
}
},
"type": "n8n-nodes-base.gmail",
"typeVersion": 2.1,
"position": [
-48,
-1088
],
"id": "c3690df4-db62-4646-9200-8e45a40f09d9",
"name": "Gmail4",
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "appendOrUpdate",
"documentId": {
"__rl": true,
"value": "1pY5nJihyUUObA1LpbhdgANq0DSX7A9TLOTWlEr9PMBk",
"mode": "list",
"cachedResultName": "Research",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pY5nJihyUUObA1LpbhdgANq0DSX7A9TLOTWlEr9PMBk/edit?usp=drivesdk"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "Sheet1",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pY5nJihyUUObA1LpbhdgANq0DSX7A9TLOTWlEr9PMBk/edit#gid=0"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"LinkedIn URL": "={{ $('Switch').item.json['LinkedIn URL'] }}",
"Email#1 Sent": "Yes",
"Message ID": "={{ $json.id }}"
},
"matchingColumns": [
"LinkedIn URL"
],
"schema": [
{
"id": "First Name",
"displayName": "First Name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Last Name",
"displayName": "Last Name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email Address",
"displayName": "Email Address",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Phone Number",
"displayName": "Phone Number",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Country ",
"displayName": "Country ",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Location",
"displayName": "Location",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Industry",
"displayName": "Industry",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Company Name",
"displayName": "Company Name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Job Title",
"displayName": "Job Title",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Seniority",
"displayName": "Seniority",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Website URL",
"displayName": "Website URL",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "LinkedIn URL",
"displayName": "LinkedIn URL",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "Analysed",
"displayName": "Analysed",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Research Report",
"displayName": "Research Report",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#1 Body",
"displayName": "Email#1 Body",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#1 Subject",
"displayName": "Email#1 Subject",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email #2 Body",
"displayName": "Email #2 Body",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#3 Body",
"displayName": "Email#3 Body",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#3 Subject",
"displayName": "Email#3 Subject",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Sender Email",
"displayName": "Sender Email",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Time Zone",
"displayName": "Time Zone",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#1 Sent",
"displayName": "Email#1 Sent",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#2 Sent",
"displayName": "Email#2 Sent",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#3 Sent",
"displayName": "Email#3 Sent",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Message ID",
"displayName": "Message ID",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "Replied",
"displayName": "Replied",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Token",
"displayName": "Token",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "Opted Out",
"displayName": "Opted Out",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
0,
-1376
],
"id": "fd7cfbae-b701-4737-aedf-9b7a1f30fbf6",
"name": "Google Sheets7",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"options": {}
},
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 3,
"position": [
-352,
-1248
],
"id": "0abbd89c-fed7-45dd-97d9-7a9607f42244",
"name": "Loop Over Items2"
},
{
"parameters": {
"amount": "={{ Math.floor(Math.random() * (7 - 2 + 1)) + 2 }}\n"
},
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
144,
-1088
],
"id": "fb6118ee-0cdb-45ab-9a6b-e3da302b5040",
"name": "Wait2"
},
{
"parameters": {
"documentId": {
"__rl": true,
"value": "1pY5nJihyUUObA1LpbhdgANq0DSX7A9TLOTWlEr9PMBk",
"mode": "list",
"cachedResultName": "Research",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pY5nJihyUUObA1LpbhdgANq0DSX7A9TLOTWlEr9PMBk/edit?usp=drivesdk"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "Sheet1",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pY5nJihyUUObA1LpbhdgANq0DSX7A9TLOTWlEr9PMBk/edit#gid=0"
},
"filtersUI": {
"values": [
{
"lookupColumn": "Email#1 Sent",
"lookupValue": "No"
},
{
"lookupColumn": "Time Zone",
"lookupValue": "T2"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
-1152,
-1472
],
"id": "6655d108-1c6c-4bb7-b738-f2244a20eb89",
"name": "Google Sheets3",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"leftValue": "={{ $json['Sender Email'] }}",
"rightValue": "kiaghasem.dev@gmail.com",
"operator": {
"type": "string",
"operation": "equals"
},
"id": "b895fd00-6f66-41d1-ab55-b1337e744a7f"
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "kgd"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "b90ae81e-e015-4138-955b-f8efae253fba",
"leftValue": "={{ $json['Sender Email'] }}",
"rightValue": "kia@kamexa.ai",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "k"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "93b60147-610f-4c3c-adf6-a7f8b2159096",
"leftValue": "={{ $json['Sender Email'] }}",
"rightValue": "youremail@gmail.com",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "h"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.switch",
"typeVersion": 3.2,
"position": [
-4400,
240
],
"id": "53a29af7-1ac7-4501-8863-a1624dca71ab",
"name": "Switch1"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "177601be-b2c3-45cc-8e15-cd064fbaf578",
"leftValue": "={{ $json.replied }}",
"rightValue": "Yes",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
-2848,
272
],
"id": "b6f4ec01-21e3-4aa8-bc1d-6d9e2b1fdc91",
"name": "If1"
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineByPosition",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.1,
"position": [
-3088,
272
],
"id": "79a66ac2-3b89-4d92-8204-931a0e1a3a17",
"name": "Merge1"
},
{
"parameters": {
"operation": "getAll",
"limit": 1,
"filters": {
"sender": "={{ $json['Email Address'] }}"
}
},
"type": "n8n-nodes-base.gmail",
"typeVersion": 2.1,
"position": [
-3552,
416
],
"id": "2fff5559-2bb0-4dc1-a957-3b7000faa3a5",
"name": "Replied?1",
"alwaysOutputData": true,
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "appendOrUpdate",
"documentId": {
"__rl": true,
"value": "1pY5nJihyUUObA1LpbhdgANq0DSX7A9TLOTWlEr9PMBk",
"mode": "list",
"cachedResultName": "Research",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pY5nJihyUUObA1LpbhdgANq0DSX7A9TLOTWlEr9PMBk/edit?usp=drivesdk"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "Sheet1",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pY5nJihyUUObA1LpbhdgANq0DSX7A9TLOTWlEr9PMBk/edit#gid=0"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"LinkedIn URL": "={{ $json[\"LinkedIn URL\"] }}",
"Replied": "Yes"
},
"matchingColumns": [
"LinkedIn URL"
],
"schema": [
{
"id": "First Name",
"displayName": "First Name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Last Name",
"displayName": "Last Name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email Address",
"displayName": "Email Address",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Phone Number",
"displayName": "Phone Number",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Country ",
"displayName": "Country ",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Location",
"displayName": "Location",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Industry",
"displayName": "Industry",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Company Name",
"displayName": "Company Name",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Job Title",
"displayName": "Job Title",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Seniority",
"displayName": "Seniority",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Website URL",
"displayName": "Website URL",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "LinkedIn URL",
"displayName": "LinkedIn URL",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true,
"removed": false
},
{
"id": "Analysed",
"displayName": "Analysed",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Research Report",
"displayName": "Research Report",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#1 Body",
"displayName": "Email#1 Body",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#1 Subject",
"displayName": "Email#1 Subject",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email #2 Body",
"displayName": "Email #2 Body",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#3 Body",
"displayName": "Email#3 Body",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#3 Subject",
"displayName": "Email#3 Subject",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Sender Email",
"displayName": "Sender Email",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Time Zone",
"displayName": "Time Zone",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#1 Sent",
"displayName": "Email#1 Sent",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#2 Sent",
"displayName": "Email#2 Sent",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Email#3 Sent",
"displayName": "Email#3 Sent",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "Message ID",
"displayName": "Message ID",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
gmailOAuth2googleSheetsOAuth2ApihttpHeaderAuthopenAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Cold email Agent. Uses googleSheets, gmail, httpRequest, openAi. Webhook trigger; 100 nodes.
Source: https://github.com/ahmed-ali-codes/n8n-ai-cold-email-agent/blob/main/cold-emial-agent.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Cold email Agent. Uses googleSheets, gmail, httpRequest, openAi. Webhook trigger; 100 nodes.
leads. Uses supabase, gmail, formTrigger, httpRequest. Webhook trigger; 62 nodes.
Agent D'analyse. Uses memoryBufferWindow, googleSheetsTool, agent, lmChatOpenAi. Webhook trigger; 42 nodes.
Universal Expense tracker. Uses telegram, httpRequest, openAi, googleSheets. Webhook trigger; 33 nodes.
Sales Voice Agent - ElevenLabs + n8n. Uses httpRequest, openAi, gmail, googleSheets. Webhook trigger; 19 nodes.