This workflow follows the Agent → Memory Buffer Window 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": "d1b47f60-5a4d-4629-a18d-b3c6ec0c972c",
"name": "Knowledge Base Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1140,
340
],
"parameters": {
"text": "={{ $json.text }}",
"options": {
"systemMessage": "Eres un asistente de IA para la empresa CIEC. Tu trabajo es responder preguntas de los empleados. Cuando necesites informaci\u00f3n sobre \u00f3rdenes de compra, productos, solicitudes o cualquier otra cosa, debes usar la herramienta `consultar_base_de_datos` para ejecutar una consulta SQL. Formula una consulta SQL v\u00e1lida y precisa para obtener la informaci\u00f3n. Responde en espa\u00f1ol y s\u00e9 breve y directo."
},
"promptType": "define"
},
"typeVersion": 1.9
},
{
"id": "a79b9b58-0211-4570-af84-64db8bef9de3",
"name": "Simple Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
1240,
520
],
"parameters": {
"sessionKey": "=memory_{{ $('WhatsApp Trigger').item.json.contacts[0].wa_id }}",
"sessionIdType": "customKey"
},
"typeVersion": 1.3
},
{
"id": "ddc0fdb7-bacc-4f41-87bf-48bb714a404d",
"name": "WhatsApp Trigger",
"type": "n8n-nodes-base.whatsAppTrigger",
"position": [
560,
340
],
"parameters": {
"updates": [
"messages"
]
},
"credentials": {
"whatsAppTriggerApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "cf603f5c-0a6e-4cdd-846b-738ed417daa2",
"name": "Get Text from Message",
"type": "n8n-nodes-base.set",
"position": [
860,
340
],
"parameters": {
"assignments": {
"assignments": [
{
"id": "38aec976-a32c-4b0e-85f4-c90adc16abc9",
"name": "text",
"type": "string",
"value": "={{ $json.messages[0].text.body }}"
}
]
},
"options": {
"keepOnlySet": true
}
},
"typeVersion": 3.4
},
{
"id": "acc8e4ae-0610-42fc-a318-b9a23a38919b",
"name": "Send Response",
"type": "n8n-nodes-base.whatsApp",
"position": [
1440,
340
],
"parameters": {
"textBody": "={{ $json.output }}",
"operation": "send",
"recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}"
},
"credentials": {
"whatsAppApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "3e9b1f8c-c6c7-43c2-a9b0-951fd4d55d7f",
"name": "Google Gemini",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGenerativeAi",
"position": [
1140,
520
],
"parameters": {
"model": "gemini-pro",
"options": {}
},
"credentials": {
"googleApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "1d8b9e6a-3a7b-4d4e-8c4d-b08e5e1a2f9a",
"name": "Supabase Tool: Consultar DB",
"type": "n8n-nodes-base.supabase",
"position": [
1320,
520
],
"parameters": {
"resource": "database",
"operation": "executeQuery",
"query": "",
"options": {},
"toolName": "consultar_base_de_datos",
"toolDescription": "Usa esta herramienta para ejecutar consultas SQL en la base de datos de la empresa. Puedes usarla para responder preguntas sobre \u00f3rdenes de compra, solicitudes, inventario, productos y empleados. Formula una consulta SQL v\u00e1lida para obtener la informaci\u00f3n."
},
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
},
"typeVersion": 2.2
}
],
"connections": {
"Knowledge Base Agent": {
"main": [
[
{
"node": "Send Response",
"type": "main",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "Knowledge Base Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"WhatsApp Trigger": {
"main": [
[
{
"node": "Get Text from Message",
"type": "main",
"index": 0
}
]
]
},
"Get Text from Message": {
"main": [
[
{
"node": "Knowledge Base Agent",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini": {
"ai_languageModel": [
[
{
"node": "Knowledge Base Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Supabase Tool: Consultar DB": {
"ai_tool": [
[
{
"node": "Knowledge Base Agent",
"type": "ai_tool",
"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.
googleApisupabaseApiwhatsAppApiwhatsAppTriggerApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Si. Uses agent, memoryBufferWindow, whatsAppTrigger, whatsApp. Event-driven trigger; 7 nodes.
Source: https://github.com/Police65/proyecto-inventario-ciec/blob/da9bb83305180a2ca5104ebf9ab941487882b564/n8n/si.json — 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 workflow is intended for individual users or teams who want to automate their small business on WhatsApp practically by automatically replying about your business products or services using the g
LOW. Uses whatsAppTrigger, agent, memoryBufferWindow, toolWorkflow. Event-driven trigger; 12 nodes.
Levadur(ia). Uses whatsAppTrigger, agent, lmChatGoogleGemini, googleSheetsTool. Event-driven trigger; 11 nodes.
agent-ia-core. Uses agent, mcpClientTool, whatsAppTrigger, whatsApp. Event-driven trigger; 10 nodes.
Whatsapp Test. Uses whatsAppTrigger, agent, lmChatOpenAi, memoryBufferWindow. Event-driven trigger; 8 nodes.