This workflow corresponds to n8n.io template #12837 — we link there as the canonical source.
This workflow follows the Google Sheets → HTTP Request 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 →
{
"nodes": [
{
"id": "748963d2-6626-4ef7-b620-068dbca762d2",
"name": "When clicking \u2018Execute workflow\u2019",
"type": "n8n-nodes-base.manualTrigger",
"position": [
32,
912
],
"parameters": {},
"typeVersion": 1
},
{
"id": "77cf3150-4ea2-4103-b688-9b748e10cd8f",
"name": "Fetch Leads",
"type": "n8n-nodes-base.googleSheets",
"position": [
256,
912
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupColumn": "Icebreaker"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "YOUR_SHEET_GID",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID",
"cachedResultName": "Leads_Sheet"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.6
},
{
"id": "f6967a00-0be5-424b-a258-6ff273bb58b6",
"name": "Loop Over Leads",
"type": "n8n-nodes-base.splitInBatches",
"position": [
512,
912
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "067f5962-a56e-48a3-8226-794a2dcf81c8",
"name": "Posts Found?",
"type": "n8n-nodes-base.if",
"position": [
1184,
912
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "c7334c6a-1da0-425f-ae7e-79ada4ddc082",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.message }}",
"rightValue": "No posts found."
}
]
}
},
"typeVersion": 2.2
},
{
"id": "615740e7-8d9b-47a6-bab7-a9690c266f54",
"name": "Apify LinkedIn Scraper",
"type": "n8n-nodes-base.httpRequest",
"maxTries": 5,
"position": [
960,
912
],
"parameters": {
"url": "https://api.apify.com/v2/acts/A3cAPGpwBEG8RJwse/run-sync-get-dataset-items",
"method": "POST",
"options": {
"redirect": {
"redirect": {}
}
},
"jsonBody": "={\n \"includeQuotePosts\": true,\n \"includeReposts\": false,\n \"maxComments\": 5,\n \"maxPosts\": 5,\n \"maxReactions\": 5,\n \"scrapeComments\": false,\n \"scrapeReactions\": false,\n \"targetUrls\": {{ JSON.stringify(\n (Array.isArray($json.contactLinkedIn)\n ? $json.contactLinkedIn\n : String($json.contactLinkedIn || '').split(',')\n )\n .map(u => u.trim())\n .filter(Boolean)\n ) }}\n}\n",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "Bearer YOUR_TOKEN_HERE"
}
]
}
},
"retryOnFail": true,
"typeVersion": 4.2,
"alwaysOutputData": false,
"waitBetweenTries": 5000
},
{
"id": "0eb67acc-77cd-469b-8792-a6c951eb3fc0",
"name": "Aggregate Posts",
"type": "n8n-nodes-base.aggregate",
"position": [
1472,
1056
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "type"
},
{
"renameField": true,
"outputFieldName": "content",
"fieldToAggregate": "content"
},
{
"renameField": true,
"outputFieldName": "repostContent",
"fieldToAggregate": "repost.content"
}
]
}
},
"typeVersion": 1
},
{
"id": "35dc437d-07f2-471b-bb2a-a20271551475",
"name": "Analyze LinkedIn Context",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
1712,
1056
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4",
"cachedResultName": "GPT-4"
},
"options": {
"temperature": 0.6
},
"messages": {
"values": [
{
"role": "system",
"content": "=You are a highly intelligent data summarizing AI assistant. DO NOT MAKE UP FALSE DATA"
},
{
"content": "=Your task is to take as input 1\u20135 recent LinkedIn posts (provided as a single unstructured string) about a client/company and condense them into a JSON output in this exact format:\n\n{\n \"LinkedInContext\": \"<Concise key points from the LinkedIn posts or write \\\"no content\\\">\",\n \"PersonContext\": \"<Concise key points about the individual(s) mentioned or write \\\"no content\\\">\",\n \"UniqueAngles\": \"<One or two brief, distinct outreach angles derived from the above contexts>\"\n}\n\nYou\u2019ll receive all necessary data as a single unstructured string. Parse it and emit only the JSON object.\n\nRules:\n- Use ONLY the information present in the provided LinkedIn posts. Do not invent or infer from outside sources.\n- Prioritize in LinkedInContext (summarize if present): \n 1) Their recent hire (name/role/timeframe if stated) \n 2) Their LinkedIn post (main point, initiative, metrics, call-to-action) \n 3) Their company news (funding, launch, partnership, awards) \n 4) Their specific challenge (hiring needs, growth bottlenecks, pains, goals).\n- If none of the above appear, extract any other relevant, factual insights from the posts; if nothing substantive exists, write \"no content\".\n- LinkedInContext: 1\u20134 sentences of high-impact takeaways from the posts only.\n- PersonContext: 1\u20134 sentences on the poster or mentioned decision-maker(s): role, priorities, achievements, asks, hiring plans\u2014only if explicitly in the posts; otherwise write \"no content\".\n- UniqueAngles: 1\u20134 laconic hooks that tie LinkedInContext and PersonContext into a personalized outreach idea; avoid repeating the same facts verbatim.\n- Keep everything short and Spartan\u2014no em dashes, no fluff, no speculation, no emojis, no hashtags.\n"
},
{
"content": "=LinkedIn 1-5 posts Scrape (leave blank if undefined):\n{{ $json.content }}\n\nReposted LinkedIn content scrape:\n{{ $json.repostContent }}\n\nPersonal Data Scrape:\n{{ $('Map Lead Data').item.json['firstName, lastName'] }}\n// firstName lastName of decision maker\n{{ $('Map Lead Data').item.json.city }} // City \n{{ $('Map Lead Data').item.json.state }} // State\n{{ $('Map Lead Data').item.json.country }} // Country\n{{ $('Map Lead Data').item.json.companyName }} // Company name\n{{ $('Map Lead Data').item.json.companyWebsite }} // Organization Website\n{{ $('Map Lead Data').item.json.keywords }}\n // Company Keywords\n{{ $('Map Lead Data').item.json.organizationDescription }} // Organization Description"
}
]
},
"jsonOutput": true
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.8
},
{
"id": "a3d999d6-5210-40db-9e79-0e0cf5a8b4da",
"name": "Map Lead Data",
"type": "n8n-nodes-base.set",
"position": [
736,
912
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "add37642-226b-4a01-8118-c7d45745f3e0",
"name": "firstName, lastName",
"type": "string",
"value": "={{ $json.first_name }}, {{ $json.last_name }}"
},
{
"id": "5bbd682c-a87a-4020-82ea-1b39aa4aad31",
"name": "email",
"type": "string",
"value": "={{ $json.email_final }}"
},
{
"id": "379e82d4-c48a-4d78-a493-f267acbc728c",
"name": "city",
"type": "string",
"value": "={{ $json.city }}"
},
{
"id": "9a683d7c-05e7-437c-b8e3-d774507e2e45",
"name": "state",
"type": "string",
"value": "={{ $json.state }}"
},
{
"id": "f1dfd467-c179-41b8-97d2-af30f313610b",
"name": "country",
"type": "string",
"value": "={{ $json.country }}"
},
{
"id": "eb214186-d59b-47dd-9f63-b396a5202173",
"name": "companyWebsite",
"type": "string",
"value": "={{ $json.organization_website_url }}"
},
{
"id": "ce662212-86bd-4c99-bff2-61d7c4cc51d1",
"name": "companyName",
"type": "string",
"value": "={{ $json.organization_name }}"
},
{
"id": "d82624c0-18c3-4abc-bb4e-a403d7e12059",
"name": "keywords",
"type": "string",
"value": "={{ $json.keywords }}"
},
{
"id": "5cc83eef-28ed-45ed-a401-ef9c61321cc8",
"name": "contactLinkedIn",
"type": "string",
"value": "={{ $json.linkedin_url }}"
},
{
"id": "50b7a49c-fcd1-45f9-a765-b4f6394c2627",
"name": "companyLinkedIn",
"type": "string",
"value": "={{ $json.organization_linkedin_url }}"
},
{
"id": "89241fab-9df4-4e21-b6bf-0b32a496006c",
"name": "organizationDescription",
"type": "string",
"value": "={{ $json.organization_short_description }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "d841b947-b72d-43da-9884-db6bfebbafdc",
"name": "Pass-through (Website)",
"type": "n8n-nodes-base.set",
"position": [
2672,
880
],
"parameters": {
"options": {}
},
"typeVersion": 3.4,
"alwaysOutputData": true
},
{
"id": "ccce2cd3-2c25-4d7d-a76c-f1fa94f49ff0",
"name": "Pass-through (LinkedIn)",
"type": "n8n-nodes-base.set",
"position": [
2672,
1056
],
"parameters": {
"options": {}
},
"typeVersion": 3.4,
"alwaysOutputData": true
},
{
"id": "cdb9f77b-540a-4aaf-8e90-fe655ea595e7",
"name": "Merge Loops",
"type": "n8n-nodes-base.merge",
"position": [
2896,
1040
],
"parameters": {},
"typeVersion": 3.2,
"alwaysOutputData": true
},
{
"id": "279e02ae-d53a-4df8-8225-4b1ee72b05cf",
"name": "Scrape Company Website",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueErrorOutput",
"position": [
1424,
880
],
"parameters": {
"url": "={{ $('Map Lead Data').item.json.companyWebsite }}",
"options": {}
},
"typeVersion": 4.2,
"alwaysOutputData": false
},
{
"id": "4aa07f39-e4ff-46e6-8246-963ef6f40342",
"name": "Convert HTML to Markdown",
"type": "n8n-nodes-base.markdown",
"onError": "continueRegularOutput",
"position": [
1584,
880
],
"parameters": {
"html": "={{ $json.data }}",
"options": {}
},
"typeVersion": 1
},
{
"id": "573fbdb4-8a89-4159-b16e-e5877854ea22",
"name": "Update Row (Website Data)",
"type": "n8n-nodes-base.googleSheets",
"position": [
2464,
880
],
"parameters": {
"columns": {
"value": {
"intro": "={{ $json.message.content.intro }}",
"Icebreaker": "={{ $json.message.content.icebreaker }}",
"companyType": "={{ $json.message.content.companyType }}",
"email_final": "={{ $('Fetch Leads').item.json.email_final }}"
},
"schema": [
{
"id": "email_final",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "email_final",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Icebreaker",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Icebreaker",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "intro",
"type": "string",
"display": true,
"required": false,
"displayName": "intro",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "companyType",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "companyType",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"email_final"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "YOUR_SHEET_GID",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID",
"cachedResultName": "Leads_Sheet"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"retryOnFail": true,
"typeVersion": 4.6,
"waitBetweenTries": 5000
},
{
"id": "6758366e-31eb-483a-8cff-53a4aeb6d670",
"name": "Analyze Website Context",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
1712,
880
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4-turbo",
"cachedResultName": "GPT-4-Turbo"
},
"options": {
"temperature": 0.6
},
"messages": {
"values": [
{
"role": "system",
"content": "=You are a highly intelligent ai assistant. DO NOT MAKE UP FALSE DATA"
},
{
"content": "=Your task is to take as input a large amount of unstructured data on a client\u2019s website and profile, and condense it into a JSON output in this exact format:\n\n{\n \"WebsiteContext\": \"<Concise key points about the company\u2019s website or write \\\"no content\\\">\",\n \"PersonContext\": \"<Concise key points about the individual or write \\\"no content\\\">\",\n \"UniqueAngles\": \"<One or two brief, distinct outreach angles derived from the above contexts>\"\n}\n\nYou\u2019ll receive all necessary data as a single unstructured string. Parse it and emit only the JSON object.\n\nRules:\n- Focus on a small number of high-impact points per block for crafting an icebreaker.\n- WebsiteContext: 1\u20134 sentences on key company/website insights.\n- PersonContext: 1\u20134 sentences on key personal/professional insights.\n- UniqueAngles: 1\u20134 laconic hooks or unique angles that tie WebsiteContext and PersonContext into a personalized outreach idea.\n- Keep everything short and Spartan\u2014no em dashes \n- No extra fluff, only valuable information that can be effectively used for cold outreach to the client. \n"
},
{
"content": "=Website Scrape (leave blank if undefined):\n{{ $json.data.length > 5000 ? $json.data.slice(0, 5000) : $json.data }}\n\nPersonal Data Scrape:\n{{ $('Map Lead Data').item.json['firstName, lastName'] }}\n// firstName lastName of decision maker\n{{ $('Map Lead Data').item.json.city }} // City \n{{ $('Map Lead Data').item.json.state }} // State\n{{ $('Map Lead Data').item.json.country }} // Country\n{{ $('Map Lead Data').item.json.companyName }} // Company name\n{{ $('Map Lead Data').item.json.companyWebsite }} // Organization Website\n{{ $('Map Lead Data').item.json.keywords }}\n // Company Keywords\n{{ $('Map Lead Data').item.json.organizationDescription }} // Organization Description"
}
]
},
"jsonOutput": true
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.8
},
{
"id": "e49de41f-1746-48d6-a087-d421f2a87719",
"name": "Write Email Copy (Website Context)",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
2080,
880
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4",
"cachedResultName": "GPT-4"
},
"options": {
"temperature": 0.7
},
"messages": {
"values": [
{
"role": "system",
"content": "=You are a highly intelligent, expert email copywriter. Your task is to generate a JSON object containing the building blocks of a personalized cold email. Prioritise warmth and clarity over cleverness. \n\nRULES:\n- NO em dashes (\u2014) should be used at all in any of the bodies.\n- Make sure the tone is Spartan, laconic, familiar. first-person familiar voice, like you\u2019re talking over coffee. Say \"I\" instead of \"we\" Level yourself with the prospect\n- Use basic English while maintaining the above tone\n"
},
{
"content": "=I own a [YOUR_BUSINESS_TYPE] business called [YOUR_COMPANY_NAME]. Given the prospect's context, produce a 3-block JSON object for the start of a personalized, Spartan-style email. Directed towards operators and decision-makers at SaaS businesses.\n\n{\n\"icebreaker\": \"<Start with '[firstName],' or 'Hey [firstName]'. 20\u201335 words. Lead with a light, company-focused observation to show homework. Keep details broad. End with a likely pain stated generally. Avoid naming tools or solutions here.>\",\n\"intro\": \"<choose one: I built an AI support chatbot for a similar <companyType> and it went really well; I built CRM + onboarding workflows for a similar <companyType> and it went really well>. Add a brief results hint like 'saved X hours' or 'cut $X'. Keep it natural and concise.\",\n \"companyType\": \"<plain, short description like 'b2b saas', 'devtools', 'security vendors'. lowercase only, no symbols>\"\n}\n\nPersonalization rules:\n-Tailor blocks where possible around the context, show homework.\n-Tone: Spartan, laconic, familiar. First person coffee chat. Dryly confident.\n-NO em dashes should be used at all in any of the bodies.\n-Imply shared goals where possible without obvious lies.\n- Shorten company names (e.g. \u201cAMS\u201d not \u201cAMS Professional Services\u201d, \"Mood Journal\" not \"The Mood Journal\") and locations (e.g. \u201cLA,\u201d \u201cSan Fran\u201d).\n-Don\u2019t be overly specific, leave room for follow up.\n-If no context is given just write general B2B SaaS info."
},
{
"role": "assistant",
"content": "={\n\"icebreaker\": \"Hey Ashley. Your SaaS positioning and recent updates look sharp at Lotus, clean story. I've been watching teams at this stage. The usual drag is follow through, context switching, and manual handoffs.\",\n\"intro\": \"I built an AI support chatbot for a similar b2b saas and it went really well. Saved ~120 hours monthly and deflected routine tickets.\",\n\"companyType\": \"fitness brands\"\n}"
},
{
"role": "assistant",
"content": "={\n\"icebreaker\": \"Mark, your devtools focus is clear and release notes read disciplined at DeepLearn. I've been tracking similar platforms. Most lose hours to triage, scattered feedback, and slow loops between support and engineering.\",\n\"intro\": \"I built CRM + onboarding workflows for a similar devtools company and it went really well. Cut first response by ~40% and trimmed ops cost about $80k a year.\",\n\"companyType\": \"fashion retailers\"\n}"
},
{
"content": "=Use this information for context:\nWebsite Context:\n{{ $json.message.content.WebsiteContext }}\n\nPerson Context:\n{{ $json.message.content.PersonContext}}\n\nUnique Angles:\n{{ $json.message.content.UniqueAngles }}"
}
]
},
"jsonOutput": true
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.8
},
{
"id": "44336798-7e59-4a07-b670-21fca6e89458",
"name": "Write Email Copy (LinkedIn Context)",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
2080,
1056
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4",
"cachedResultName": "GPT-4"
},
"options": {
"temperature": 0.7
},
"messages": {
"values": [
{
"role": "system",
"content": "=You are a highly intelligent, expert email copywriter. Your task is to generate a JSON object containing the building blocks of a personalized cold email. Prioritise warmth and clarity over cleverness. \n\nRULES:\n- NO em dashes (\u2014) should be used at all in any of the bodies.\n- Make sure the tone is Spartan, laconic, familiar. first-person familiar voice, like you\u2019re talking over coffee. Say \"I\" instead of \"we\" Level yourself with the prospect\n- Use basic English while maintaining the above tone\n- KEEP IN MIND SOME LinkedIn POSTS MAY BE OLD SOME MAY BE NEW WE DON'T KNOW THE DATE\n"
},
{
"content": "=I own a [YOUR_BUSINESS_TYPE] business called [YOUR_COMPANY_NAME]. Given the prospect's context, produce a 3-block JSON object for the start of a personalized, Spartan-style email. Directed towards operators and decision-makers at SaaS businesses.\n\n{\n\"icebreaker\": \"<Start with '[firstName],' or 'Hey [firstName]'. 20\u201335 words. Lead with a light, company-focused observation to show homework based on their LinkedIn if possible. End with a likely pain stated generally. Avoid naming tools or solutions here.>\",\n\"intro\": \"<choose one: I built an AI support chatbot for a similar <companyType> and it went really well; I built CRM + onboarding workflows for a similar <companyType> and it went really well>. Add a brief results hint like 'saved X hours' or 'cut $X'. Keep it natural and concise.\",\n\"companyType\": \"<plain, short description like 'b2b saas', 'devtools', 'security vendors'. lowercase only, no symbols>\"\n}\n\nPersonalization rules:\n-Tailor blocks where possible around the context, show homework.\n-Tone: Spartan, laconic, familiar. First person coffee chat. Dryly confident.\n-NO em dashes should be used at all in any of the bodies.\n-Imply shared goals where possible without obvious lies.\n- Shorten company names (e.g. \u201cAMS\u201d not \u201cAMS Professional Services\u201d, \"Mood Journal\" not \"The Mood Journal\") and locations (e.g. \u201cLA,\u201d \u201cSan Fran\u201d).\n-Don\u2019t be overly specific, leave room for follow up.\n-If no context is given just write general B2B SaaS info."
},
{
"role": "assistant",
"content": "={\n\"icebreaker\": \"Hey Ashley. Your SaaS positioning at Lotus looks sharp, also congrats on your new hire. I've been watching teams at this stage. The usual drag is follow through, context switching, and manual handoffs.\",\n\"intro\": \"I built an AI support chatbot for a similar b2b saas and it went really well. Saved ~120 hours monthly and deflected routine tickets.\",\n\"companyType\": \"b2b fitness saas\"\n}"
},
{
"role": "assistant",
"content": "={\n\"icebreaker\": \"Mark, saw your recent LinkedIn post on tightening feedback cycles, your devtools focus is clear and release notes read disciplined at DeepLearn. I've been tracking similar platforms. Most lose hours to triage, scattered feedback, and slow loops between support and engineering.\",\n\"intro\": \"I built CRM + onboarding workflows for a similar devtools company and it went really well. Cut first response by ~40% and trimmed ops cost about $80k a year.\",\n\"companyType\": \"fashion retailers\"\n}"
},
{
"content": "=Use this information for context:\nAddress the icebreaker to this name: {{ $('Map Lead Data').first().json['firstName, lastName'] }}\nLinkedIn Posts Context KEEP IN MIND SOME POSTS MAY BE OLD SOME MAY BE NEW WE DON'T KNOW THE DATE:\n{{ $json.message.content.LinkedInContext }}\n\nPerson Context, the person I will be addressing the email to:\n{{ $json.message.content.PersonContext}}\n\nUnique Angles:\n{{ $json.message.content.UniqueAngles }}"
}
]
},
"jsonOutput": true
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.8
},
{
"id": "28bfb7e7-b32a-4ed3-9d0d-ea1f447121a7",
"name": "Update Row (LinkedIn Data)",
"type": "n8n-nodes-base.googleSheets",
"position": [
2464,
1056
],
"parameters": {
"columns": {
"value": {
"intro": "={{ $json.message.content.intro }}",
"Icebreaker": "={{ $json.message.content.icebreaker }}",
"companyType": "={{ $json.message.content.companyType }}",
"email_final": "={{ $('Fetch Leads').item.json.email_final }}"
},
"schema": [
{
"id": "email_final",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "email_final",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Icebreaker",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Icebreaker",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "intro",
"type": "string",
"display": true,
"required": false,
"displayName": "intro",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "companyType",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "companyType",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"email_final"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "YOUR_SHEET_GID",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "YOUR_GOOGLE_SHEET_ID",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEET_ID",
"cachedResultName": "Leads_Sheet"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"retryOnFail": true,
"typeVersion": 4.6,
"waitBetweenTries": 5000
},
{
"id": "e4a53fdc-2243-4933-a5c1-94f50151242d",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
32,
608
],
"parameters": {
"color": 3,
"width": 313,
"height": 218,
"content": "## 1. Input Data\nConfigure your Google Sheet.\n**Requirements:**\n- `email_final`\n- `linkedin_url`\n- `companyWebsite`"
},
"typeVersion": 1
},
{
"id": "65ecd3b1-12c4-4563-8549-e8fe409edf9c",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
752,
608
],
"parameters": {
"color": 4,
"width": 544,
"height": 220,
"content": "## 2. Scraping Logic\nFirst, we attempt to scrape LinkedIn posts via Apify. \n\n**If Posts Found:** We generate personalization based on recent content.\n\n**If No Posts:** We fallback to scraping the company website directly."
},
"typeVersion": 1
},
{
"id": "18a1acb3-733e-411d-9c5a-f7c4863be1fc",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1696,
656
],
"parameters": {
"color": 6,
"width": 820,
"content": "## 3. Website Fallback Branch\nIf LinkedIn fails, we convert the website HTML to Markdown and use GPT-4 to find unique angles."
},
"typeVersion": 1
},
{
"id": "93d9c975-672c-47bf-a5ce-ed583217106c",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1744,
1280
],
"parameters": {
"color": 5,
"width": 820,
"content": "## 4. LinkedIn Branch\nIf posts exist, we aggregate them and use GPT-4 to write an icebreaker referencing specific post content."
},
"typeVersion": 1
},
{
"id": "68327f1e-4416-4a58-bb4d-f57014a919e7",
"name": "Header Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-656,
624
],
"parameters": {
"color": 7,
"width": 600,
"height": 544,
"content": "# \ud83e\udd16 Multi-Channel Cold Email Generator\n\n**Overview:** \nThis workflow personalizes cold emails by checking a lead's LinkedIn activity. If they have recent posts, it writes an icebreaker about them. If they don't, it falls back to analyzing their company website.\n\n**Requirements:**\n1. **Google Sheets:** Columns for `email_final`, `linkedin_url`, `companyWebsite`.\n2. **Apify Account:** Using the `run-sync-get-dataset-items` actor.\n3. **OpenAI API:** Access to GPT-4.\n\n**Setup Instructions:**\n1. Open the **Fetch Leads** and **Update Row** nodes. Replace `YOUR_GOOGLE_SHEET_ID` and map your columns.\n2. Open the **Apify LinkedIn Scraper** node and add your Apify API Token.\n3. Open the **Write Email Copy** nodes (both branches) and update the System Prompt with your actual Company Name and Business Type."
},
"typeVersion": 1
}
],
"connections": {
"Fetch Leads": {
"main": [
[
{
"node": "Loop Over Leads",
"type": "main",
"index": 0
}
]
]
},
"Merge Loops": {
"main": [
[
{
"node": "Loop Over Leads",
"type": "main",
"index": 0
}
]
]
},
"Posts Found?": {
"main": [
[
{
"node": "Scrape Company Website",
"type": "main",
"index": 0
}
],
[
{
"node": "Aggregate Posts",
"type": "main",
"index": 0
}
]
]
},
"Map Lead Data": {
"main": [
[
{
"node": "Apify LinkedIn Scraper",
"type": "main",
"index": 0
}
]
]
},
"Aggregate Posts": {
"main": [
[
{
"node": "Analyze LinkedIn Context",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Leads": {
"main": [
[],
[
{
"node": "Map Lead Data",
"type": "main",
"index": 0
}
]
]
},
"Apify LinkedIn Scraper": {
"main": [
[
{
"node": "Posts Found?",
"type": "main",
"index": 0
}
]
]
},
"Pass-through (Website)": {
"main": [
[
{
"node": "Merge Loops",
"type": "main",
"index": 0
}
]
]
},
"Scrape Company Website": {
"main": [
[
{
"node": "Convert HTML to Markdown",
"type": "main",
"index": 0
}
]
]
},
"Analyze Website Context": {
"main": [
[
{
"node": "Write Email Copy (Website Context)",
"type": "main",
"index": 0
}
]
]
},
"Pass-through (LinkedIn)": {
"main": [
[
{
"node": "Merge Loops",
"type": "main",
"index": 1
}
]
]
},
"Analyze LinkedIn Context": {
"main": [
[
{
"node": "Write Email Copy (LinkedIn Context)",
"type": "main",
"index": 0
}
]
]
},
"Convert HTML to Markdown": {
"main": [
[
{
"node": "Analyze Website Context",
"type": "main",
"index": 0
}
]
]
},
"Update Row (Website Data)": {
"main": [
[
{
"node": "Pass-through (Website)",
"type": "main",
"index": 0
}
]
]
},
"Update Row (LinkedIn Data)": {
"main": [
[
{
"node": "Pass-through (LinkedIn)",
"type": "main",
"index": 0
}
]
]
},
"Write Email Copy (Website Context)": {
"main": [
[
{
"node": "Update Row (Website Data)",
"type": "main",
"index": 0
}
]
]
},
"Write Email Copy (LinkedIn Context)": {
"main": [
[
{
"node": "Update Row (LinkedIn Data)",
"type": "main",
"index": 0
}
]
]
},
"When clicking \u2018Execute workflow\u2019": {
"main": [
[
{
"node": "Fetch Leads",
"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.
googleSheetsOAuth2ApiopenAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow automates the generation of hyper-personalized cold emails. It intelligently switches between two data sources: LinkedIn Activity and Company Website.
Source: https://n8n.io/workflows/12837/ — 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.
Ask questions like “How much did I spend on food last month?” and get instant answers from your financial data — directly in Telegram.
The Problem That it Solves
This intelligent email automation workflow helps you maximize engagement through domain-based outreach. It utilizes AI-powered personalization and strategic follow-ups to increase response rates. The
Note: Now includes an Apify alternative for Rapid API (Some users can't create new accounts on Rapid API, so I have added an alternative for you. But immediately you are able to get access to Rapid AP
Scrape ads – Pulls Facebook Ad Library data for "ai automation" keywords using Apify Filter & sort – Filters ads by page likes (>1,000) and separates into videos, images, and text ads Analyze creat