This workflow corresponds to n8n.io template #6091 — we link there as the canonical source.
This workflow follows the Agent → 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 →
{
"meta": {
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "5c5a6f6b-9858-4eae-a89d-d07b52022b50",
"name": "When clicking \u2018Execute workflow\u2019",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-280,
-180
],
"parameters": {},
"typeVersion": 1
},
{
"id": "2377d19a-e54d-4b1f-a7c3-9a0aa0d162ed",
"name": "HTTP Request",
"type": "n8n-nodes-base.httpRequest",
"position": [
-60,
-180
],
"parameters": {
"url": "https://api.apify.com/v2/acts/:actorId/run-sync-get-dataset-items",
"method": "POST",
"options": {
"redirect": {
"redirect": {}
}
},
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"headerParameters": {
"parameters": [
{
"name": "Accept",
"value": "application/json"
},
{
"name": "Authorization",
"value": "Bearer <token>"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "4110b37f-497e-47dd-932a-05e5ec95276f",
"name": "Edit Fields2",
"type": "n8n-nodes-base.set",
"position": [
380,
-280
],
"parameters": {
"include": "selected",
"options": {
"dotNotation": false
},
"assignments": {
"assignments": [
{
"id": "d6d3f43d-6840-4812-9493-799be28cb72b",
"name": "title",
"type": "string",
"value": "={{ $json.title }}"
},
{
"id": "c85aed11-cccf-4245-a346-9faa151e4e5a",
"name": "categoryName",
"type": "string",
"value": "={{ $json.categoryName }}"
},
{
"id": "46491b8e-f5ef-4f9c-a96d-bb15410f6fae",
"name": "city",
"type": "string",
"value": "={{ $json.city }}"
},
{
"id": "036a172b-9524-410f-98f0-ea29cb1fb1e5",
"name": "street",
"type": "string",
"value": "={{ $json.street }}"
},
{
"id": "512e1e5d-fcd4-4ae3-b009-e767d3fb432c",
"name": "phone",
"type": "string",
"value": "={{ $json.phone }}"
},
{
"id": "b9d3f8e3-fcaf-4ab0-869f-35f2af974aab",
"name": "leadsEnrichment[0].fullName",
"type": "string",
"value": "={{ $json.leadsEnrichment[0].fullName }}"
},
{
"id": "b4953f2c-e176-403c-9652-969e9e0f9eb3",
"name": "leadsEnrichment[0].linkedinProfile",
"type": "string",
"value": "={{ $json.leadsEnrichment[0].linkedinProfile }}"
},
{
"id": "936b2fb5-307c-41f7-ac24-01faf4771da1",
"name": "leadsEnrichment[0].jobTitle",
"type": "string",
"value": "={{ $json.leadsEnrichment[0].jobTitle }}"
},
{
"id": "9ee109e2-57a8-4c6b-beee-2dc7dc16d294",
"name": "leadsEnrichment[0].email",
"type": "string",
"value": "={{ $json.leadsEnrichment[0].email }}"
},
{
"id": "7ec+1234567890b-babd-6ee9da5d9f18",
"name": "leadsEnrichment[1].fullName",
"type": "string",
"value": "={{ $json.leadsEnrichment[1].fullName }}"
},
{
"id": "6b69e7b4-cf28-40da-8c84-1d6f76f48824",
"name": "leadsEnrichment[1].linkedinProfile",
"type": "string",
"value": "={{ $json.leadsEnrichment[1].linkedinProfile }}"
},
{
"id": "70ea0b1d-d701-4207-a326-dedbccf3bf96",
"name": "leadsEnrichment[1].email",
"type": "string",
"value": "={{ $json.leadsEnrichment[1].email }}"
},
{
"id": "2b66bd7f-29e7-4416-81f0-34c7114482e0",
"name": "leadsEnrichment[1].jobTitle",
"type": "string",
"value": "={{ $json.leadsEnrichment[1].jobTitle }}"
},
{
"id": "915aea50-2e65-4467-b3aa-2bc25295d39e",
"name": "website",
"type": "string",
"value": "={{ $json.website }}"
},
{
"id": "e2467988-9b68-4ae2-8b62-7485044ac50b",
"name": "leadsEnrichment[2].fullName",
"type": "string",
"value": "={{ $json.leadsEnrichment[2].fullName }}"
},
{
"id": "9cf88c7b-f800-45b9-9768-d84cd19ff3d8",
"name": "leadsEnrichment[2].linkedinProfile",
"type": "string",
"value": "={{ $json.leadsEnrichment[2].linkedinProfile }}"
},
{
"id": "c22d08ff-bb3b-46ae-ab30-b1dc011dc851",
"name": "leadsEnrichment[2].email",
"type": "string",
"value": "={{ $json.leadsEnrichment[2].email }}"
},
{
"id": "8d1cca6c-3d05-40f2-8e4f-5ffee2f5f985",
"name": "leadsEnrichment[2].jobTitle",
"type": "string",
"value": "={{ $json.leadsEnrichment[2].jobTitle }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "9fb20846-55bf-44e6-af55-4249a58d7335",
"name": "Loop Over Items",
"type": "n8n-nodes-base.splitInBatches",
"position": [
1040,
-280
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "a90f1e9e-c8d8-4be5-b1f7-912dd50c7345",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1480,
-400
],
"parameters": {
"text": "=You are a sales pro crafting personalised outbound emails.\n\nBelow is company the prospect works on . \n{{ $json.title }}\n\nPlease:\n\n1. Identify ONE pressing, industry-wide challenge that\u2019s clearly relevant to the prospect\u2019s company or role.\n2. Draft ONE concise, human paragraph (max 70 words) that:\n \u2022 Begins exactly with \u201cHi {{ $('Edit Fields').item.json.fullName }},\u201d \n \u2022 Mentions {{ $('Edit Fields').item.json.jobTitle }} naturally. \n \u2022 Frames the challenge and hints at a potential solution\u2014no product pitch yet, just empathy and insight.\n\nReturn **only** the paragraph\u2014nothing before or after it.\n",
"options": {},
"promptType": "define"
},
"typeVersion": 2
},
{
"id": "9182fc64-e856-471c-91aa-d1a15e11eb6c",
"name": "Append or update row in sheet3",
"type": "n8n-nodes-base.googleSheets",
"position": [
1840,
-280
],
"parameters": {
"columns": {
"value": {
"POC": "={{ $('Edit Fields').item.json.fullName }}",
"City": "={{ $('Edit Fields').item.json.city }}",
"Email": "={{ $('Edit Fields').item.json.email }}",
"Phone": "={{ $('Edit Fields').item.json.phone }}",
"Title": "={{ $('Edit Fields').item.json.title }}",
"Street": "={{ $('Edit Fields').item.json.street }}",
"Category": "={{ $('Edit Fields').item.json.categoryName }}",
"job title": "={{ $('Edit Fields').item.json.jobTitle }}",
"Linkedin Profile": "={{ $('Edit Fields').item.json.linkedinProfile }}",
"Peronalized starters": "={{ $json.output }}"
},
"schema": [
{
"id": "Title",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Category",
"type": "string",
"display": true,
"required": false,
"displayName": "Category",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "City",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "City",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Street",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Street",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Phone",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Phone",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "POC",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "POC",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Email",
"type": "string",
"display": true,
"required": false,
"displayName": "Email",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Linkedin Profile",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Linkedin Profile",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "job title",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "job title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Peronalized starters",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Peronalized starters",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Title"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {
"useAppend": true
},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1w197nVPN1bKo2KAgN2pcwz6yTVI6jNoawwIbNJeDfK8/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1w197nVPN1bKo2KAgN2pcwz6yTVI6jNoawwIbNJeDfK8",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1w197nVPN1bKo2KAgN2pcwz6yTVI6jNoawwIbNJeDfK8/edit?usp=drivesdk",
"cachedResultName": "Google scraper data set"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.6
},
{
"id": "45ca72d3-463b-4d2e-8231-c54632ecbea9",
"name": "Code",
"type": "n8n-nodes-base.code",
"position": [
820,
-280
],
"parameters": {
"jsCode": "return $input.all().flatMap(({ json: c }) => {\n\n // 1. Group every leadsEnrichment[key] by its index (0,1,2\u2026)\n const contacts = Object.keys(c).reduce((map, k) => {\n const m = k.match(/^leadsEnrichment\\[(\\d+)]\\.(.+)$/);\n if (!m) return map; // skip company keys\n const [ , idx, field ] = m; // idx = '0', field = 'email'\n (map[idx] ??= {})[field] = c[k];\n return map;\n }, {});\n\n // 2. Convert map \u2192 array and enrich with the shared company data\n return Object.values(contacts)\n .filter(ct => Object.values(ct).some(v => v)) // drop completely empty rows\n .map(ct => ({\n title: c.title,\n categoryName: c.categoryName,\n city: c.city,\n street: c.street,\n phone: c.phone,\n website: c.website,\n ...ct, // fullName, email, linkedinProfile, jobTitle\n }));\n}).map(json => ({ json }));"
},
"typeVersion": 2
},
{
"id": "a44a4a7c-6bce-4930-b4ab-e84eb5614eae",
"name": "Filter3",
"type": "n8n-nodes-base.filter",
"position": [
160,
-280
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "f81e2b76-2ce2-4bb1-95ec-cfb56599be41",
"operator": {
"type": "array",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json.leadsEnrichment }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "9f63fe16-0fe1-4425-a565-5514e7851af9",
"name": "Filter5",
"type": "n8n-nodes-base.filter",
"position": [
600,
-280
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "or",
"conditions": [
{
"id": "59109e66-afd1-4c86-8cc4-9f0f7612fa72",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json[\"leadsEnrichment[0].email\"] }}",
"rightValue": "null"
},
{
"id": "300ad97f-ee98-4203-9178-971fd10fea3b",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json[\"leadsEnrichment[2].email\"] }}",
"rightValue": "null"
},
{
"id": "a4125f8e-73cb-4fee-a24b-1b0d68c872b7",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json[\"leadsEnrichment[2].email\"] }}",
"rightValue": "null"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "a723d73a-f7fa-453e-8d7e-396dad52399f",
"name": "Edit Fields",
"type": "n8n-nodes-base.set",
"position": [
1260,
-400
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "b5fc57c1-0475-4690-aa26-f219aad07289",
"name": "title",
"type": "string",
"value": "={{ $json.title }}"
},
{
"id": "f3dbc327-2623-4fc8-ab70-0c8621d6fc68",
"name": "categoryName",
"type": "string",
"value": "={{ $json.categoryName }}"
},
{
"id": "74feb771-f595-4ab1-bb95-09b26215ae0f",
"name": "city",
"type": "string",
"value": "={{ $json.city }}"
},
{
"id": "03b44697-b667-4832-8b7a-f430b23c64a4",
"name": "website",
"type": "string",
"value": "={{ $json.website }}"
},
{
"id": "3ad8f1e1-5a90-4d41-8c78-9d48f9507386",
"name": "phone",
"type": "string",
"value": "={{ $json.phone }}"
},
{
"id": "f32cf3a0-3ec2-4526-831f-cb5f53909988",
"name": "fullName",
"type": "string",
"value": "={{ $json.fullName }}"
},
{
"id": "e397315c-01bf-4454-ac85-dbbe4eda6a17",
"name": "linkedinProfile",
"type": "string",
"value": "={{ $json.linkedinProfile }}"
},
{
"id": "8c431ed2-ee73-4571-9963-dc7cbb412ec3",
"name": "jobTitle",
"type": "string",
"value": "={{ $json.jobTitle }}"
},
{
"id": "993a4280-e82e-4a86-a36a-354901cabf1b",
"name": "email",
"type": "string",
"value": "={{ $json.email }}"
},
{
"id": "774ef839-d532-46fd-b5d3-f1b62c0a0161",
"name": "street",
"type": "string",
"value": "={{ $json.street }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "2733b567-0580-4b06-b6c4-b876a09bde1c",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1560,
-180
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "b0360c5e-5c6c-4823-ab6f-3fd0293d0c78",
"name": "Filter",
"type": "n8n-nodes-base.filter",
"position": [
160,
-80
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "2a1b191a-c6dd-4f77-b7e3-9c54d655e08a",
"operator": {
"type": "array",
"operation": "empty",
"singleValue": true
},
"leftValue": "={{ $json.leadsEnrichment }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "3adbdc12-d1a3-43aa-8938-a241ab65eeba",
"name": "Edit Fields1",
"type": "n8n-nodes-base.set",
"position": [
380,
-80
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "825529c5-7ed3-4b46-83a9-672bbe2525fb",
"name": "title",
"type": "string",
"value": "={{ $json.title }}"
},
{
"id": "9d301af3-862a-454c-984f-de50b3dcbd18",
"name": "street",
"type": "string",
"value": "={{ $json.street }}"
},
{
"id": "af028b19-9eb1-4ab7-8d27-1c6c33fa4bbe",
"name": "city",
"type": "string",
"value": "={{ $json.city }}"
},
{
"id": "2c10cf46-2c4f-4784-bd36-31640592d5e7",
"name": "state",
"type": "string",
"value": "={{ $json.state }}"
},
{
"id": "+1234567890f4e-be19-f9d3fa462cd4",
"name": "website",
"type": "string",
"value": "={{ $json.website }}"
},
{
"id": "ed8172ab-0df0-49a2-9efc-1d8344528fa0",
"name": "phone",
"type": "string",
"value": "={{ $json.phone }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "1bd5f298-170b-41d6-b2be-45a499558afd",
"name": "Append or update row in sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
600,
-80
],
"parameters": {
"columns": {
"value": {
"City": "={{ $json.city }}",
"Phone": "={{ $json.phone }}",
"Title": "={{ $json.title }}",
"Street": "={{ $json.street }}",
"Website": "={{ $json.website }}"
},
"schema": [
{
"id": "Title",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Street",
"type": "string",
"display": true,
"required": false,
"displayName": "Street",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "City",
"type": "string",
"display": true,
"required": false,
"displayName": "City",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Website",
"type": "string",
"display": true,
"required": false,
"displayName": "Website",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Phone",
"type": "string",
"display": true,
"required": false,
"displayName": "Phone",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Title"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1892991651,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1w197nVPN1bKo2KAgN2pcwz6yTVI6jNoawwIbNJeDfK8/edit#gid=1892991651",
"cachedResultName": "Sheet2"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1w197nVPN1bKo2KAgN2pcwz6yTVI6jNoawwIbNJeDfK8",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1w197nVPN1bKo2KAgN2pcwz6yTVI6jNoawwIbNJeDfK8/edit?usp=drivesdk",
"cachedResultName": "Google scraper data set"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.6
},
{
"id": "bc242db5-744e-4669-a8cc-937a44d9da53",
"name": "Batch Processing Logic",
"type": "n8n-nodes-base.splitInBatches",
"position": [
200,
260
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "80d47567-94d3-4a4c-a1d2-9eaf5889b210",
"name": "Scrape Website Content",
"type": "n8n-nodes-base.httpRequest",
"position": [
640,
180
],
"parameters": {
"url": "https://api.firecrawl.dev/v1/scrape",
"method": "POST",
"options": {},
"jsonBody": "={\n \"url\": \"{{ $json.Website }}\",\n \"formats\": [\n \"markdown\",\n \"html\"\n ]\n} ",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer <token>"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "133bbcf4-3b6f-4c79-8a8d-fd6ff626610b",
"name": "Extract Contact Information",
"type": "n8n-nodes-base.code",
"position": [
860,
180
],
"parameters": {
"jsCode": "/**\n * n8n CODE NODE \u2013 Social-profile extractor\n * ----------------------------------------------------------\n * INPUT (per item) : item.json.html \u2190 the full HTML / Markdown string\n * OUTPUT (per item): {\n * facebook : [...], instagram : [...],\n * linkedin : [...], twitter : [...],\n * yelp : [...], tiktok : [...],\n * youtube : [...]\n * }\n */\n\nconst raw = String($input.item.json.html || $input.item.json.data?.markdown || '');\n\nif (!raw) return { json: { error: 'No HTML/markdown provided' } };\n\n/* ---------- helper ---------- */\nconst normalise = u =>\n u.replace(/^(?:https?:\\/\\/)?(?:www\\.)?/i, 'https://www.')\n .split(/[?#]/)[0]\n .replace(/\\/$/, '');\n\nconst unique = arr => [...new Set(arr)];\n\n/* ---------- profile-only regexes ---------- */\nconst NET = {\n facebook : /https?:\\/\\/(?:www\\.|m\\.)?facebook\\.com\\/(?!share|sharer|plugins|dialog)[A-Za-z0-9._-]+\\/?/ig,\n instagram: /https?:\\/\\/(?:www\\.)?instagram\\.com\\/(?!share)[A-Za-z0-9._-]+\\/?/ig,\n linkedin : /https?:\\/\\/(?:[\\w-]+\\.)?linkedin\\.com\\/(?:company|in|school)\\/[A-Za-z0-9._-]+\\/?/ig,\n twitter : /https?:\\/\\/(?:www\\.)?(?:twitter|x)\\.com\\/(?!intent|share)[A-Za-z0-9._-]+\\/?/ig,\n yelp : /https?:\\/\\/(?:www\\.)?yelp\\.com\\/biz\\/[A-Za-z0-9._-]+\\/?/ig,\n tiktok : /https?:\\/\\/(?:www\\.)?tiktok\\.com\\/@[A-Za-z0-9._-]+\\/?/ig,\n youtube : /https?:\\/\\/(?:www\\.)?youtube\\.com\\/(?:channel|user|c)\\/[A-Za-z0-9._-]+\\/?/ig\n};\n\n/* ---------- run extraction ---------- */\nconst output = {};\nfor (const [net, rex] of Object.entries(NET)) {\n const matches = [...raw.matchAll(rex)].map(m => normalise(m[0]));\n output[net] = unique(matches);\n}\n\n/* ---------- return ---------- */\nreturn { json: output };\n"
},
"typeVersion": 2
},
{
"id": "62358c45-35cd-4b26-94e6-3279e7e71abe",
"name": "Filter6",
"type": "n8n-nodes-base.filter",
"position": [
-20,
260
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "a58d8634-f3b3-4aa7-af9b-2170b18d064c",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json.Website }}",
"rightValue": "not"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "23b182e8-2bf3-4570-8a18-f4f7d379fa8f",
"name": "Google Sheets Trigger",
"type": "n8n-nodes-base.googleSheetsTrigger",
"position": [
-240,
260
],
"parameters": {
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1892991651,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1w197nVPN1bKo2KAgN2pcwz6yTVI6jNoawwIbNJeDfK8/edit#gid=1892991651",
"cachedResultName": "Sheet2"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1w197nVPN1bKo2KAgN2pcwz6yTVI6jNoawwIbNJeDfK8",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1w197nVPN1bKo2KAgN2pcwz6yTVI6jNoawwIbNJeDfK8/edit?usp=drivesdk",
"cachedResultName": "Google scraper data set"
}
},
"credentials": {
"googleSheetsTriggerOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "6d0939cc-f9ad-49ff-99d5-50f086dd305c",
"name": "Edit Fields3",
"type": "n8n-nodes-base.set",
"position": [
420,
180
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "71e97ea0-22b9-486b-8c43-16ac91e2dc7b",
"name": "Title",
"type": "string",
"value": "={{ $json.Title }}"
},
{
"id": "ceaf5a3f-4fc9-46f8-8cae-3f8a69a98779",
"name": "Website",
"type": "string",
"value": "={{ $json.Website }}"
},
{
"id": "bed2b230-155f-41ff-adb7-91a7cc57f52b",
"name": "City",
"type": "string",
"value": "={{ $json.City }}"
},
{
"id": "fdcd9181-ef77-4a28-b1ae-26f98ecb87ff",
"name": "Street",
"type": "string",
"value": "={{ $json.Street }}"
},
{
"id": "e63272ad-dfcb-4fdc-9b13-bde99ccf1101",
"name": "Phone",
"type": "string",
"value": "={{ $json.Phone }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "de294903-8d58-4800-b6ec-ed9545f25430",
"name": "Append or update row in sheet1",
"type": "n8n-nodes-base.googleSheets",
"position": [
1080,
260
],
"parameters": {
"columns": {
"value": {
"Title": "={{ $('Edit Fields3').item.json.Title }}",
"Twitter": "={{ $json.twitter }}",
"Facebook": "={{ $json.facebook[0] }}",
"Linkedin": "={{ $json.linkedin }}",
"Instagram": "={{ $json.instagram}}"
},
"schema": [
{
"id": "Title",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Linkedin",
"type": "string",
"display": true,
"required": false,
"displayName": "Linkedin",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Twitter",
"type": "string",
"display": true,
"required": false,
"displayName": "Twitter",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Instagram",
"type": "string",
"display": true,
"required": false,
"displayName": "Instagram",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Facebook",
"type": "string",
"display": true,
"required": false,
"displayName": "Facebook",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Title"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {
"useAppend": true
},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1450761553,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1w197nVPN1bKo2KAgN2pcwz6yTVI6jNoawwIbNJeDfK8/edit#gid=1450761553",
"cachedResultName": "Sheet3"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1w197nVPN1bKo2KAgN2pcwz6yTVI6jNoawwIbNJeDfK8",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1w197nVPN1bKo2KAgN2pcwz6yTVI6jNoawwIbNJeDfK8/edit?usp=drivesdk",
"cachedResultName": "Google scraper data set"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.6
},
{
"id": "df2fa447-d16b-40a0-bf67-61f45bd06d7e",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-860,
-360
],
"parameters": {
"width": 460,
"height": 1500,
"content": "## Try It Out!\n\n### This n8n template demonstrates how to automate business lead generation from Google Maps using the Apify Google Maps Scraper, with built-in enrichment and personalized outreach\u2014all in one seamless workflow. For leads missing contact or social info, a second workflow crawls their websites and extracts social media profiles automatically.\n\nUse cases include: \n- Building targeted lead lists for sales or marketing \n- Enriching business data for CRM or analytics \n- Automating personalized email or LinkedIn outreach\n\n### How it works\n* The workflow starts with a trigger (manual, webhook, or schedule) to kick off the process.\n* The Apify Google Maps Scraper node collects business data and, if enrichment is enabled in the scraper settings, automatically enriches each lead with contact details and social profiles.\n* AI-powered nodes generate personalized outreach messages for each lead, using the enriched business data and your custom prompt.\n* **Leads that do not have enrichment (e.g., missing contact or social info) are automatically saved to a separate Google Sheet.**\n* **A second workflow monitors this Google Sheet, and for each un-enriched lead:**\n * Uses Firecrawl to scrape the business\u2019s website.\n * Runs a Code node to extract social media profiles (LinkedIn, Facebook, Twitter, Instagram, etc.) from the website content.\n * Updates the Google Sheet with any new social/contact info found.\n* The final enriched leads and personalized messages can be sent to your CRM, email tool, or exported as needed.\n\n### How to use\n* Start with the manual trigger node, or swap it for a webhook or schedule trigger to automate.\n* Set your search parameters (location, keywords, etc.) in the Apify Google Maps Scraper node.\n* In the Apify scraper settings, enable enrichment to automatically gather contact and social info.\n* Update the personalization step to fit your outreach style or data needs.\n* Connect the final output to your preferred destination (email, CRM, Google Sheets, etc.).\n* **For leads without enrichment:**\n * Use the provided second workflow:\n * It reads the Google Sheet of un-enriched leads.\n * Uses Firecrawl to crawl each website.\n * Extracts social media links using a Code node.\n * Updates the Google Sheet with any new info found.\n * This allows you to further enrich your lead list automatically, even if the initial scraper missed some data.\n\n### Requirements\n* Apify account and API key (add as n8n credential, never hardcoded)\n* Google Sheets account for saving leads\n* Firecrawl API key (add as n8n credential, never hardcoded)\n* Optional: Email or messaging service credentials for sending outreach\n\n\nFor any doubts or help, please contact: designbyaze@gmail.com"
},
"typeVersion": 1
},
{
"id": "d3a77ee2-ba74-4f74-935b-d939bdf660cd",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-120,
-500
],
"parameters": {
"color": 4,
"height": 460,
"content": "# Apify Node\n1. Post the link of the present in the API endpoints under \"Run Actor synchronously and get dataset items\"\n2. Go to JSON input in the scraper and post the JSON value in the Body Field.\n3. Use the API key and replace the <token> under Header parameters."
},
"typeVersion": 1
},
{
"id": "f925bea5-d879-465c-8100-29b0bb55d3d2",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
580,
140
],
"parameters": {
"color": 5,
"height": 320,
"content": "## Firecrawl Node\n\n\n\n\n\n\n\n\n\n\n\n\n\nUse the API key and replace the <token> under Header parameters."
},
"typeVersion": 1
}
],
"connections": {
"Code": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Filter": {
"main": [
[
{
"node": "Edit Fields1",
"type": "main",
"index": 0
}
]
]
},
"Filter3": {
"main": [
[
{
"node": "Edit Fields2",
"type": "main",
"index": 0
}
]
]
},
"Filter5": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Filter6": {
"main": [
[
{
"node": "Batch Processing Logic",
"type": "main",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Append or update row in sheet3",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields1": {
"main": [
[
{
"node": "Append or update row in sheet",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields2": {
"main": [
[
{
"node": "Filter5",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields3": {
"main": [
[
{
"node": "Scrape Website Content",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request": {
"main": [
[
{
"node": "Filter3",
"type": "main",
"index": 0
},
{
"node": "Filter",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Google Sheets Trigger": {
"main": [
[
{
"node": "Filter6",
"type": "main",
"index": 0
}
]
]
},
"Batch Processing Logic": {
"main": [
[],
[
{
"node": "Edit Fields3",
"type": "main",
"index": 0
}
]
]
},
"Scrape Website Content": {
"main": [
[
{
"node": "Extract Contact Information",
"type": "main",
"index": 0
}
]
]
},
"Extract Contact Information": {
"main": [
[
{
"node": "Append or update row in sheet1",
"type": "main",
"index": 0
}
]
]
},
"Append or update row in sheet1": {
"main": [
[
{
"node": "Batch Processing Logic",
"type": "main",
"index": 0
}
]
]
},
"Append or update row in sheet3": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"When clicking \u2018Execute workflow\u2019": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
}
}
}
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.
googleSheetsOAuth2ApigoogleSheetsTriggerOAuth2ApiopenAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Import this workflow into your n8n instance. Add your Apify, Google Sheets, and Firecrawl credentials. Activate the workflow to start your automated lead enrichment system. Copy the webhook URL from the MCP trigger node. Connect AI agents using the MCP URL.
Source: https://n8n.io/workflows/6091/ — 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.
This automation is designed to help you generate AI-powered music tracks, cover art, and fully rendered music videos — all triggered from a simple Telegram chat and managed via Google Sheets.
This workflow is designed for marketers, content creators, agencies, and solo founders who want to publish long‑form posts with visuals on autopilot using n8n and AI agents.
AI-Powered Keyword Cannibalization Detection Workflow
A ready-to-use n8n workflow that turns new Google Sheets rows (title + summary) into brand-safe images using Nano Banana (via KIE.ai), writes the image URL back to your sheet, generates a tweet text,
Logistics teams spend hours manually validating shipment data, checking compliance, generating freight documents, and emailing stakeholders. Errors in HSN codes, weights, or carrier details can lead t