This workflow corresponds to n8n.io template #10840 — we link there as the canonical source.
This workflow follows the Agent → Chat Trigger 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 →
{
"id": "auNGerGZ1885fnxC",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "AI-Powered Sales CRM Chatbot with Google Sheets Lookup & Memory (GPT-4o-mini)",
"tags": [],
"nodes": [
{
"id": "36c30ad7-6cba-4e85-a6cd-2c6f779cc6d8",
"name": "When chat message received",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
-512,
-32
],
"parameters": {
"options": {
"responseMode": "responseNodes"
}
},
"typeVersion": 1.3
},
{
"id": "dbd2d924-42d3-45a8-ab25-cba180f1e6df",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-736,
576
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "c3a8fd2b-f863-4274-a04b-1083b1f56a3c",
"name": "outreachSheet",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
304,
672
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 46113423,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/17rcNd_ZpUQLm0uWEVbD-NY6GyFUkrD4BglvawlyBygM/edit#gid=46113423",
"cachedResultName": "outreach automation"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "17rcNd_ZpUQLm0uWEVbD-NY6GyFUkrD4BglvawlyBygM",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/17rcNd_ZpUQLm0uWEVbD-NY6GyFUkrD4BglvawlyBygM/edit?usp=drivesdk",
"cachedResultName": "sample_leads_50"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "56e82657-1f32-476d-b29a-a7bf0365bb8a",
"name": "opportunitySheet",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
-16,
656
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1423466972,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/17rcNd_ZpUQLm0uWEVbD-NY6GyFUkrD4BglvawlyBygM/edit#gid=1423466972",
"cachedResultName": "ghl database"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "17rcNd_ZpUQLm0uWEVbD-NY6GyFUkrD4BglvawlyBygM",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/17rcNd_ZpUQLm0uWEVbD-NY6GyFUkrD4BglvawlyBygM/edit?usp=drivesdk",
"cachedResultName": "sample_leads_50"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "fb5ff6cd-5693-4459-afe1-f19f6ea3cdb4",
"name": "AI Sales CRM Router",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-144,
-32
],
"parameters": {
"text": "=You are interacting with a sales assistant chatbot.\n\nUser Query:{{ $json.chatInput }}\n\n\nYour tasks:\n1. Understand the user\u2019s question.\n2. Use the Google Sheets tool to search for relevant data:\n - Lead Status\n - Contact Details\n - Company Details\n - Outreach Status\n - Proposal Links\n - GHL Opportunity Details\n3. Use only the data returned from the sheet lookups.\n4. If data is missing, ask the user for more information.\n5. Give a clear and helpful answer based strictly on available data.\n",
"options": {
"systemMessage": "=You are an AI Sales CRM Agent inside n8n.\n\nYou have access to the following tools:\n1. outreachSheet \u2013 lookup in Outreach Automation sheet.\n2. opportunitySheet \u2013 lookup in GHL Opportunities sheet.\n\nRULES FOR TOOL USE:\n- If user mentions email, company name, contact name, status, lead, opportunity, or proposal:\n YOU MUST call the appropriate tool BEFORE answering.\n\nTOOL CALL FORMAT:\nRespond ONLY using this JSON format when calling a tool:\n\n{\n \"tool\": \"<toolName>\",\n \"input\": {\n \"searchColumn\": \"<column>\",\n \"searchValue\": \"<value>\"\n }\n}\n\nNever guess data. Always lookup first.\nIf no match is found, ask for more details.\nAfter a tool returns data, summarize it for the user.\n"
},
"promptType": "define"
},
"typeVersion": 2.1
},
{
"id": "d5112fbf-21e2-40da-b4c7-00d93f2f66d3",
"name": "Conversation Memory Buffer",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
-400,
752
],
"parameters": {
"contextWindowLength": 7
},
"typeVersion": 1.3
},
{
"id": "5811a14f-5b9c-4fce-b193-ae3d00fe3b56",
"name": "Validate AI Output Payload",
"type": "n8n-nodes-base.if",
"position": [
272,
-32
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "e2adb005-2b3c-4d1e-8445-442df1fe925a",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json.output }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "7a812c73-98c0-4dc0-899b-822569a6b942",
"name": "Log Invalid Chat Records to Google Sheets",
"type": "n8n-nodes-base.googleSheets",
"position": [
720,
496
],
"parameters": {
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "",
"cachedResultUrl": "",
"cachedResultName": ""
},
"documentId": {
"__rl": true,
"mode": "url",
"value": ""
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.6
},
{
"id": "a81feba3-9894-498e-825e-0c244bfb9c3d",
"name": "Write Chat Memory to Google Sheets",
"type": "n8n-nodes-base.googleSheets",
"position": [
688,
-32
],
"parameters": {
"columns": {
"value": {
"SessionID": "={{ $('When chat message received').item.json.sessionId }}",
"Timestamp": "={{ new Date().toISOString() }}",
"UserMessage": "={{ $('When chat message received').item.json.chatInput }}",
"AssistantResponse": "={{ $json.output }}"
},
"schema": [
{
"id": "Timestamp",
"type": "string",
"display": true,
"required": false,
"displayName": "Timestamp",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "SessionID",
"type": "string",
"display": true,
"required": false,
"displayName": "SessionID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "UserMessage",
"type": "string",
"display": true,
"required": false,
"displayName": "UserMessage",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "AssistantResponse",
"type": "string",
"display": true,
"required": false,
"displayName": "AssistantResponse",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1064505346,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/17rcNd_ZpUQLm0uWEVbD-NY6GyFUkrD4BglvawlyBygM/edit#gid=1064505346",
"cachedResultName": "chat_memory"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "17rcNd_ZpUQLm0uWEVbD-NY6GyFUkrD4BglvawlyBygM",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/17rcNd_ZpUQLm0uWEVbD-NY6GyFUkrD4BglvawlyBygM/edit?usp=drivesdk",
"cachedResultName": "sample_leads_50"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.6
},
{
"id": "fec7c98e-c232-4e7c-be7d-3ac8bde820a4",
"name": "Send Chat Response",
"type": "@n8n/n8n-nodes-langchain.chat",
"position": [
1008,
-32
],
"parameters": {
"message": "=={{ $(\"AI Sales CRM Router\").item.json.output }}\n",
"options": {},
"waitUserReply": false
},
"typeVersion": 1
},
{
"id": "bbb79e7e-198b-4736-bee8-6b815bdb96c7",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1328,
-656
],
"parameters": {
"width": 544,
"height": 480,
"content": "## \ud83d\udcac AI-Powered Sales CRM Chatbot with Google Sheets Lookup & Memory (GPT-4o-mini)\nA conversational chatbot that connects directly with Google Sheets to answer sales queries, fetch outreach data, and recall past interactions. \nActs as an intelligent assistant for lead status, proposals, and opportunity lookups.\n\n### \ud83d\udd39 Workflow Highlights\n1\ufe0f\u20e3 Triggered by new chat messages \n2\ufe0f\u20e3 Routes requests to AI Sales CRM Router (GPT-4o-mini) \n3\ufe0f\u20e3 Dynamically accesses Google Sheets (Outreach + Opportunities) \n4\ufe0f\u20e3 Maintains memory across multiple turns \n5\ufe0f\u20e3 Logs all chats to \u201cchat_memory\u201d sheet \n6\ufe0f\u20e3 Responds instantly via n8n\u2019s chat interface \n\n### \ud83d\udd39 Tools & Integrations\n- **GPT-4o-mini** \u2192 AI reasoning & response generation \n- **Google Sheets Tools** \u2192 Outreach & GHL database access \n- **Memory Buffer** \u2192 Context retention for multi-turn chats \n- **n8n Chat UI** \u2192 Live interface for conversation \n- **Google Sheets (logging)** \u2192 Historical chat tracking\n"
},
"typeVersion": 1
},
{
"id": "0379635f-48a6-4b8f-9ef7-3ab9939ba9fc",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-576,
-320
],
"parameters": {
"color": 7,
"height": 464,
"content": "## \u25b6\ufe0f Chat Trigger \u2014 \u201cWhen chat message received\u201d \nStarts whenever a user sends a message via the n8n Chat interface. \nThe input (`chatInput`) contains user query text and session ID.\n"
},
"typeVersion": 1
},
{
"id": "126caf24-ff59-4ad9-a771-e333a96eb6f4",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-800,
304
],
"parameters": {
"color": 7,
"width": 224,
"height": 432,
"content": "## \ud83e\udde0 OpenAI Chat Model (GPT-4o-mini) \nProvides the conversational intelligence for the chatbot. \nUsed by the \u201cAI Sales CRM Router\u201d for reasoning and response creation.\n"
},
"typeVersion": 1
},
{
"id": "19766639-15d8-446b-8625-624e0c8291c6",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-240,
-432
],
"parameters": {
"color": 7,
"width": 400,
"height": 592,
"content": "## \ud83e\udd16 AI Sales CRM Router \nActs as the core logic hub for the chatbot. \nResponsibilities:\n- Understands user intent \n- Decides when to query Google Sheets tools \n- Builds JSON tool calls automatically \n- Generates final summarized responses \n\n### Key Rules:\n- Never guess data; always lookup first \n- Uses structured JSON tool calls like:\n {\n \"tool\": \"<toolName>\",\n \"input\": {\n \"searchColumn\": \"<column>\",\n \"searchValue\": \"<value>\"\n }\n }\n"
},
"typeVersion": 1
},
{
"id": "c3e04038-eacd-457f-a046-1d14e9710f17",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
224,
400
],
"parameters": {
"color": 7,
"height": 432,
"content": "## \ud83d\udccb Outreach Sheet Tool \nConnects to \u201coutreach automation\u201d sheet in Google Sheets. \nUsed for lead follow-up, proposal link, and outreach status lookups. \nCalled automatically by AI when user mentions leads, emails, or outreach progress.\n"
},
"typeVersion": 1
},
{
"id": "e3c39d41-1ca6-418f-827a-6fe54cb36a2d",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-128,
416
],
"parameters": {
"color": 7,
"height": 416,
"content": "## \ud83d\udcbc Opportunity Sheet Tool \nConnects to \u201cghl database\u201d sheet for opportunity and CRM deal data. \nUsed for company-level queries like pipeline stage, deal value, or assigned rep.\n"
},
"typeVersion": 1
},
{
"id": "0fac9f52-537b-4be1-90ca-35f1943f2b9d",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-464,
448
],
"parameters": {
"color": 7,
"height": 464,
"content": "## \ud83e\udde0 Conversation Memory Buffer \nStores short-term conversation context (last 7 turns). \nAllows multi-turn chat: the bot remembers previous user messages in the same session. \nKey for natural, contextual replies.\n"
},
"typeVersion": 1
},
{
"id": "f18e3518-1c09-4de6-a994-c2910f841a06",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
208,
-288
],
"parameters": {
"color": 7,
"height": 448,
"content": "## \u2705 Validate AI Output Payload \nChecks if the AI successfully produced a response (`output` field not empty). \n\u2705 If yes \u2192 Writes to memory sheet and responds \n\u274c If no \u2192 Logs invalid interaction for review.\n"
},
"typeVersion": 1
},
{
"id": "f90af355-a681-4d36-bb24-3edc771f6653",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
608,
-336
],
"parameters": {
"color": 7,
"height": 528,
"content": "## \ud83d\uddc2\ufe0f Write Chat Memory to Google Sheets \nAppends every conversation turn (timestamp, session ID, user message, assistant response) into the \u201cchat_memory\u201d sheet. \nHelps in tracking conversation logs and fine-tuning the chatbot.\n"
},
"typeVersion": 1
},
{
"id": "6f1e85ce-b053-4998-9854-863a6389f341",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
640,
256
],
"parameters": {
"color": 7,
"height": 448,
"content": "## \u26a0\ufe0f Log Invalid Chat Records \nSaves interactions where AI output is missing or malformed. \nUseful for debugging tool-call or API response issues.\n"
},
"typeVersion": 1
},
{
"id": "b9abc6b1-bdf9-47ad-b99d-8a2afd2df742",
"name": "Sticky Note10",
"type": "n8n-nodes-base.stickyNote",
"position": [
928,
-272
],
"parameters": {
"color": 7,
"height": 416,
"content": "## \ud83d\udcac Send Chat Response \nDelivers AI\u2019s generated response back to the user in the chat interface. \nCompletes the interaction loop in real-time.\n"
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "b0c667ec-eaca-4d4e-a959-6610e42c9b94",
"connections": {
"outreachSheet": {
"ai_tool": [
[
{
"node": "AI Sales CRM Router",
"type": "ai_tool",
"index": 0
}
]
]
},
"opportunitySheet": {
"ai_tool": [
[
{
"node": "AI Sales CRM Router",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Sales CRM Router",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"AI Sales CRM Router": {
"main": [
[
{
"node": "Validate AI Output Payload",
"type": "main",
"index": 0
}
]
]
},
"Conversation Memory Buffer": {
"ai_memory": [
[
{
"node": "AI Sales CRM Router",
"type": "ai_memory",
"index": 0
}
]
]
},
"Validate AI Output Payload": {
"main": [
[
{
"node": "Write Chat Memory to Google Sheets",
"type": "main",
"index": 0
}
],
[
{
"node": "Log Invalid Chat Records to Google Sheets",
"type": "main",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "AI Sales CRM Router",
"type": "main",
"index": 0
}
]
]
},
"Write Chat Memory to Google Sheets": {
"main": [
[
{
"node": "Send Chat Response",
"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 creates a fully interactive AI-powered Sales CRM Chatbot inside n8n, capable of understanding user queries, searching Google Sheets for CRM data, and responding intelligently based on real records. It integrates GPT-4o-mini with two live data sources—Outreach…
Source: https://n8n.io/workflows/10840/ — 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.
Who is this workflow for? This workflow is designed for SEO analysts, content creators, marketing agencies, and developers who need to index a website and then interact with its content as if it were
Send an AI a few details about your "Dream Customer" in normal english, then have it search the web and give you a "Dream 100" - 100 ideal prospects to connect with in your industry.
Generate high-quality, SEO-optimized content briefs automatically using AI, real-time keyword research, SERP intelligence, and historical content context. This workflow standardizes user inputs, fetch
Streamline the final stage of your content production workflow by automating publishing, formatting, metadata generation, and approval routing. This AI-powered subworkflow pulls optimized drafts from
Let your team create, track, and manage project tasks through natural conversation. This workflow uses an AI Project Manager Agent that chats with users, gathers the task details it needs, and automat