AI网站chatbot - GPT与Google表格CRM线索收集
Ceci est unLead Generation, Multimodal AIworkflow d'automatisation du domainecontenant 14 nœuds.Utilise principalement des nœuds comme Code, GoogleSheets, Agent, ChatTrigger, LmChatOpenAi. intégrationGPTetGoogle表格deAI网站chatbot - CRM线索收集系统
- •Informations d'identification Google Sheets API
- •Clé API OpenAI
Nœuds utilisés (14)
Catégorie
{
"meta": {
"instanceId": "ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "a917cc6d-ac5b-425b-877f-e40347b49c4c",
"name": "À la réception du message",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
1360,
2016
],
"webhookId": "3768e882-2c41-4d64-a68a-5bdfb4adab43",
"parameters": {
"options": {}
},
"typeVersion": 1.3
},
{
"id": "71c6b7dc-23fd-4a5f-a4f2-58cde14f2f9f",
"name": "When Executed by Another Workflow",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"position": [
208,
1872
],
"parameters": {
"inputSource": "passthrough"
},
"typeVersion": 1.1
},
{
"id": "df400ef3-17dd-48f0-9f19-d3d43e3f1eb9",
"name": "Modèle de chat OpenAI3",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1520,
2176
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "4l6TDfLZVFS24g3X",
"name": "OpenAi account 4"
}
},
"typeVersion": 1.2
},
{
"id": "59356e4b-8b1f-4187-b727-17a792392bb6",
"name": "Simple Mémoire3",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
1680,
2176
],
"parameters": {},
"typeVersion": 1.3
},
{
"id": "c96fcd55-592a-461b-991f-8f403f3a472d",
"name": "Modèle de chat OpenAI4",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
448,
2176
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "4l6TDfLZVFS24g3X",
"name": "OpenAi account 4"
}
},
"typeVersion": 1.2
},
{
"id": "30ba5186-a271-4d6e-a219-6a0262ef20d7",
"name": "Website Chatbot",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1632,
1984
],
"parameters": {
"options": {
"systemMessage": "You are the first point of contact for visitors on our website. We are a consulting firm that helps companies automate their internal processes using n8n, an open-source workflow automation platform.\n\nKeep answers brief. \n\nOur services include:\n\nDesigning and implementing automations using n8n\n\nReplacing manual work with fully automated workflows\n\nTraining teams to manage and scale automations in-house\n\nYour primary goals are:\n\nBriefly explain what we do in a helpful, conversational tone.\n\nAsk the visitor what kinds of processes they’re hoping to automate or what challenges they’re facing.\n\nCollect their name and email address so someone from our team can follow up.\n\nBe friendly, curious, and professional. If the visitor shares their contact information, confirm it and thank them — and pass the details to our CRM workflow.\n\n\nAfter you have the email address, and what the user needs. send all the info all together to the crm tool. "
}
},
"typeVersion": 2.2
},
{
"id": "bc45a7ff-b74f-4901-96f0-2a818358ffaf",
"name": "Convert Conversation",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
464,
1936
],
"parameters": {
"text": "=query {{ $json.query }}",
"options": {
"systemMessage": "You are a formatting assistant. Format the incoming query. Your only job is to extract and convert the input into clean, valid JSON.\n\nOnly return a JSON object like this:\n\noutput email in json like this. \n\n{\n \"email\": \"jane.doe@example.com\",\n \"description\": \"Wants help automating lead intake and sending Slack notifications.\"\n}\n\n\n"
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 2.2
},
{
"id": "81a753e0-4198-4841-ac41-e9efb4b69ad9",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
640,
2176
],
"parameters": {
"jsonSchemaExample": "{\n \"email\": \"jane.doe@example.com\",\n \"description\": \"Wants help automating lead intake and sending Slack notifications.\"\n}\n"
},
"typeVersion": 1.3
},
{
"id": "7ef56380-f69f-4e48-8c42-bc5706fdcfe1",
"name": "Append row in sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
816,
1952
],
"parameters": {
"columns": {
"value": {
"email": "={{ $json.output.email }}",
"description": "={{ $json.output.description }}"
},
"schema": [
{
"id": "email",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "email",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "description",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "description",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Lr54_U6khrE8jjU-rocf0N1Phe7ZIovLppTjBzIraZk/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1Lr54_U6khrE8jjU-rocf0N1Phe7ZIovLppTjBzIraZk",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Lr54_U6khrE8jjU-rocf0N1Phe7ZIovLppTjBzIraZk/edit?usp=drivesdk",
"cachedResultName": "Sample Leads"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "HlBW2puZbuCCq8jJ",
"name": "Google Sheets account 3"
}
},
"typeVersion": 4.6
},
{
"id": "a1b29f7c-efd0-46cc-989a-b72c01adb970",
"name": "Code",
"type": "n8n-nodes-base.code",
"position": [
1040,
1936
],
"parameters": {
"jsCode": "return [\n {\n json: {\n text: \"Thanks for the info, we will be in touch soon\"\n }\n }\n];\n"
},
"typeVersion": 2
},
{
"id": "e5a327d0-cfae-484e-8468-ef92d161b3b8",
"name": "crm tool",
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"position": [
1840,
2176
],
"parameters": {
"source": "parameter",
"description": "crm tool to store lead information",
"workflowJson": "{\n \"nodes\": [\n {\n \"parameters\": {\n \"inputSource\": \"passthrough\"\n },\n \"type\": \"n8n-nodes-base.executeWorkflowTrigger\",\n \"typeVersion\": 1.1,\n \"position\": [\n 176,\n 1248\n ],\n \"id\": \"71c6b7dc-23fd-4a5f-a4f2-58cde14f2f9f\",\n \"name\": \"When Executed by Another Workflow\"\n },\n {\n \"parameters\": {\n \"model\": {\n \"__rl\": true,\n \"value\": \"gpt-4o-mini\",\n \"mode\": \"list\",\n \"cachedResultName\": \"gpt-4o-mini\"\n },\n \"options\": {}\n },\n \"type\": \"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\n \"typeVersion\": 1.2,\n \"position\": [\n 400,\n 1472\n ],\n \"id\": \"c96fcd55-592a-461b-991f-8f403f3a472d\",\n \"name\": \"OpenAI Chat Model4\",\n \"credentials\": {\n \"openAiApi\": {\n \"id\": \"4l6TDfLZVFS24g3X\",\n \"name\": \"OpenAi account 4\"\n }\n }\n },\n {\n \"parameters\": {\n \"promptType\": \"define\",\n \"text\": \"=query {{ $json.query }}\",\n \"hasOutputParser\": true,\n \"options\": {\n \"systemMessage\": \"You are a formatting assistant. Format the incoming query. Your only job is to extract and convert the input into clean, valid JSON.\\n\\nOnly return a JSON object like this:\\n\\noutput email in json like this. \\n\\n{\\n \\\"email\\\": \\\"jane.doe@example.com\\\",\\n \\\"description\\\": \\\"Wants help automating lead intake and sending Slack notifications.\\\"\\n}\\n\\n\\n\"\n }\n },\n \"type\": \"@n8n/n8n-nodes-langchain.agent\",\n \"typeVersion\": 2.2,\n \"position\": [\n 400,\n 1248\n ],\n \"id\": \"bc45a7ff-b74f-4901-96f0-2a818358ffaf\",\n \"name\": \"Convert Conversation\"\n },\n {\n \"parameters\": {\n \"jsonSchemaExample\": \"{\\n \\\"email\\\": \\\"jane.doe@example.com\\\",\\n \\\"description\\\": \\\"Wants help automating lead intake and sending Slack notifications.\\\"\\n}\\n\"\n },\n \"type\": \"@n8n/n8n-nodes-langchain.outputParserStructured\",\n \"typeVersion\": 1.3,\n \"position\": [\n 576,\n 1456\n ],\n \"id\": \"81a753e0-4198-4841-ac41-e9efb4b69ad9\",\n \"name\": \"Structured Output Parser\"\n },\n {\n \"parameters\": {\n \"operation\": \"append\",\n \"documentId\": {\n \"__rl\": true,\n \"value\": \"1Lr54_U6khrE8jjU-rocf0N1Phe7ZIovLppTjBzIraZk\",\n \"mode\": \"list\",\n \"cachedResultName\": \"Sample Leads\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/1Lr54_U6khrE8jjU-rocf0N1Phe7ZIovLppTjBzIraZk/edit?usp=drivesdk\"\n },\n \"sheetName\": {\n \"__rl\": true,\n \"value\": \"gid=0\",\n \"mode\": \"list\",\n \"cachedResultName\": \"Sheet1\",\n \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/1Lr54_U6khrE8jjU-rocf0N1Phe7ZIovLppTjBzIraZk/edit#gid=0\"\n },\n \"columns\": {\n \"mappingMode\": \"defineBelow\",\n \"value\": {\n \"email\": \"={{ $json.output.email }}\",\n \"description\": \"={{ $json.output.description }}\"\n },\n \"matchingColumns\": [],\n \"schema\": [\n {\n \"id\": \"email\",\n \"displayName\": \"email\",\n \"required\": false,\n \"defaultMatch\": false,\n \"display\": true,\n \"type\": \"string\",\n \"canBeUsedToMatch\": true,\n \"removed\": false\n },\n {\n \"id\": \"description\",\n \"displayName\": \"description\",\n \"required\": false,\n \"defaultMatch\": false,\n \"display\": true,\n \"type\": \"string\",\n \"canBeUsedToMatch\": true,\n \"removed\": false\n }\n ],\n \"attemptToConvertTypes\": false,\n \"convertFieldsToString\": false\n },\n \"options\": {}\n },\n \"type\": \"n8n-nodes-base.googleSheets\",\n \"typeVersion\": 4.6,\n \"position\": [\n 752,\n 1248\n ],\n \"id\": \"7ef56380-f69f-4e48-8c42-bc5706fdcfe1\",\n \"name\": \"Append row in sheet\",\n \"credentials\": {\n \"googleSheetsOAuth2Api\": {\n \"id\": \"HlBW2puZbuCCq8jJ\",\n \"name\": \"Google Sheets account 3\"\n }\n }\n },\n {\n \"parameters\": {\n \"jsCode\": \"return [\\n {\\n json: {\\n text: \\\"Thanks for the info, we will be in touch soon\\\"\\n }\\n }\\n];\\n\"\n },\n \"type\": \"n8n-nodes-base.code\",\n \"typeVersion\": 2,\n \"position\": [\n 960,\n 1248\n ],\n \"id\": \"a1b29f7c-efd0-46cc-989a-b72c01adb970\",\n \"name\": \"Code\"\n }\n ],\n \"connections\": {\n \"When Executed by Another Workflow\": {\n \"main\": [\n [\n {\n \"node\": \"Convert Conversation\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"OpenAI Chat Model4\": {\n \"ai_languageModel\": [\n [\n {\n \"node\": \"Convert Conversation\",\n \"type\": \"ai_languageModel\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Convert Conversation\": {\n \"main\": [\n [\n {\n \"node\": \"Append row in sheet\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Structured Output Parser\": {\n \"ai_outputParser\": [\n [\n {\n \"node\": \"Convert Conversation\",\n \"type\": \"ai_outputParser\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Append row in sheet\": {\n \"main\": [\n [\n {\n \"node\": \"Code\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n },\n \"pinData\": {\n \"When Executed by Another Workflow\": [\n {\n \"query\": \"New inquiry for n8n training from rbreen@ynteractive.com\"\n }\n ]\n },\n \"meta\": {\n \"templateCredsSetupCompleted\": true,\n \"instanceId\": \"ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9\"\n }\n}"
},
"typeVersion": 2.2
},
{
"id": "d0ad32e5-013c-4da4-b0a0-f2884873157f",
"name": "Note adhésive3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1264,
1312
],
"parameters": {
"color": 5,
"width": 744,
"height": 1036,
"content": "## 2. Create the Main Workflow (Website Chatbot)\nThis workflow acts as the main AI Agent handling incoming chat messages.\n\n### Steps in the main workflow:\n1. **When chat message received** – Starts the workflow whenever a visitor sends a message via your chatbot integration.\n2. **Website Chatbot (Agent Node)** – Configured with a **System Message** that:\n - Briefly explains your services.\n - Asks the visitor what processes they want to automate.\n - Requests their name and email.\n - Sends collected data to the CRM tool once email and description are available.\n3. **OpenAI Chat Model** – Connects to the AI agent as its language model.\n4. **Simple Memory** – Stores short-term context for the ongoing chat.\n5. **CRM Tool (Tool Workflow Node)** – Points to the sub-workflow created in Step 1, allowing the chatbot to trigger it directly.\n\n---\n\n## 3. Connecting the Sub-Workflow to the AI Agent\n1. Add a **Tool Workflow** node to the main workflow.\n2. Select `\"Parameter\"` as the source.\n3. Paste in your sub-workflow JSON or select it from your n8n workflows.\n4. Connect the **Tool Workflow** node to your AI Agent using the `ai_tool` connection.\n5. Give the tool a clear description (e.g., `crm tool to store lead information`) so the agent knows when to use it.\n\n---\n"
},
"typeVersion": 1
},
{
"id": "7d06b640-726e-4cdf-80f1-a10c80675c10",
"name": "Note adhésive5",
"type": "n8n-nodes-base.stickyNote",
"position": [
160,
1312
],
"parameters": {
"color": 6,
"width": 1080,
"height": 1036,
"content": "## Step-by-Step Setup Instructions\n\n### 1. Create the Sub-Workflow (CRM Tool)\nThis sub-workflow will be triggered by the AI agent to process collected information. \nIt will:\n1. Receive inputs (email, description) from the main chatbot workflow.\n2. Format the data into a structured JSON format.\n3. Append the data to a Google Sheet (acting as the CRM database).\n4. Send a confirmation message back to the main workflow.\n\n**Steps inside the sub-workflow:**\n- **When Executed by Another Workflow** – Triggered by the main workflow’s tool node.\n- **Convert Conversation (Agent)** – Uses OpenAI to extract and format the input into a JSON structure\n\n**Append row in sheet (Google Sheets)** – Adds the new lead data to your CRM sheet.\n\n**Code Node** – Returns a simple text confirmation like `\"Thanks for the info, we will be in touch soon\"`.\n\n### Required setup for Google Sheets:\n- Copy this goole sheet. https://docs.google.com/spreadsheets/d/1Lr54_U6khrE8jjU-rocf0N1Phe7ZIovLppTjBzIraZk/edit?usp=drivesdk\n- Enable the Google Sheets API and connect your Google account in n8n.\n- Create a sheet with at least the columns `email` and `description`.\n- Use the sheet's Document ID and tab name in the Google Sheets node.\n\n---\n"
},
"typeVersion": 1
},
{
"id": "e08ba3af-eafd-43be-b23b-86baef135272",
"name": "Note adhésive17",
"type": "n8n-nodes-base.stickyNote",
"position": [
160,
1152
],
"parameters": {
"width": 1840,
"height": 128,
"content": "## 📬 Need Help or Want to Customize This?\n📧 [robert@ynteractive.com](mailto:robert@ynteractive.com) \n🔗 [LinkedIn](https://www.linkedin.com/in/robert-breen-29429625/)"
},
"typeVersion": 1
}
],
"pinData": {
"When Executed by Another Workflow": [
{
"query": "New inquiry for n8n training from rbreen@ynteractive.com"
}
]
},
"connections": {
"e5a327d0-cfae-484e-8468-ef92d161b3b8": {
"ai_tool": [
[
{
"node": "30ba5186-a271-4d6e-a219-6a0262ef20d7",
"type": "ai_tool",
"index": 0
}
]
]
},
"Simple Memory3": {
"ai_memory": [
[
{
"node": "30ba5186-a271-4d6e-a219-6a0262ef20d7",
"type": "ai_memory",
"index": 0
}
]
]
},
"OpenAI Chat Model3": {
"ai_languageModel": [
[
{
"node": "30ba5186-a271-4d6e-a219-6a0262ef20d7",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenAI Chat Model4": {
"ai_languageModel": [
[
{
"node": "bc45a7ff-b74f-4901-96f0-2a818358ffaf",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"7ef56380-f69f-4e48-8c42-bc5706fdcfe1": {
"main": [
[
{
"node": "a1b29f7c-efd0-46cc-989a-b72c01adb970",
"type": "main",
"index": 0
}
]
]
},
"bc45a7ff-b74f-4901-96f0-2a818358ffaf": {
"main": [
[
{
"node": "7ef56380-f69f-4e48-8c42-bc5706fdcfe1",
"type": "main",
"index": 0
}
]
]
},
"81a753e0-4198-4841-ac41-e9efb4b69ad9": {
"ai_outputParser": [
[
{
"node": "bc45a7ff-b74f-4901-96f0-2a818358ffaf",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "30ba5186-a271-4d6e-a219-6a0262ef20d7",
"type": "main",
"index": 0
}
]
]
},
"71c6b7dc-23fd-4a5f-a4f2-58cde14f2f9f": {
"main": [
[
{
"node": "bc45a7ff-b74f-4901-96f0-2a818358ffaf",
"type": "main",
"index": 0
}
]
]
}
}
}Comment utiliser ce workflow ?
Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.
Dans quelles scénarios ce workflow est-il adapté ?
Intermédiaire - Génération de leads, IA Multimodale
Est-ce payant ?
Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.
Workflows recommandés
Robert Breen
@rbreenProfessional services consultant with over 10 years of experience solving complex business problems across industries. I specialize in n8n and process automation—designing custom workflows that integrate tools like Google Calendar, Airtable, GPT, and internal systems. Whether you need to automate scheduling, sync data, or streamline operations, I build solutions that save time and drive results.
Partager ce workflow