This workflow corresponds to n8n.io template #6919 — 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": "1a7a6e6d-94e9-4c5d-bdaf-bba303afba79",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
760,
560
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "ea89f057-8d27-4458-bf2c-9e9491c684c2",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
880,
560
],
"parameters": {
"jsonSchemaExample": "{\n\t\"summary\": \"summary\",\n\t\"how to re-engage\": \"how to re-engage\", \n \"email subject\": \"email subject\", \n \"email body\": \"Email Body\"\n}"
},
"typeVersion": 1.2
},
{
"id": "099926bf-2203-440a-bdc2-24f0e37d9384",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-420,
-40
],
"parameters": {
"color": 5,
"width": 440,
"height": 760,
"content": "\n### \ud83d\udce5 Step 1 \u2014 Pull Email List from Google Sheets\n\n1. **Copy the sample spreadsheet** \n [Click to copy](https://docs.google.com/spreadsheets/d/1rQD493GNtTWms6GF0Wracu9Yrm0AR0jxwaWdv8eJbUM/copy) \n It must include at least one column named `Email`.\n\n2. **In n8n:**\n - Add a **Google Sheets OAuth2** credential.\n - In the **Google Sheets** node, select the copied sheet and set the sheet name (e.g., `Sheet1`).\n - This will be your source list of leads to re-engage.\n"
},
"typeVersion": 1
},
{
"id": "5115756e-826f-46c9-ab01-94c67a18b914",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
40,
-40
],
"parameters": {
"color": 4,
"width": 600,
"height": 760,
"content": "### \ud83d\udcec Step 2 \u2014 Search Outlook for Past Conversations\n\n1. **Create a Microsoft Outlook OAuth2 credential** in n8n.\n\n2. In the **Microsoft Outlook node**:\n - Operation: `getAll`\n - Filters:\n - `receivedDateTime ge 2025-01-01T00:00:00Z`\n - `sender = {{ $json.Email }}` (dynamic from Sheets)\n - Return all emails sent by each lead since January 2025.\n\n---\n\n### \ud83d\udcca Step 3 \u2014 Aggregate Email Content\n\n- Use an **Aggregate** node to combine the key fields:\n - `subject`, `body`, `createdDateTime`\n\n- Add a **Code node** with the following JavaScript to convert all records into a single string:\n ```js\n return [{\n json: {\n text: items.map(item => JSON.stringify(item.json)).join('\\\\n'),\n },\n }];"
},
"typeVersion": 1
},
{
"id": "75834341-74f5-4722-b106-f3b5ff80a1e3",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
660,
-40
],
"parameters": {
"color": 6,
"width": 380,
"height": 760,
"content": "### \ud83e\udde0 Step 4 \u2014 Use OpenAI to Summarize & Suggest Re-Engagement Strategy\n\n1. **Add your OpenAI API key** in n8n using the `OpenAI Chat Model` node. \n - Recommended model: `gpt-4o-mini` or higher.\n\n2. **Attach a Code node** to pass the aggregated email content into a single text block:\n ```js\n return [{\n json: {\n text: items.map(item => JSON.stringify(item.json)).join('\\\\n'),\n },\n }];"
},
"typeVersion": 1
},
{
"id": "2c7676d8-650d-46e9-8fe9-152f5afebc7b",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1060,
-40
],
"parameters": {
"color": 3,
"width": 380,
"height": 760,
"content": "### \ud83d\udce8 Step 6 \u2014 Create a Draft Email in Outlook\n\nAfter generating the re-engagement strategy and draft email with OpenAI, this step automatically creates a draft email in Microsoft Outlook.\n\n1. **Add a `Microsoft Outlook` node** to the workflow.\n2. Set the **Resource** to `Draft`.\n3. Fill out the following fields:\n - **To Recipients:** \n `={{ $('Google Sheets').item.json.Email }}`\n - **Subject:** \n `={{ $json.output['email subject'] }}`\n - **Body Content:** \n `={{ $json.output['email body'] }}`\n\n4. Connect your **Microsoft Outlook account** using the `OAuth2` credential type.\n\n\ud83d\udca1 This creates a fully drafted email based on AI analysis, ready for manual review and sending.\n"
},
"typeVersion": 1
},
{
"id": "2355df82-9e1c-4777-bf90-4e7caa77cf9b",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-420,
-200
],
"parameters": {
"width": 1860,
"height": 140,
"content": "# \ud83e\udd16 AI-Powered Lead Re-Engagement via Google Sheets, Outlook & OpenAI \n**Need more help? Feel free to reach out \u2013 robert@ynteractive.com | [LinkedIn](https://www.linkedin.com/in/robert-breen-29429625/)**\n"
},
"typeVersion": 1
},
{
"id": "f56ec71b-15bd-4288-96cd-5726b79a36a2",
"name": "Start Workflow",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-400,
300
],
"parameters": {},
"typeVersion": 1
},
{
"id": "1f053b63-9915-4cfd-b70d-ac922a58f0d2",
"name": "Get Stale Leads",
"type": "n8n-nodes-base.googleSheets",
"position": [
-200,
480
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rQD493GNtTWms6GF0Wracu9Yrm0AR0jxwaWdv8eJbUM/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1rQD493GNtTWms6GF0Wracu9Yrm0AR0jxwaWdv8eJbUM",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rQD493GNtTWms6GF0Wracu9Yrm0AR0jxwaWdv8eJbUM/edit?usp=drivesdk",
"cachedResultName": "Lead ReEngagement"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.6
},
{
"id": "2d3d468f-6d2e-4c13-a477-01c4f41bc3d1",
"name": "Get all emails from the lead",
"type": "n8n-nodes-base.microsoftOutlook",
"position": [
80,
560
],
"parameters": {
"output": "raw",
"options": {},
"filtersUI": {
"values": {
"filters": {
"custom": "receivedDateTime ge 2025-01-01T00:00:00Z",
"sender": "={{ $json.Email }}"
}
}
},
"operation": "getAll",
"returnAll": true
},
"credentials": {
"microsoftOutlookOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2
},
{
"id": "fb0efd84-b82b-44e9-bb74-59b4fd6e9e3a",
"name": "Combine into one field",
"type": "n8n-nodes-base.aggregate",
"position": [
280,
560
],
"parameters": {
"include": "specifiedFields",
"options": {},
"aggregate": "aggregateAllItemData",
"fieldsToInclude": "subject, body, createdDateTime"
},
"typeVersion": 1
},
{
"id": "306c8218-4f43-4a77-accf-19d3c64fd5cb",
"name": "Convert object fields to text",
"type": "n8n-nodes-base.code",
"position": [
460,
560
],
"parameters": {
"jsCode": "return [\n {\n json: {\n text: items.map(item => JSON.stringify(item.json)).join('\\n'),\n },\n },\n];\n"
},
"typeVersion": 2
},
{
"id": "311c5ecd-fa2b-4259-a0ba-cb9f0e8d81f2",
"name": "AI Agent - Re-Engage Lead",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
720,
360
],
"parameters": {
"text": "=Recent Emails from lead: {{ $json.text }}",
"options": {
"systemMessage": "You are a helpful assistant trained to analyze prior email conversations for lead re-engagement.\n\nGiven a list of recent emails from a contact, perform the following:\n\n1. Summarize what the person has communicated in the past. Focus on the main topics, interests, concerns, or any open threads.\n2. Suggest 2\u20133 strategic ideas for how I can re-engage this lead. Format your suggestions as bullet points.\n3. Write a professional, friendly re-engagement email I can send them. Make the tone approachable but business-relevant.\n\nReturn your output in the following JSON structure:\n\n{\n \"summary\": \"Concise summary of their past emails\",\n \"how to re-engage\": \"\u2022 First suggestion\\n\u2022 Second suggestion\\n\u2022 Third suggestion\",\n \"email subject\": \"Suggested subject line\",\n \"email body\": \"Complete draft email body\"\n}\n"
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 2
},
{
"id": "070dd56f-5d64-4132-a93c-1344185d985a",
"name": "Save data to Sheets",
"type": "n8n-nodes-base.googleSheets",
"position": [
1180,
460
],
"parameters": {
"columns": {
"value": {
"Email": "={{ $('Get Stale Leads').item.json.Email }}",
"Summary": "={{ $json.output.summary }}",
"Email Body": "={{ $json.output['email body'] }}",
"Email Subject": "={{ $json.output['email subject'] }}",
"How Can I Re-Engage": "={{ $json.output['how to re-engage'] }}"
},
"schema": [
{
"id": "Email",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Email",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Summary",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Summary",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "How Can I Re-Engage",
"type": "string",
"display": true,
"required": false,
"displayName": "How Can I Re-Engage",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Email Subject",
"type": "string",
"display": true,
"required": false,
"displayName": "Email Subject",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Email Body",
"type": "string",
"display": true,
"required": false,
"displayName": "Email Body",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Email"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rQD493GNtTWms6GF0Wracu9Yrm0AR0jxwaWdv8eJbUM/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1rQD493GNtTWms6GF0Wracu9Yrm0AR0jxwaWdv8eJbUM",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rQD493GNtTWms6GF0Wracu9Yrm0AR0jxwaWdv8eJbUM/edit?usp=drivesdk",
"cachedResultName": "Lead ReEngagement"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.6
},
{
"id": "fc7a0147-ac51-4500-aaf5-f233f1af8c7a",
"name": "Create draft email",
"type": "n8n-nodes-base.microsoftOutlook",
"position": [
1320,
580
],
"parameters": {
"subject": "={{ $json.output['email subject'] }}",
"resource": "draft",
"bodyContent": "={{ $json.output['email body'] }}",
"additionalFields": {
"toRecipients": "={{ $('Get Stale Leads').item.json.Email }}"
}
},
"credentials": {
"microsoftOutlookOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2
}
],
"connections": {
"Start Workflow": {
"main": [
[
{
"node": "Get Stale Leads",
"type": "main",
"index": 0
}
]
]
},
"Get Stale Leads": {
"main": [
[
{
"node": "Get all emails from the lead",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent - Re-Engage Lead",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Combine into one field": {
"main": [
[
{
"node": "Convert object fields to text",
"type": "main",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "AI Agent - Re-Engage Lead",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"AI Agent - Re-Engage Lead": {
"main": [
[
{
"node": "Create draft email",
"type": "main",
"index": 0
},
{
"node": "Save data to Sheets",
"type": "main",
"index": 0
}
]
]
},
"Get all emails from the lead": {
"main": [
[
{
"node": "Combine into one field",
"type": "main",
"index": 0
}
]
]
},
"Convert object fields to text": {
"main": [
[
{
"node": "AI Agent - Re-Engage Lead",
"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.
googleSheetsOAuth2ApimicrosoftOutlookOAuth2ApiopenAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This powerful n8n workflow helps you automatically re-engage cold leads by summarizing their past emails and generating personalized outreach with OpenAI. It pulls in contacts from Google Sheets, fetches their prior communication from Outlook, and then uses an AI agent to…
Source: https://n8n.io/workflows/6919/ — 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.
Automatically analyze the sentiment of Facebook posts and their audience comments using GPT-4 to identify trends and potential PR risks. 🧠💬 This workflow fetches recent posts via the Facebook Graph AP
🎯 Create viral TikToks, Shorts, Reels, podcasts, and ASMR videos in minutes — all on autopilot.
Generate AI viral videos with NanoBanana & VEO3, shared on socials via Blotato 2. Uses @blotato/n8n-nodes-blotato, googleSheets, lmChatOpenAi, toolThink. Event-driven trigger; 94 nodes.
This template is designed for marketers, content creators, and e-commerce brands who want to automate the creation of professional ad videos at scale. It’s ideal for teams looking to generate consiste
Digistars - Scrape & Crawl. Uses httpRequest, n8n-nodes-firecrawl-scraper, googleSheets, lmChatOpenAi. Event-driven trigger; 63 nodes.