This workflow corresponds to n8n.io template #11754 — we link there as the canonical source.
This workflow follows the Agent → Chainllm 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
},
"name": "WhatsApp Multimodal AI Assistant with Evolution API",
"tags": [],
"nodes": [
{
"id": "8c128002-cfbb-44a6-96f4-b2827f103bf9",
"name": "Main Overview",
"type": "n8n-nodes-base.stickyNote",
"position": [
-4880,
-1072
],
"parameters": {
"width": 460,
"height": 860,
"content": "## WhatsApp Multimodal AI Assistant\n\nA complete AI-powered WhatsApp assistant that handles text, audio, images, and documents. Features message queuing, conversation memory, and smart response formatting.\n\n### How it works\n1. Receives WhatsApp messages via Evolution API webhook\n2. Classifies message type (text, audio, image, document)\n3. Processes media with OpenAI (transcription/vision)\n4. Queues messages in Redis (waits for more messages)\n5. AI Agent generates response with conversation memory\n6. Formats long responses into multiple WhatsApp messages\n7. Sends replies with natural typing delays\n\n### Setup steps\n- [ ] Install Evolution API community node\n- [ ] Set up Evolution API + connect WhatsApp\n- [ ] Configure Redis instance\n- [ ] Configure PostgreSQL database\n- [ ] Add OpenAI API credentials\n- [ ] Set up webhook in Evolution API\n- [ ] Replace `YOUR_ALLOWED_NUMBER` placeholder\n\n### Customization\n- Modify AI Agent system prompt\n- Adjust message wait time (default: 10s)\n- Change response formatting rules\n- Add more message type handlers"
},
"typeVersion": 1
},
{
"id": "f7730fcf-9445-45e5-83c8-8012d947183e",
"name": "Warning - Setup",
"type": "n8n-nodes-base.stickyNote",
"position": [
-4400,
-1072
],
"parameters": {
"color": 2,
"width": 688,
"height": 552,
"content": "## \u26a0\ufe0f Requirements & Setup\n\n**Services needed:**\n- Evolution API (v2.2+)\n- Redis (for message queuing)\n- PostgreSQL (for chat memory)\n- OpenAI API key\n\n**Community Node:**\n```\nn8n-nodes-evolution-api\n```\n\n**Webhook Setup:**\n1. Copy the webhook URL from \"Receive WhatsApp\" node\n2. In Evolution API \u2192 Instance \u2192 Webhook\n3. Enable: `MESSAGES_UPSERT`\n\n**Credentials to configure:**\n1. Evolution API (server URL + API key)\n2. OpenAI API\n3. Redis connection\n4. PostgreSQL connection"
},
"typeVersion": 1
},
{
"id": "487bb63e-0e8a-40b2-ab53-10244bf15aa6",
"name": "Section 1 - Receive",
"type": "n8n-nodes-base.stickyNote",
"position": [
-4400,
-496
],
"parameters": {
"color": 6,
"width": 700,
"height": 280,
"content": "## 1. Receive & Parse Message"
},
"typeVersion": 1
},
{
"id": "d00d5097-8365-40b9-ac5d-4b76401dd904",
"name": "Section 2 - Mark Read",
"type": "n8n-nodes-base.stickyNote",
"position": [
-3680,
-496
],
"parameters": {
"color": 6,
"width": 220,
"height": 280,
"content": "## 2. Mark as Read"
},
"typeVersion": 1
},
{
"id": "d16d161b-587a-43a1-b0ea-e4d9e88cf968",
"name": "Section 3 - Router",
"type": "n8n-nodes-base.stickyNote",
"position": [
-3440,
-496
],
"parameters": {
"width": 280,
"height": 600,
"content": "## 3. Route by Message Type"
},
"typeVersion": 1
},
{
"id": "dcf4d4a0-13f4-48d5-8d93-85e2cb3a3d00",
"name": "Section 4 - Media Processing",
"type": "n8n-nodes-base.stickyNote",
"position": [
-3136,
-496
],
"parameters": {
"width": 900,
"height": 1112,
"content": "## 4. Process Media\n\nHandles audio transcription, image analysis, and document extraction"
},
"typeVersion": 1
},
{
"id": "40d9822b-c29a-4ea6-a87a-ecff5079d5c4",
"name": "Section 5 - Queue",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2224,
-496
],
"parameters": {
"color": 5,
"width": 700,
"height": 280,
"content": "## 5. Message Queue\n\nAccumulates messages and waits for more input"
},
"typeVersion": 1
},
{
"id": "65d937bb-f226-4e38-9333-98833328079f",
"name": "Section 6 - Check",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1504,
-496
],
"parameters": {
"width": 460,
"height": 552,
"content": "## 6. Check & Concatenate"
},
"typeVersion": 1
},
{
"id": "1c7c6e0b-3aba-4e6c-a95c-b571f7298182",
"name": "Section 7 - AI",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1024,
-496
],
"parameters": {
"color": 4,
"width": 460,
"height": 560,
"content": "## 7. AI Processing"
},
"typeVersion": 1
},
{
"id": "f4603ab4-f3b7-4225-bf69-51d56d1993d1",
"name": "Section 8 - Format",
"type": "n8n-nodes-base.stickyNote",
"position": [
-544,
-496
],
"parameters": {
"color": 5,
"width": 500,
"height": 560,
"content": "## 8. Format Response"
},
"typeVersion": 1
},
{
"id": "e3667040-5b2e-4e01-8806-f379f79ba02b",
"name": "Section 9 - Send",
"type": "n8n-nodes-base.stickyNote",
"position": [
-16,
-496
],
"parameters": {
"color": 5,
"width": 908,
"height": 560,
"content": "## 9. Send Messages"
},
"typeVersion": 1
},
{
"id": "90c5d404-116e-4e4e-ba58-f2a548830ea4",
"name": "Receive WhatsApp",
"type": "n8n-nodes-base.webhook",
"position": [
-4352,
-352
],
"parameters": {
"path": "whatsapp-multimodal",
"options": {},
"httpMethod": "POST"
},
"typeVersion": 2.1
},
{
"id": "b05c042f-1f78-4437-9135-e0a9fce6c28b",
"name": "Parse Message Data",
"type": "n8n-nodes-base.set",
"position": [
-4192,
-352
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "5eedc085-015a-4d90-8062-bb51eaa31a24",
"name": "event",
"type": "string",
"value": "={{ $json.body.event }}"
},
{
"id": "3d1a50e0-8d92-423a-9f68-70c7c76ac1a8",
"name": "instance",
"type": "string",
"value": "={{ $json.body.instance }}"
},
{
"id": "17f79a1a-b4b1-42bf-b7f7-4ee12f97bf8c",
"name": "remoteJid",
"type": "string",
"value": "={{ $json.body.data.key.remoteJid }}"
},
{
"id": "0a88668a-cb3b-4fd2-acc5-ec6c2845c748",
"name": "messageId",
"type": "string",
"value": "={{ $json.body.data.key.id }}"
},
{
"id": "ca85475e-ce06-4a85-85a3-01935200b5c0",
"name": "pushName",
"type": "string",
"value": "={{ $json.body.data.pushName }}"
},
{
"id": "989bd4f8-9691-477f-a4ad-13b061b211b4",
"name": "messageText",
"type": "string",
"value": "={{ $json.body.data.message.conversation }}"
},
{
"id": "d5579d0b-f240-495a-a51e-d17e60758401",
"name": "messageType",
"type": "string",
"value": "={{ $json.body.data.messageType }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "74b0321b-37b1-4e48-b256-4c4522ba2743",
"name": "Filter Allowed Numbers",
"type": "n8n-nodes-base.filter",
"position": [
-4016,
-352
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "or",
"conditions": [
{
"id": "14910c39-b162-4553-b4a6-b24ea1145f4d",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.remoteJid }}",
"rightValue": "user@example.com"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "c5178e1e-e8e8-4c7c-a3f6-837732e5b854",
"name": "Wait 2s",
"type": "n8n-nodes-base.wait",
"position": [
-3856,
-352
],
"parameters": {
"amount": 2
},
"typeVersion": 1.1
},
{
"id": "593f7126-07b5-4317-ada0-bb30278a179d",
"name": "Mark as Read",
"type": "n8n-nodes-evolution-api.evolutionApi",
"position": [
-3616,
-352
],
"parameters": {
"resource": "chat-api",
"messageId": "={{ $('Parse Message Data').item.json.messageId }}",
"operation": "read-messages",
"remoteJid": "={{ $('Filter Allowed Numbers').item.json.remoteJid }}",
"instanceName": "={{ $('Parse Message Data').item.json.instance }}"
},
"typeVersion": 1
},
{
"id": "e4c8adab-9fa3-4a8f-828c-9e1837f9d6c2",
"name": "Route by Message Type",
"type": "n8n-nodes-base.switch",
"position": [
-3376,
-304
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "text",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "0b20624f-eb7f-4494-ac0b-576a70b6e8c3",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Parse Message Data').item.json.messageType }}",
"rightValue": "conversation"
}
]
},
"renameOutput": true
},
{
"outputKey": "audio",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "da350a94-e91d-4c79-b48e-450880337eb6",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Parse Message Data').item.json.messageType }}",
"rightValue": "audioMessage"
}
]
},
"renameOutput": true
},
{
"outputKey": "image",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "da839d3b-d3e2-4035-ac8c-8829f71b5515",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Parse Message Data').item.json.messageType }}",
"rightValue": "imageMessage"
}
]
},
"renameOutput": true
},
{
"outputKey": "document",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "18a0efe1-0996-442a-8f6c-584ac433483e",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Parse Message Data').item.json.messageType }}",
"rightValue": "documentMessage"
}
]
},
"renameOutput": true
}
]
},
"options": {
"fallbackOutput": "extra",
"renameFallbackOutput": "unsupported"
}
},
"typeVersion": 3.3
},
{
"id": "2cd0b0b0-0fc5-4684-a11f-9e24998f0ed3",
"name": "Extract Text",
"type": "n8n-nodes-base.set",
"position": [
-3088,
-352
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "9955c458-ed6f-4ecf-acbc-fca42cf6c0e0",
"name": "input",
"type": "string",
"value": "={{ $('Parse Message Data').item.json.messageText }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "04fc4b12-a063-441a-98af-a0da75876265",
"name": "Extract Audio Base64",
"type": "n8n-nodes-base.set",
"position": [
-3088,
-192
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "c10a7a40-6a77-4ea6-b3a6-09994174185e",
"name": "data",
"type": "string",
"value": "={{ $('Receive WhatsApp').item.json.body.data.message.base64 }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "b79ea581-3f2e-4b71-bc96-5e7a096ee5ba",
"name": "Convert to Audio",
"type": "n8n-nodes-base.convertToFile",
"position": [
-2880,
-192
],
"parameters": {
"options": {
"mimeType": "audio/wav"
},
"operation": "toBinary",
"sourceProperty": "data"
},
"typeVersion": 1.1
},
{
"id": "df09d6a8-e72b-4722-96d6-94f45da84065",
"name": "Transcribe Audio",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
-2688,
-192
],
"parameters": {
"options": {},
"resource": "audio",
"operation": "transcribe"
},
"typeVersion": 2
},
{
"id": "1c20d663-5ec9-4489-a0e4-fe64e1187efb",
"name": "Format Audio Input",
"type": "n8n-nodes-base.set",
"position": [
-2400,
-192
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "37faec8b-0774-48f6-9c3c-e7b2de2d967e",
"name": "input",
"type": "string",
"value": "=<audio>\n{{ $json.text }}\n</audio>"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "44622f9a-69ba-4ce3-845f-8d0017aebd1b",
"name": "Extract Image Base64",
"type": "n8n-nodes-base.set",
"position": [
-3088,
-32
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "c10a7a40-6a77-4ea6-b3a6-09994174185e",
"name": "data",
"type": "string",
"value": "={{ $('Receive WhatsApp').item.json.body.data.message.base64 }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "7c5b84ee-d208-470c-96d4-1fd7cea7c464",
"name": "Convert to Image",
"type": "n8n-nodes-base.convertToFile",
"position": [
-2880,
-32
],
"parameters": {
"options": {
"mimeType": "image/png"
},
"operation": "toBinary",
"sourceProperty": "data"
},
"typeVersion": 1.1
},
{
"id": "e777504c-5309-4f6f-bde4-0b6213a5f670",
"name": "Analyze Image",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
-2688,
-32
],
"parameters": {
"text": "Describe this image received via WhatsApp. Be as detailed as possible and transcribe any visible text.",
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4o",
"cachedResultName": "GPT-4O"
},
"options": {
"detail": "auto"
},
"resource": "image",
"inputType": "base64",
"operation": "analyze"
},
"typeVersion": 2
},
{
"id": "02044d71-cd50-465e-bee7-4818aecdf0c0",
"name": "Format Image Input",
"type": "n8n-nodes-base.set",
"position": [
-2400,
-32
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "37faec8b-0774-48f6-9c3c-e7b2de2d967e",
"name": "input",
"type": "string",
"value": "=<image>\n{{ $json['0'].content[0].text }}\n</image>"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "b8600bc0-0b1d-4841-b6df-739ed8491ffa",
"name": "Extract Document Base64",
"type": "n8n-nodes-base.set",
"position": [
-3088,
144
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "c10a7a40-6a77-4ea6-b3a6-09994174185e",
"name": "data",
"type": "string",
"value": "={{ $('Receive WhatsApp').item.json.body.data.message.base64 }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "521a8ade-92cc-4bab-bda1-600b03c03bb8",
"name": "Convert to Document",
"type": "n8n-nodes-base.convertToFile",
"position": [
-2880,
144
],
"parameters": {
"options": {
"fileName": "={{ $('Receive WhatsApp').item.json.body.data.message.documentMessage.fileName }}",
"mimeType": "={{ $('Receive WhatsApp').item.json.body.data.message.documentMessage.mimetype }}"
},
"operation": "toBinary",
"sourceProperty": "data"
},
"typeVersion": 1.1
},
{
"id": "fc1371f6-8145-442a-adc7-e5d5d83f8edb",
"name": "Transcribe Document",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
-2688,
144
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4o",
"cachedResultName": "GPT-4O"
},
"options": {},
"responses": {
"values": [
{
"role": "system",
"content": "Describe this document received via WhatsApp. Be as detailed as possible and transcribe any visible text."
},
{
"type": "file",
"fileName": "={{ $('Receive WhatsApp').item.json.body.data.message.documentMessage.fileName }}",
"fileType": "base64"
}
]
},
"builtInTools": {}
},
"typeVersion": 2
},
{
"id": "399ce9c1-75e5-4c8b-88a5-0d1199591c6c",
"name": "Format Document Input",
"type": "n8n-nodes-base.set",
"position": [
-2400,
144
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "37faec8b-0774-48f6-9c3c-e7b2de2d967e",
"name": "input",
"type": "string",
"value": "=<document>\n{{ $json.output[0].content[0].text }}\n</document>"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "11f24afb-0c38-42fc-ad90-fd867bc091e3",
"name": "Send Unsupported Message",
"type": "n8n-nodes-evolution-api.evolutionApi",
"position": [
-3088,
304
],
"parameters": {
"resource": "messages-api",
"remoteJid": "={{ $('Parse Message Data').item.json.remoteJid }}",
"messageText": "Sorry, I cannot process this type of message yet.",
"instanceName": "={{ $('Parse Message Data').item.json.instance }}",
"options_message": {}
},
"typeVersion": 1
},
{
"id": "9e05c41a-606a-4b1a-afe9-2dcf0a9d359d",
"name": "End Unsupported",
"type": "n8n-nodes-base.noOp",
"position": [
-2880,
304
],
"parameters": {},
"typeVersion": 1
},
{
"id": "a6648daa-9245-435f-a2be-9783552fdc7a",
"name": "Unify Input",
"type": "n8n-nodes-base.set",
"position": [
-2176,
-352
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "883d64de-2247-4517-8441-7cadb0144094",
"name": "input",
"type": "string",
"value": "={{ $json.input }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "8b0a5ff5-951e-40e0-9c2f-b44e77787923",
"name": "Queue Message",
"type": "n8n-nodes-base.redis",
"position": [
-2000,
-352
],
"parameters": {
"list": "={{ $('Parse Message Data').item.json.remoteJid }}",
"tail": true,
"operation": "push",
"messageData": "={{ $json.input }}"
},
"typeVersion": 1
},
{
"id": "75b189d0-e531-4f45-a8bd-58d024fe6934",
"name": "Wait for More Messages",
"type": "n8n-nodes-base.wait",
"position": [
-1824,
-352
],
"parameters": {
"amount": 10
},
"typeVersion": 1.1
},
{
"id": "c6c22a3c-1924-42ce-b447-b2a2615b0c7f",
"name": "Get Queued Messages",
"type": "n8n-nodes-base.redis",
"position": [
-1664,
-352
],
"parameters": {
"key": "={{ $('Parse Message Data').item.json.remoteJid }}",
"options": {},
"operation": "get"
},
"typeVersion": 1
},
{
"id": "c375b291-1de4-4a56-8139-e90769ccd4d6",
"name": "Is Last Message?",
"type": "n8n-nodes-base.if",
"position": [
-1440,
-352
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "682da6df-4a15-4231-b2b0-a3088b7201f0",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.propertyName.last() }}",
"rightValue": "={{ $('Unify Input').item.json.input }}"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "cc188604-fcb1-4d7d-ac9c-cf12f8ca65e0",
"name": "Not Last - Stop",
"type": "n8n-nodes-base.noOp",
"position": [
-1184,
-192
],
"parameters": {},
"typeVersion": 1
},
{
"id": "8e22f71f-c289-4787-8378-d81850147c4c",
"name": "Concatenate Messages",
"type": "n8n-nodes-base.set",
"position": [
-1184,
-448
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "efcf87b7-6819-4aff-b48d-ca4edd2a0a5a",
"name": "finalInput",
"type": "string",
"value": "={{ $json.propertyName.join('\\n') }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "450a7823-41a1-44fd-839f-7185324792a9",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-944,
-352
],
"parameters": {
"text": "=User message: {{ $json.finalInput }}\n\nCurrent date: {{ $now }}",
"options": {
"systemMessage": "You are a friendly and helpful virtual assistant. Your goal is to help users solve their questions clearly and concisely. Do not make up information. If you don't know something, admit it."
},
"promptType": "define"
},
"typeVersion": 3
},
{
"id": "82871e49-471b-4bed-9298-31b67bb31202",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-944,
-176
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"typeVersion": 1.2
},
{
"id": "7e18427d-3394-429d-8ae8-a749c4fe7ac4",
"name": "Postgres Chat Memory",
"type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
"position": [
-752,
-176
],
"parameters": {
"tableName": "whatsapp_chat_memory",
"sessionKey": "={{ $('Parse Message Data').item.json.remoteJid }}",
"sessionIdType": "customKey",
"contextWindowLength": 20
},
"typeVersion": 1.3
},
{
"id": "62f37882-ebd0-4456-a57b-293682206ce3",
"name": "Format Response",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
-464,
-352
],
"parameters": {
"text": "=Process the following message:\n\n {{ $json.output }}",
"batching": {},
"messages": {
"messageValues": [
{
"message": "# Instructions for Formatting Messages for WhatsApp\n\nAct as an expert in digital communication specialized in WhatsApp Business. Your task is to take any long message and reorganize it into multiple messages optimized for WhatsApp, keeping ALL the original information.\n\n## Formatting rules:\n\n### General structure:\n1. Message 1: Introduction + basic data (keep original greeting/context)\n2. Message 2: Main features\n3. Message 3: Services and policies\n\n### Format of each message:\n- Maximum 3-4 lines per message\n- Use relevant emojis to make it more visual\n- Keep the original tone of the message\n- Do NOT lose any data: addresses, capacities, schedules, etc.\n\n## Output format:\nAlways return a JSON with this exact structure:\n\n```json\n{\n \"respuesta\": [\n \"First message text\",\n \"Second message text\",\n \"Final message text\"\n ]\n}\n```\n\n### Rules for JSON:\n- Each array element is an individual message\n- Keep logical order: intro -> features -> services -> call to action\n- Do NOT add explanatory text outside the JSON\n- Do NOT number the messages in the JSON"
}
]
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.7
},
{
"id": "848a5d8b-7363-490b-8c63-3e718f7b93ff",
"name": "OpenAI Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-464,
-176
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"typeVersion": 1.2
},
{
"id": "dfeabfbc-b6eb-4f86-9bf6-6cbc34cbef3c",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
-288,
-176
],
"parameters": {
"autoFix": true,
"jsonSchemaExample": "{\n \"respuesta\": []\n}"
},
"typeVersion": 1.3
},
{
"id": "0550224a-5e8b-4c8e-9966-12d3b294fd6f",
"name": "Split Messages",
"type": "n8n-nodes-base.splitOut",
"position": [
-224,
-352
],
"parameters": {
"options": {},
"fieldToSplitOut": "output.respuesta"
},
"typeVersion": 1
},
{
"id": "228e36f0-1373-4615-908b-b4b8c12eb2b2",
"name": "Loop Messages",
"type": "n8n-nodes-base.splitInBatches",
"position": [
64,
-352
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "e1199ffd-65f0-4fad-bd74-bb7544514d97",
"name": "Is Image URL?",
"type": "n8n-nodes-base.if",
"position": [
272,
-192
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "or",
"conditions": [
{
"id": "494e1ce8-176e-4abd-8fd6-d0c5b26e78a4",
"operator": {
"type": "string",
"operation": "endsWith"
},
"leftValue": "={{ $json['output.respuesta'] }}",
"rightValue": ".png"
},
{
"id": "510a248f-d20b-4ed9-8592-38ccf89be197",
"operator": {
"type": "string",
"operation": "endsWith"
},
"leftValue": "={{ $json['output.respuesta'] }}",
"rightValue": ".jpg"
},
{
"id": "79ddf663-4e64-459f-9b62-85ff7846f2a4",
"operator": {
"type": "string",
"operation": "endsWith"
},
"leftValue": "={{ $json['output.respuesta'] }}",
"rightValue": ".jpeg"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "4f222082-c648-490c-8df2-6f969419edb4",
"name": "Send Image",
"type": "n8n-nodes-evolution-api.evolutionApi",
"position": [
464,
-288
],
"parameters": {
"media": "={{ $('Loop Messages').item.json['output.respuesta'] }}",
"resource": "messages-api",
"operation": "send-image",
"remoteJid": "={{ $('Parse Message Data').item.json.remoteJid }}",
"instanceName": "={{ $('Parse Message Data').item.json.instance }}",
"options_message": {}
},
"typeVersion": 1
},
{
"id": "dfa966e0-b33a-4ab9-89f3-e9b16c05ab60",
"name": "Send Text",
"type": "n8n-nodes-evolution-api.evolutionApi",
"position": [
464,
-112
],
"parameters": {
"resource": "messages-api",
"remoteJid": "={{ $('Parse Message Data').item.json.remoteJid }}",
"messageText": "={{ $json['output.respuesta'] }}",
"instanceName": "={{ $('Parse Message Data').item.json.instance }}",
"options_message": {
"delay": "={{ $json['output.respuesta'].length * 60 }}"
}
},
"typeVersion": 1
},
{
"id": "ff54c3a9-ce17-445c-8d1b-561c3306c2fb",
"name": "Wait Between Messages",
"type": "n8n-nodes-base.wait",
"position": [
656,
-192
],
"parameters": {
"amount": 2
},
"typeVersion": 1.1
},
{
"id": "0cc1d0b7-bd52-4544-929a-113bf274764e",
"name": "Aggregate",
"type": "n8n-nodes-base.aggregate",
"position": [
272,
-448
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{}
]
}
},
"typeVersion": 1
},
{
"id": "9b39dd58-0cb7-4f58-9015-6186eaf0fdd9",
"name": "Clear Queue",
"type": "n8n-nodes-base.redis",
"position": [
464,
-448
],
"parameters": {
"key": "={{ $('Parse Message Data').item.json.remoteJid }}",
"operation": "delete"
},
"typeVersion": 1
},
{
"id": "50d0f0ab-f48f-4f66-9c3e-b48eddc97119",
"name": "Done",
"type": "n8n-nodes-base.noOp",
"position": [
656,
-448
],
"parameters": {},
"typeVersion": 1
}
],
"settings": {
"executionOrder": "v1"
},
"connections": {
"Wait 2s": {
"main": [
[
{
"node": "Mark as Read",
"type": "main",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Format Response",
"type": "main",
"index": 0
}
]
]
},
"Aggregate": {
"main": [
[
{
"node": "Clear Queue",
"type": "main",
"index": 0
}
]
]
},
"Send Text": {
"main": [
[
{
"node": "Wait Between Messages",
"type": "main",
"index": 0
}
]
]
},
"Send Image": {
"main": [
[
{
"node": "Wait Between Messages",
"type": "main",
"index": 0
}
]
]
},
"Clear Queue": {
"main": [
[
{
"node": "Done",
"type": "main",
"index": 0
}
]
]
},
"Unify Input": {
"main": [
[
{
"node": "Queue Message",
"type": "main",
"index": 0
}
]
]
},
"Extract Text": {
"main": [
[
{
"node": "Unify Input",
"type": "main",
"index": 0
}
]
]
},
"Mark as Read": {
"main": [
[
{
"node": "Route by Message Type",
"type": "main",
"index": 0
}
]
]
},
"Analyze Image": {
"main": [
[
{
"node": "Format Image Input",
"type": "main",
"index": 0
}
]
]
},
"Is Image URL?": {
"main": [
[
{
"node": "Send Image",
"type": "main",
"index": 0
}
],
[
{
"node": "Send Text",
"type": "main",
"index": 0
}
]
]
},
"Loop Messages": {
"main": [
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
],
[
{
"node": "Is Image URL?",
"type": "main",
"index": 0
}
]
]
},
"Queue Message": {
"main": [
[
{
"node": "Wait for More Messages",
"type": "main",
"index": 0
}
]
]
},
"Split Messages": {
"main": [
[
{
"node": "Loop Messages",
"type": "main",
"index": 0
}
]
]
},
"Format Response": {
"main": [
[
{
"node": "Split Messages",
"type": "main",
"index": 0
}
]
]
},
"Convert to Audio": {
"main": [
[
{
"node": "Transcribe Audio",
"type": "main",
"index": 0
}
]
]
},
"Convert to Image": {
"main": [
[
{
"node": "Analyze Image",
"type": "main",
"index": 0
}
]
]
},
"Is Last Message?": {
"main": [
[
{
"node": "Concatenate Messages",
"type": "main",
"index": 0
}
],
[
{
"node": "Not Last - Stop",
"type": "main",
"index": 0
}
]
]
},
"Receive WhatsApp": {
"main": [
[
{
"node": "Parse Message Data",
"type": "main",
"index": 0
}
]
]
},
"Transcribe Audio": {
"main": [
[
{
"node": "Format Audio Input",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Format Audio Input": {
"main": [
[
{
"node": "Unify Input",
"type": "main",
"index": 0
}
]
]
},
"Format Image Input": {
"main": [
[
{
"node": "Unify Input",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "Format Response",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Parse Message Data": {
"main": [
[
{
"node": "Filter Allowed Numbers",
"type": "main",
"index": 0
}
]
]
},
"Convert to Document": {
"main": [
[
{
"node": "Transcribe Document",
"type": "main",
"index": 0
}
]
]
},
"Get Queued Messages": {
"main": [
[
{
"node": "Is Last Message?",
"type": "main",
"index": 0
}
]
]
},
"Transcribe Document": {
"main": [
[
{
"node": "Format Document Input",
"type": "main",
"index": 0
}
]
]
},
"Concatenate Messages": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Extract Audio Base64": {
"main": [
[
{
"node": "Convert to Audio",
"type": "main",
"index": 0
}
]
]
},
"Extract Image Base64": {
"main": [
[
{
"node": "Convert to Image",
"type": "main",
"index": 0
}
]
]
},
"Postgres Chat Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Format Document Input": {
"main": [
[
{
"node": "Unify Input",
"type": "main",
"index": 0
}
]
]
},
"Route by Message Type": {
"main": [
[
{
"node": "Extract Text",
"type": "main",
"index": 0
}
],
[
{
"node": "Extract Audio Base64",
"type": "main",
"index": 0
}
],
[
{
"node": "Extract Image Base64",
"type": "main",
"index": 0
}
],
[
{
"node": "Extract Document Base64",
"type": "main",
"index": 0
}
],
[
{
"node": "Send Unsupported Message",
"type": "main",
"index": 0
}
]
]
},
"Wait Between Messages": {
"main": [
[
{
"node": "Loop Messages",
"type": "main",
"index": 0
}
]
]
},
"Filter Allowed Numbers": {
"main": [
[
{
"node": "Wait 2s",
"type": "main",
"index": 0
}
]
]
},
"Wait for More Messages": {
"main": [
[
{
"node": "Get Queued Messages",
"type": "main",
"index": 0
}
]
]
},
"Extract Document Base64": {
"main": [
[
{
"node": "Convert to Document",
"type": "main",
"index": 0
}
]
]
},
"Send Unsupported Message": {
"main": [
[
{
"node": "End Unsupported",
"type": "main",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "Format Response",
"type": "ai_outputParser",
"index": 0
}
]
]
}
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Build an intelligent WhatsApp assistant that automatically responds to customer messages using AI. This template uses the Evolution API community node for WhatsApp integration and OpenAI for natural language processing, with built-in conversation memory powered by Redis to…
Source: https://n8n.io/workflows/11754/ — 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.
secretaria. Uses postgres, n8n-nodes-evolution-api, openAi, httpRequest. Webhook trigger; 71 nodes.
Agent: IPTV (instance_e2165d22_1762376395079). Uses openAi, redis, supabase, httpRequest. Webhook trigger; 56 nodes.
Transform your WhatsApp group conversations into actionable business intelligence through automated AI analysis and daily reporting. This workflow eliminates manual conversation monitoring by capturin
'Elena AI' is a powerful n8n workflow that transforms your automation platform into a full-fledged, multi-agent AI hub. 🤖✨ By combining Redis state management with specialized “tool” sub-workflows, yo
This workflow transforms natural language queries into research reports through a five-stage AI pipeline. When triggered via webhook (typically from Google Sheets using the companion [](https://gist.g