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 →
{
"active": false,
"connections": {
"Lead Existe?": {
"main": [
[],
[]
]
},
"Webhook": {
"main": [
[
{
"node": "Preparar Dados",
"type": "main",
"index": 0
}
]
]
},
"Preparar Dados": {
"main": [
[
{
"node": "Code1",
"type": "main",
"index": 0
}
]
]
},
"Verificar Lead": {
"main": [
[
{
"node": "Lead Existe?",
"type": "main",
"index": 0
}
]
]
},
"Redis": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"Wait": {
"main": [
[
{
"node": "Redis1",
"type": "main",
"index": 0
}
]
]
},
"Redis1": {
"main": [
[
{
"node": "If2",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields1": {
"main": [
[]
]
},
"Convert to File": {
"main": [
[
{
"node": "OpenAI",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "Convert to File",
"type": "main",
"index": 0
}
]
]
},
"Convert to File1": {
"main": [
[
{
"node": "OpenAI1",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields3": {
"main": [
[
{
"node": "Convert to File1",
"type": "main",
"index": 0
}
]
]
},
"If3": {
"main": [
[
{
"node": "Redis5",
"type": "main",
"index": 0
}
],
[
{
"node": "Redis4",
"type": "main",
"index": 0
}
]
]
},
"Redis3": {
"main": [
[
{
"node": "Redis",
"type": "main",
"index": 0
}
]
]
},
"Redis4": {
"main": [
[
{
"node": "Redis",
"type": "main",
"index": 0
}
]
]
},
"Redis5": {
"main": [
[
{
"node": "Redis",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields4": {
"main": [
[
{
"node": "Redis",
"type": "main",
"index": 0
}
]
]
},
"OpenAI": {
"main": [
[
{
"node": "Redis3",
"type": "main",
"index": 0
}
]
]
},
"OpenAI1": {
"main": [
[
{
"node": "If3",
"type": "main",
"index": 0
}
]
]
},
"Switch1": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
],
[
{
"node": "Edit Fields4",
"type": "main",
"index": 0
}
],
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
],
[
{
"node": "Edit Fields3",
"type": "main",
"index": 0
}
],
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
],
[
{
"node": "Edit Fields3",
"type": "main",
"index": 0
}
]
]
},
"If2": {
"main": [
[
{
"node": "Pegar \u00daltima Hash",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
},
"Criar Lead": {
"main": [
[]
]
},
"Salvar Hist\u00f3rico": {
"main": [
[
{
"node": "If4",
"type": "main",
"index": 0
}
]
]
},
"Atualizar Lead": {
"main": [
[]
]
},
"Code1": {
"main": [
[
{
"node": "Set Normalizar Telefone",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields2": {
"main": [
[
{
"node": "Evolution API",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields5": {
"main": [
[
{
"node": "Redis",
"type": "main",
"index": 0
}
]
]
},
"If": {
"main": [
[
{
"node": "Edit Fields5",
"type": "main",
"index": 0
}
],
[
{
"node": "Edit Fields5",
"type": "main",
"index": 0
}
]
]
},
"detelar_eventos": {
"ai_tool": [
[
{
"node": "Atendente",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Atendente",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"buscar_eventos": {
"ai_tool": [
[
{
"node": "Atendente",
"type": "ai_tool",
"index": 0
}
]
]
},
"criar_eventos": {
"ai_tool": [
[
{
"node": "Atendente",
"type": "ai_tool",
"index": 0
}
]
]
},
"enviar_email": {
"ai_tool": [
[
{
"node": "Atendente",
"type": "ai_tool",
"index": 0
}
]
]
},
"Atendente": {
"main": [
[
{
"node": "Switch3",
"type": "main",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "Atendente",
"type": "ai_memory",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "busca_documentos",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Supabase Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Supabase Vector Store": {
"ai_vectorStore": [
[
{
"node": "busca_documentos",
"type": "ai_vectorStore",
"index": 0
}
]
]
},
"busca_documentos": {
"ai_tool": [
[
{
"node": "Atendente",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenAI3": {
"ai_languageModel": [
[
{
"node": "Parser Chain",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Segmentos1": {
"main": [
[
{
"node": "Loop Over Items3",
"type": "main",
"index": 0
}
]
]
},
"1,2s1": {
"main": [
[
{
"node": "no.op",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items3": {
"main": [
[],
[
{
"node": "Replace Me",
"type": "main",
"index": 0
}
]
]
},
"no.op": {
"main": [
[
{
"node": "Loop Over Items3",
"type": "main",
"index": 0
}
]
]
},
"OutputParser1": {
"ai_outputParser": [
[
{
"node": "Parser Chain",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Parser Chain": {
"main": [
[
{
"node": "Segmentos1",
"type": "main",
"index": 0
}
]
]
},
"ElevenLabsGenerateVoice": {
"main": [
[
{
"node": "Audio-Base64-Extract from File",
"type": "main",
"index": 0
}
]
]
},
"Code": {
"main": [
[
{
"node": "ElevenLabsGenerateVoice",
"type": "main",
"index": 0
}
]
]
},
"Switch3": {
"main": [
[
{
"node": "Parser Chain",
"type": "main",
"index": 0
}
],
[
{
"node": "Parser Chain",
"type": "main",
"index": 0
}
],
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Redis2": {
"main": [
[]
]
},
"Replace Me": {
"main": [
[
{
"node": "Edit Fields2",
"type": "main",
"index": 0
}
]
]
},
"Enviar WhatsApp1": {
"main": [
[]
]
},
"Evolution API2": {
"main": [
[]
]
},
"Evolution API": {
"main": [
[
{
"node": "1,2s1",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields6": {
"main": [
[
{
"node": "If1",
"type": "main",
"index": 0
}
]
]
},
"Audio-Base64-Extract from File": {
"main": [
[
{
"node": "Enviar WhatsApp",
"type": "main",
"index": 0
}
]
]
},
"If1": {
"main": [
[
{
"node": "Atendente",
"type": "main",
"index": 0
}
],
[
{
"node": "Atendente",
"type": "main",
"index": 0
}
]
]
},
"Think": {
"ai_tool": [
[
{
"node": "Atendente",
"type": "ai_tool",
"index": 0
}
]
]
},
"If4": {
"main": [
[
{
"node": "Switch1",
"type": "main",
"index": 0
}
],
[]
]
},
"Edit Fields8": {
"main": [
[
{
"node": "Salvar Hist\u00f3rico",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields9": {
"main": [
[
{
"node": "Verificar Lead",
"type": "main",
"index": 0
}
]
]
},
"Set Normalizar Telefone": {
"main": [
[
{
"node": "Edit Fields10",
"type": "main",
"index": 0
}
]
]
},
"Verificar Lead1": {
"main": [
[
{
"node": "Lead Existe?1",
"type": "main",
"index": 0
}
]
]
},
"Lead Existe?1": {
"main": [
[
{
"node": "Edit Fields8",
"type": "main",
"index": 0
},
{
"node": "Atualizar Lead1",
"type": "main",
"index": 0
}
],
[
{
"node": "Criar Lead1",
"type": "main",
"index": 0
},
{
"node": "Edit Fields8",
"type": "main",
"index": 0
}
]
]
},
"Atualizar Lead1": {
"main": [
[
{
"node": "If4",
"type": "main",
"index": 0
}
]
]
},
"Criar Lead1": {
"main": [
[
{
"node": "If4",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields10": {
"main": [
[
{
"node": "Verificar Lead1",
"type": "main",
"index": 0
}
]
]
},
"Salvar \u00daltima Msg": {
"main": [
[]
]
},
"Limpar Hist\u00f3rico Redis": {
"main": [
[]
]
},
"Pegar \u00daltima Hash": {
"main": [
[
{
"node": "\u00c9 Mensagem Nova?",
"type": "main",
"index": 0
}
]
]
},
"\u00c9 Mensagem Nova?": {
"main": [
[
{
"node": "Salvar \u00daltima Hash",
"type": "main",
"index": 0
}
]
]
},
"Salvar \u00daltima Hash": {
"main": [
[
{
"node": "Edit Fields6",
"type": "main",
"index": 0
}
]
]
}
},
"createdAt": "2025-05-16T04:08:22.324Z",
"id": "G2Z9oQ4FyLpu7e92",
"isArchived": false,
"meta": {
"templateCredsSetupCompleted": true
},
"name": "My workflow 14",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "responder-conversa",
"options": {}
},
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
-1340,
180
],
"id": "116e1716-b3d8-4974-abb3-1ff0c589388b"
},
{
"parameters": {
"values": {
"string": [
{
"name": "phone",
"value": "={{ $json.body?.data?.key?.remoteJid?.replace('@s.whatsapp.net', '').replace(/\\D/g, '') }}"
},
{
"name": "session_id",
"value": "={{ $json.body?.data?.key?.id || $execution.id }}"
},
{
"name": "email",
"value": "={{ $json.body?.email || '' }}"
},
{
"name": "message",
"value": "={{ $json.body?.data?.message?.conversation || '' }}"
},
{
"name": "messageType",
"value": "={{ Object.keys($json.body?.data?.message || {})[0] || 'desconhecido' }}"
},
{
"name": "created_at",
"value": "={{ $now }}"
}
]
},
"options": {}
},
"name": "Preparar Dados",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
-1180,
180
],
"id": "780de6bb-26b3-486e-b503-6bebfe671ad9"
},
{
"parameters": {
"operation": "getAll",
"tableId": "leads",
"filters": {
"conditions": [
{
"keyName": "phone",
"condition": "eq",
"keyValue": "={{ $json.telefone_normalizado }}"
}
]
}
},
"name": "Verificar Lead",
"type": "n8n-nodes-base.supabase",
"typeVersion": 1,
"position": [
-1020,
820
],
"id": "5f6b05db-1033-43ce-b6d4-1effda4c67c1",
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"conditions": {
"number": [
{
"value1": "={{ $items(\"Verificar Lead\").length }}"
}
]
}
},
"name": "Lead Existe?",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
-800,
840
],
"id": "fcc53af4-ba86-4bce-a309-cea62ad854b1"
},
{
"parameters": {
"tableId": "leads"
},
"name": "Criar Lead",
"type": "n8n-nodes-base.supabase",
"typeVersion": 1,
"position": [
-220,
760
],
"id": "58a559c4-012c-4c48-a1b8-6870ea0ca5cd",
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "update",
"tableId": "leads"
},
"name": "Atualizar Lead",
"type": "n8n-nodes-base.supabase",
"typeVersion": 1,
"position": [
40,
760
],
"id": "c57436cb-29b0-4d44-9e45-3544e33316a4",
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"tableId": "historico_mensagens"
},
"name": "Salvar Hist\u00f3rico",
"type": "n8n-nodes-base.supabase",
"typeVersion": 1,
"position": [
-260,
140
],
"id": "a23c7051-55b6-4a2f-98f8-45866ebe4abe",
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "push",
"list": "={{ $('Edit Fields10').item.json.redisKey }}",
"messageData": "={{ $('Edit Fields10').item.json.redisValue }}",
"tail": true
},
"id": "a000e8ee-354d-4ab0-9154-9668777e6b71",
"name": "Redis",
"type": "n8n-nodes-base.redis",
"typeVersion": 1,
"position": [
1620,
80
],
"credentials": {
"redis": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"amount": 10
},
"id": "22666f1e-533d-450b-9b6d-82b8cfb76a1d",
"name": "Wait",
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
1780,
80
],
"disabled": true
},
{
"parameters": {
"operation": "get",
"key": "={{ $('Code1').item.json.number }}",
"options": {}
},
"id": "dd67891a-edaa-4480-84a2-ef50db798a9d",
"name": "Redis1",
"type": "n8n-nodes-base.redis",
"typeVersion": 1,
"position": [
1920,
80
],
"credentials": {
"redis": {
"name": "<your credential>"
}
}
},
{
"parameters": {},
"id": "358c3f1b-dc3e-4a1c-816b-668bc40a33fb",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
2240,
160
]
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "37f63b88-4a52-4421-aa95-db9114e521bc",
"name": "listaMensagens",
"value": "={{ $json.propertyName.join(', ') }}",
"type": "string"
},
{
"id": "76c6b7b9-4829-413d-b470-ab7b16e48b25",
"name": "sessionId",
"value": "={{ $('Lead Existe?1').item.json.session_id }}",
"type": "string"
}
]
},
"options": {}
},
"id": "3c0a5a24-a239-4f6c-9149-aa140bc8eefa",
"name": "Edit Fields1",
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
2020,
-420
]
},
{
"parameters": {
"operation": "delete",
"key": "={{ $('Code1').item.json.number }}"
},
"id": "b0a87312-8648-4b4d-b2b2-ca1d1942a4d8",
"name": "Redis2",
"type": "n8n-nodes-base.redis",
"typeVersion": 1,
"position": [
1320,
-440
],
"credentials": {
"redis": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "toBinary",
"sourceProperty": "data",
"options": {
"fileName": "file.ogg",
"mimeType": "application/ogg"
}
},
"id": "7fc26ce9-01e5-4588-9795-2b0b10488149",
"name": "Convert to File",
"type": "n8n-nodes-base.convertToFile",
"typeVersion": 1.1,
"position": [
460,
100
]
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "3c5ccbc9-69d1-4b13-a7c3-e6945bc8c655",
"name": "data",
"value": "={{ $('Webhook').item.json.body.data.message.base64 }}",
"type": "string"
}
]
},
"options": {}
},
"id": "9ce04e29-158c-4aa0-b4c6-f4d02b562d38",
"name": "Edit Fields",
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
340,
240
]
},
{
"parameters": {
"operation": "toBinary",
"sourceProperty": "data",
"options": {
"fileName": "file.png",
"mimeType": "image/png"
}
},
"id": "a0e8d138-8b57-4933-80d9-7754b9572b8e",
"name": "Convert to File1",
"type": "n8n-nodes-base.convertToFile",
"typeVersion": 1.1,
"position": [
940,
260
]
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "3c5ccbc9-69d1-4b13-a7c3-e6945bc8c655",
"name": "data",
"value": "={{ $('Webhook').item.json.body.data.message.base64 }}",
"type": "string"
}
]
},
"options": {}
},
"id": "25e8056c-2252-49cd-826c-8f5ad151f52a",
"name": "Edit Fields3",
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
340,
400
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 1
},
"conditions": [
{
"id": "ade56c50-1520-4760-8df5-e99617d6d3ad",
"leftValue": "={{ $('Webhook').item.json[\"body\"][\"data\"][\"message\"][\"imageMessage\"][\"caption\"] }}",
"rightValue": "",
"operator": {
"type": "string",
"operation": "empty",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"id": "a2217550-8de4-4c4b-aad5-c6f804a1e219",
"name": "If3",
"type": "n8n-nodes-base.if",
"typeVersion": 2,
"position": [
1240,
260
]
},
{
"parameters": {
"operation": "push",
"list": "={{ $('Code1').item.json.number }}",
"messageData": "={{ $('Code1').item.json.message }}",
"tail": true
},
"id": "8a942a84-0cdc-4408-8ef4-c2cd7e950dc7",
"name": "Redis3",
"type": "n8n-nodes-base.redis",
"typeVersion": 1,
"position": [
1440,
-60
],
"credentials": {
"redis": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "push",
"list": "={{ $('Code1').item.json.number }}",
"messageData": "={{ $('Webhook').item.json[\"body\"][\"data\"][\"message\"][\"imageMessage\"][\"caption\"] }}, {{ $json.content.replace(/\\n/g, \"\\\\n\").replace(/['\"]/g, '').trim() }}",
"tail": true
},
"id": "c0983a7b-f502-419a-8e2c-13d06dacfff4",
"name": "Redis4",
"type": "n8n-nodes-base.redis",
"typeVersion": 1,
"position": [
1440,
260
],
"credentials": {
"redis": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "push",
"list": "={{ $('Vari\u00e1veis').item.json.telefone }}",
"messageData": "={{ $json.content.replace(/\\n/g, \"\\\\n\").replace(/['\"]/g, '').trim() }}",
"tail": true
},
"id": "de4aa7b6-c5bb-4103-82ce-6c1d0cb4bc1e",
"name": "Redis5",
"type": "n8n-nodes-base.redis",
"typeVersion": 1,
"position": [
1440,
100
],
"credentials": {
"redis": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "50cebc66-2dbc-4c7a-a09e-83ffb0f52991",
"name": "mensagem",
"value": "={{ $('Preparar Dados').item.json.message }}",
"type": "string"
}
]
},
"options": {}
},
"id": "56f32f48-8087-48ad-ad30-ce68820754a6",
"name": "Edit Fields4",
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
340,
80
]
},
{
"parameters": {
"resource": "audio",
"operation": "transcribe",
"options": {}
},
"id": "867e7257-6696-4804-ac61-842c4c286b96",
"name": "OpenAI",
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1.6,
"position": [
620,
100
],
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"resource": "image",
"operation": "analyze",
"modelId": {
"__rl": true,
"value": "gpt-4o-mini",
"mode": "list",
"cachedResultName": "GPT-4O-MINI"
},
"text": "Descreva todo o conteudo da imagem. Responda sem acento, sem hifens",
"inputType": "base64",
"options": {}
},
"id": "04916d57-1f42-43f5-98a8-2d19d6d4d7ce",
"name": "OpenAI1",
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1.6,
"position": [
1100,
260
],
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 1
},
"conditions": [
{
"id": "52aaf749-fe4f-44e4-880e-15b2bfc027f1",
"leftValue": "={{ $(\"Code1\").item.json.skip }}",
"rightValue": false,
"operator": {
"type": "boolean",
"operation": "equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "skip"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 1
},
"conditions": [
{
"id": "e514e613-fd6a-48bd-b0ae-bae2448c810e",
"leftValue": "={{ $(\"Code1\").item.json.messageType }}",
"rightValue": "extendedTextMessage",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "text"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 1
},
"conditions": [
{
"leftValue": "={{ $('Code1').item.json.messageType }}",
"rightValue": "conversation",
"operator": {
"type": "string",
"operation": "equals"
},
"id": "670e0c36-4272-4a10-a985-cf04874a0760"
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "text"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 1
},
"conditions": [
{
"id": "c0e434dd-1268-421d-b81b-3a5e90ed9550",
"leftValue": "={{ $('Code1').item.json.messageType }}",
"rightValue": "audioMessage",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "audio"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 1
},
"conditions": [
{
"id": "d08b0737-61b0-4457-9d57-26e3718e261c",
"leftValue": "{{ $('Code1').item.json.messageType }}",
"rightValue": "imageMessage",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "image"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 1
},
"conditions": [
{
"id": "889ab76e-2401-4a44-af30-8706a697d4e0",
"leftValue": "unknownType",
"rightValue": "default",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "default"
}
]
},
"options": {}
},
"id": "1078026f-59d5-426a-a1e8-499f1b8ec077",
"name": "Switch1",
"type": "n8n-nodes-base.switch",
"typeVersion": 3,
"position": [
100,
40
]
},
{
"parameters": {
"content": "# Pausa para mensagens",
"height": 140,
"width": 376,
"color": 5
},
"id": "8c76487e-e922-44e9-b4f3-dc52b47e8cef",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
900,
-160
]
},
{
"parameters": {
"content": "",
"height": 720,
"width": 1660,
"color": 2
},
"type": "n8n-nodes-base.stickyNote",
"position": [
900,
-180
],
"typeVersion": 1,
"id": "5f149435-c146-4101-a48c-f55a44883a9b",
"name": "Sticky Note17"
},
{
"parameters": {
"content": "",
"height": 740,
"width": 800,
"color": 3
},
"type": "n8n-nodes-base.stickyNote",
"position": [
20,
-180
],
"typeVersion": 1,
"id": "b35fa4df-e74b-4231-997f-619c0a1272c7",
"name": "Sticky Note20"
},
{
"parameters": {
"content": "# Classifica Mensagens",
"height": 80,
"width": 396,
"color": 5
},
"id": "7400d194-0731-4cde-9401-e23ce430f0c2",
"name": "Sticky Note21",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
80,
-160
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "loose",
"version": 2
},
"conditions": [
{
"id": "21fd20d7-f940-4a66-91d5-5ea4c031bb50",
"leftValue": "={{ $('Code1').first().json.messageHash }}",
"rightValue": "={{ $('Preparar Dados').first().json.message || '' }}",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"looseTypeValidation": true,
"options": {}
},
"id": "81651f09-bac0-4ad5-a3ec-0db12978e5a5",
"name": "If2",
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
2080,
80
]
},
{
"parameters": {
"jsCode": "const raw = $json?.body?.data || {};\nconst key = raw?.key || {};\nconst message = raw?.message || {};\nconst fromMe = key?.fromMe ?? false;\n\n// Fun\u00e7\u00e3o para gerar UUID v4\nfunction generateUUID() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n const r = Math.random() * 16 | 0;\n const v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n}\n\n// Captura e normaliza a mensagem de texto\nlet bodyMsg = message?.conversation || \n message?.extendedTextMessage?.text || \n message?.imageMessage?.caption ||\n message?.videoMessage?.caption || \n '';\nbodyMsg = bodyMsg?.toString().normalize().replace(/\\s+/g, ' ').trim();\n\n// Extrai n\u00famero do WhatsApp\nconst remoteJid = key?.remoteJid || '';\nconst number = remoteJid.split('@')[0]?.replace(/\\D/g, '') || '';\n\n// Garante sessionId v\u00e1lido no formato UUID\nlet sessionId = key?.id;\nif (!sessionId || typeof sessionId !== 'string' || !sessionId.match(/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i)) {\n sessionId = generateUUID();\n}\n\n// Detecta tipo de mensagem\nlet messageType = 'desconhecido';\nconst allTypes = Object.keys(message || {});\n\nif (allTypes.includes('conversation')) {\n messageType = 'conversation';\n} else if (allTypes.includes('extendedTextMessage')) {\n messageType = 'extendedTextMessage';\n} else if (allTypes.includes('imageMessage')) {\n messageType = 'imageMessage';\n} else if (allTypes.includes('audioMessage')) {\n messageType = 'audioMessage';\n} else if (allTypes.includes('videoMessage')) {\n messageType = 'videoMessage';\n}\n\n// Regras de filtragem\nlet skip = false;\nlet skipReason = '';\n\nif (fromMe) {\n skip = true;\n skipReason = 'Mensagem enviada pelo bot';\n} else if (!bodyMsg) {\n skip = true;\n skipReason = 'Mensagem vazia';\n} else if (!number) {\n skip = true;\n skipReason = 'N\u00famero inv\u00e1lido';\n} else if (messageType === 'desconhecido') {\n skip = true;\n skipReason = 'Tipo de mensagem desconhecido';\n}\n\n// Timestamp atual\nconst timestamp = new Date().toISOString();\n\n// Cria uma hash simples da mensagem para comparar e evitar repeti\u00e7\u00e3o\nfunction createHash(text) {\n return Buffer.from(text).toString('base64').substring(0, 32);\n}\nconst messageHash = bodyMsg ? createHash(bodyMsg) : null;\n\n// Monta payload principal\nconst payload = {\n chatInput: bodyMsg,\n sessionId,\n number,\n message: bodyMsg,\n text: bodyMsg,\n messageType,\n skip,\n skipReason,\n timestamp,\n messageHash\n};\n\n// Prepara chave e valor para Redis\nconst redisKey = `mensagens:${sessionId}`;\nconst redisValue = JSON.stringify(payload);\n\nreturn [{\n json: {\n ...payload,\n redisKey,\n redisValue\n }\n}];\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-1040,
180
],
"id": "54d831a2-f1f8-493c-8d72-4a524f81e0dc",
"name": "Code1"
},
{
"parameters": {
"mode": "raw",
"jsonOutput": "{\n \"rules\": [\n {\n \"value1\": \"{{ $json.skip }}\",\n \"operation\": \"isFalse\"\n }\n ],\n \"combineOperation\": \"all\"\n}\n",
"includeOtherFields": true,
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
4340,
-140
],
"id": "f1d36d14-bd61-46a6-8878-ae830ead8d56",
"name": "Edit Fields2"
},
{
"parameters": {
"height": 780,
"width": 1360
},
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-1380,
-200
],
"id": "b13776f9-bae0-444a-a758-bd94d1b536f7",
"name": "Sticky Note"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "8d3e6c8a-4150-4951-90fb-2f81898dca7d",
"name": "number",
"value": "={{ $json.number.replace(/[^0-9]/g, '') }}",
"type": "string"
},
{
"id": "4904e424-50cf-45a5-be85-c8bbe7e52653",
"name": "message",
"value": "={{ $('Edit Fields10').item.json.message }}",
"type": "string"
}
]
},
"includeOtherFields": true,
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
760,
-120
],
"id": "9c692f29-3d94-4f15-a1a0-c8db024682c3",
"name": "Edit Fields5"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "loose",
"version": 2
},
"conditions": [
{
"id": "bbebf08a-59e2-466f-87f1-bdf1b95a7eeb",
"leftValue": "={{ $json.skip }}",
"rightValue": "false",
"operator": {
"type": "boolean",
"operation": "false",
"singleValue": true
}
}
],
"combinator": "and"
},
"looseTypeValidation": true,
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
320,
-40
],
"id": "b50e9098-9083-4cd7-a9c1-5942ce1a621e",
"name": "If",
"disabled": true
},
{
"parameters": {
"content": "# Atendente IA",
"height": 80,
"width": 276,
"color": 5
},
"id": "5c65917a-c918-4a9d-afa4-f922a7769a58",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
2760,
-120
]
},
{
"parameters": {
"content": "",
"height": 620,
"width": 660,
"color": 5
},
"type": "n8n-nodes-base.stickyNote",
"position": [
2740,
-140
],
"typeVersion": 1,
"id": "2603283c-10ea-49d8-b323-ea65906d429b",
"name": "Sticky Note4"
},
{
"parameters": {
"content": "# Agendamento",
"height": 80,
"width": 283,
"color": 5
},
"id": "0d7408f4-88af-4c83-91f3-51a17fb20e86",
"name": "Sticky Note15",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
2760,
660
]
},
{
"parameters": {
"content": "",
"height": 260,
"width": 660,
"color": 6
},
"type": "n8n-nodes-base.stickyNote",
"position": [
2740,
500
],
"typeVersion": 1,
"id": "62ed9f82-d822-43a2-a38e-7730f84922dd",
"name": "Sticky Note16"
},
{
"parameters": {
"descriptionType": "manual",
"toolDescription": "Use essa ferramenta quando precisar deletar um evento existente, com base no ID do evento\nsempre use o email do cliente para fazer o cancelamento.",
"operation": "delete",
"calendar": {
"__rl": true,
"value": "faelsouz0211@gmail.com",
"mode": "list",
"cachedResultName": "faelsouz0211@gmail.com"
},
"eventId": "={{ $fromAI('id') }}",
"options": {}
},
"id": "3b450c30-6d00-4b80-bc5e-ed19df0d37ed",
"name": "detelar_eventos",
"type": "n8n-nodes-base.googleCalendarTool",
"typeVersion": 1.2,
"position": [
3100,
520
],
"credentials": {
"googleCalendarOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"model": "gpt-4.1-mini",
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1,
"position": [
2760,
180
],
"id": "596d4872-e8f4-4292-8e37-338102fa856b",
"name": "OpenAI Chat Model",
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "getAll",
"calendar": {
"__rl": true,
"value": "faelsouz0211@gmail.com",
"mode": "list",
"cachedResultName": "faelsouz0211@gmail.com"
},
"returnAll": true,
"options": {
"timeMin": "={{ $fromAI('start_date') }}",
"timeMax": "={{ $fromAI('end_date') }}",
"query": "@"
}
},
"id": "3592bc4e-fb5c-4685-af5c-8ca8795ffc7d",
"name": "buscar_eventos",
"type": "n8n-nodes-base.googleCalendarTool",
"typeVersion": 1.2,
"position": [
2780,
520
],
"credentials": {
"googleCalendarOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"descriptionType": "manual",
"toolDescription": "Use essa ferramenta para criar o agendamento do cliente,apenas um agendamento por hor\u00e1rio, fa\u00e7a com que exista a consulta de hor\u00e1rio na tool busca_eventos para n\u00e3o agendar dois clientes no mesmo horario.\nApenas uma e-mail de usu\u00e1rio por hor\u00e1rio de atendimento\nEst\u00e1 proibido agendar mais de uma vez.",
"calendar": {
"__rl": true,
"value": "faelsouz0211@gmail.com",
"mode": "list",
"cachedResultName": "faelsouz0211@gmail.com"
},
"start": "= {{ $fromAI('start_time') }}",
"end": "= {{ $fromAI('end_time') }}",
"additionalFields": {
"attendees": [
"={{ $fromAI('email_do_cliente') }}"
],
"color": "3",
"conferenceDataUi": {
"conferenceDataValues": {
"conferenceSolution": "hangoutsMeet"
}
},
"description": "={{ (() => { \n const value = $fromAI('tipo_servico'); \n return value.charAt(0).toUpperCase() + value.slice(1); \n})() }} {{ $fromAI('nome_pet') }} Porte {{ $fromAI('porte') }} ",
"location": "={{ $fromAI('local_evento') }}",
"sendUpdates": "all",
"summary": "={{ (() => { \n const value = $fromAI('tipo_servico'); \n return value.charAt(0).toUpperCase() + value.slice(1); \n})() }}: {{ $fromAI('nome_pet') }} - {{ $fromAI('nome_cliente') }} "
}
},
"id": "9392a38a-923a-4aa4-bf34-c4bd7aa736a7",
"name": "criar_eventos",
"type": "n8n-nodes-base.googleCalendarTool",
"typeVersion": 1.2,
"position": [
2940,
520
],
"credentials": {
"googleCalendarOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"descriptionType": "manual",
"toolDescription": "Use essa ferramenta para enviar um email para o cliente quando solcitiado e tamb\u00e9m para quando o agendamento for confirmado.",
"sendTo": "={{ $fromAI(\"email\") }}",
"subject": "={{ $fromAI(\"Titulo\",\"coloque aqui o titulo do email.\") }}",
"emailType": "text",
"message": "={{ $fromAI(\"texto\",\"coloque aqui os dados resumidos da conversa ou do agendamento, ex: nome, email, telefone, data\") }}",
"options": {
"appendAttribution": false,
"senderName": "Enviado pela ",
"replyTo": "n8nlabz@gmail.com"
}
},
"id": "3ba0ee0f-cefd-4e66-ba98-8694c678fc58",
"name": "enviar_email",
"type": "n8n-nodes-base.gmailTool",
"typeVersion": 2.1,
"position": [
3260,
520
],
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"promptType": "define",
"text": "={{ $(\"Preparar Dados\").item.json.message || '' }}",
"options": {
"systemMessage": "=<systemData>\nData de hoje: {{ $now.weekdayLong }}, {{ $now.format('dd/MM/yyyy') }}, {{ $now.hour.toString().padStart(2, '0') }}:{{ $now.minute.toString().padStart(2, '0') }}\n</systemData>\n\n<Agent>\nNome: Aurora \nDescri\u00e7\u00e3o: Especialista em atendimento e agendamentos para empresas \nObjetivo: Continuar a conversa com o lead, sem repetir mensagens j\u00e1 enviadas.\n</Agent>\n\n<Instruction>\nVoc\u00ea est\u00e1 em uma conversa via WhatsApp. Sempre continue do ponto onde parou. Se j\u00e1 pediu informa\u00e7\u00f5es, aguarde o cliente responder. S\u00f3 repita se ele estiver confuso.\n</Instruction>\n\n\n<Agent>\n\n <Name>Aurora</Name>\n <Description>Especialista em automa\u00e7\u00e3o comercial da AIAgent Automate</Description>\n <Language>Portugu\u00eas Brasileiro</Language>\n\n<Recep\u00e7\u00e3o do Cliente>\nOl\u00e1! Tudo certo? Me chamo Aurora e sou especialista em automa\u00e7\u00e3o comercial da AIAgent Automate \ud83e\udd16. Como posso te ajudar hoje?\n</Recep\u00e7\u00e3o do Cliente>\n\n<CommunicationStyle>\n <style>Consultivo</style>\n <Guide>\n [\n \"Foque sempre em entender o desafio do cliente antes de oferecer uma solu\u00e7\u00e3o.\",\n \"Use exemplos pr\u00e1ticos e linguagem simples, mesmo em contextos t\u00e9cnicos.\",\n \"Mostre empatia e interesse genu\u00edno no crescimento do cliente.\",\n \"Evite termos excessivamente t\u00e9cnicos sem explica\u00e7\u00e3o clara.\",\n \"Seja proativa ao sugerir solu\u00e7\u00f5es com base no que o cliente menciona.\",\n \"Nunca force uma venda; eduque o cliente sobre os benef\u00edcios com base em dados.\",\n \"Sempre ofere\u00e7a uma pr\u00f3xima a\u00e7\u00e3o: agendar reuni\u00e3o, enviar apresenta\u00e7\u00e3o, etc.\",\n \"Evite respostas gen\u00e9ricas. Adapte com base no segmento e no n\u00edvel do cliente.\",\n \"Encerrar sempre perguntando se h\u00e1 mais algo em que pode ajudar.\"\n ]\n </Guide>\n</CommunicationStyle>\n\n<FieldsConfigurator>\n [\n \"Identificar segmento do cliente (ex: sa\u00fade, varejo, servi\u00e7os) para adaptar sugest\u00f5es.\",\n \"Validar se o lead est\u00e1 qualificado (cargo, interesse, momento de compra).\",\n \"Sugest\u00e3o autom\u00e1tica de casos de uso relevantes com base no setor.\",\n \"Monitorar e registrar gatilhos de compra (ex: deseja escalar vendas, reduzir custo etc).\"\n ]\n</FieldsConfigurator>\n\n<Validations>\n <Validation>Validar nome, empresa e e-mail antes de seguir para pr\u00f3xima etapa.</Validation>\n <Validation>Detectar leads duplicados por e-mail e alertar equipe se necess\u00e1rio.</Validation>\n <Validation>Checar se o cliente j\u00e1 \u00e9 da base antes de apresentar solu\u00e7\u00f5es de aquisi\u00e7\u00e3o.</Validation>\n <Validation>Verificar se o cliente entende a proposta de valor da IA antes de agendar reuni\u00e3o.</Validation>\n</Validations>\n\n<Rules>\n <Rule>Se n\u00e3o entender a pergunta do cliente, pe\u00e7a educadamente por mais contexto.</Rule>\n <Rule>Evite afirmar qualquer coisa sem embasamento em dados internos ou depoimentos validados.</Rule>\n <Rule>Jamais compartilhe informa\u00e7\u00f5es internas ou t\u00e9cnicas sens\u00edveis.</Rule>\n <Rule>Se o cliente for rude, mantenha a educa\u00e7\u00e3o e encurte a conversa.</Rule>\n <Rule>Se a conversa for al\u00e9m do escopo da automa\u00e7\u00e3o comercial, encaminhe para um especialista.</Rule>\n <Rule>Evite repetir a mesma informa\u00e7\u00e3o mais de uma vez.</Rule>\n <Rule>Use linguagem acess\u00edvel a tomadores de decis\u00e3o n\u00e3o t\u00e9cnicos.</Rule>\n <Rule>Evite textos longos. Comunica\u00e7\u00e3o objetiva \u00e9 prioridade.</Rule>\n <Rule>Sempre indique um pr\u00f3ximo passo claro no fim da conversa.</Rule>\n <Rule>Se o cliente quiser agendar uma reuni\u00e3o, confirme e colete: nome, e-mail, telefone, cargo, empresa e hor\u00e1rio.</Rule>\n <Rule>O agente s\u00f3 deve continuar a conversa ap\u00f3s o cliente responder no WhatsApp.</Rule>\n</Rules>\n\n<Agents>\n <SDR>\n <Nome>Aurora SDR</Nome>\n <Fun\u00e7\u00e3o>Qualificar leads comerciais com base em interesse, cargo e momento de compra.</Fun\u00e7\u00e3o>\n <Fluxo>\n - Receber o lead\n - Fazer perguntas de qualifica\u00e7\u00e3o (nome, empresa, cargo, desafio)\n - Validar interesse e repassar para agendamento se lead estiver pronto\n </Fluxo>\n </SDR>\n \n <Agendamento>\n <Nome>Aurora Agenda</Nome>\n <Fun\u00e7\u00e3o>Agendar reuni\u00f5es com leads qualificados, considerando fuso hor\u00e1rio de S\u00e3o Paulo (America/Sao_Paulo).</Fun\u00e7\u00e3o>\n <Fluxo>\n - Confirmar interesse do cliente\n - Coletar: nome, e-mail, telefone, cargo, empresa e melhor hor\u00e1rio\n - Confirmar data/hora com timezone correto\n - Encaminhar confirma\u00e7\u00e3o\n </Fluxo>\n </Agendamento>\n</Agents>\n\n<Roteiro>\n```markdown\n# Roteiro de Conversa \u2013 Agente Comercial B2B (Aurora \u2013 AIAgent Automate)\n\n---\n\n## 1. Sauda\u00e7\u00e3o Inicial\n\"Ol\u00e1! Tudo certo? Me chamo Aurora e sou especialista em automa\u00e7\u00e3o comercial da AIAgent Automate \ud83e\udd16. Como posso te ajudar hoje?\"\n\n---\n\n## 2. Diagn\u00f3stico Inicial (SDR)\n\n**Perguntas de qualifica\u00e7\u00e3o (uma de cada vez):**\n- Qual o nome da sua empresa?\n- Qual o seu nome e cargo por l\u00e1?\n- Qual \u00e9 o maior desafio comercial que voc\u00ea enfrenta hoje? (ex: captar leads, qualificar, responder r\u00e1pido, escalar atendimento...)\n- Seu processo de vendas \u00e9 mais B2B ou B2C?\n- Voc\u00ea j\u00e1 utiliza alguma automa\u00e7\u00e3o atualmente?\n\n---\n\n## 3. Apresenta\u00e7\u00e3o de Valor\n\"Entendi! Com a nossa tecnologia de agentes de IA, empresas como a sua conseguem: \n- Reduzir at\u00e9 60% do tempo de resposta \n- Aumentar convers\u00e3o de leads em at\u00e9 40% \n- Operar 24/7 sem sobrecarga humana \nTudo isso com intera\u00e7\u00f5es naturais, integradas a WhatsApp, CRM e muito mais.\"\n\n---\n\n## 4. Proposta de A\u00e7\u00e3o\n\"Se fizer sentido, posso agendar uma reuni\u00e3o r\u00e1pida com um especialista da AIAgent. Pode ser?\"\n\n---\n\n## 5. Agendamento (Agente Agenda)\n\"Perfeito! Para agendar, preciso de algumas informa\u00e7\u00f5es r\u00e1pidas, pode ser?\" \n[Coleta: Nome, Empresa, E-mail, Telefone, Cargo, Melhor Hor\u00e1rio em hor\u00e1rio de S\u00e3o Paulo]\n\n---\n\n## 6. Encerramento\n\"Obrigada pela conversa! Se precisar de algo a mais, \u00e9 s\u00f3 me chamar por aqui. Vamos te ajudar a escalar suas vendas com intelig\u00eancia. \ud83d\ude80\"\n\n---\n\n## 7. Esperar mensagem no WhatsApp antes de seguir a conversa.\n\n\n\n"
}
},
"id": "0bc6cca1-111e-473b-aa3d-17ea428fe8ac",
"name": "Atendente",
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 1.6,
"position": [
2920,
0
]
},
{
"parameters": {
"sessionIdType": "customKey",
"sessionKey": "={{ $(\"Preparar Dados\").item.json.sessionId || $execution.id }}",
"contextWindowLength": "={{ 50 }}"
},
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"typeVersion": 1.3,
"position": [
2900,
180
],
"id": "62d19e16-7bef-4b82-8cd8-f8ea48aec3cb",
"name": "Simple Memory",
"notesInFlow": false
},
{
"parameters": {
"options": {}
},
"id": "129e54e3-667b-4331-b9da-36911b5cd269",
"name": "OpenAI Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1,
"position": [
3860,
560
],
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"model": "text-embedding-3-small",
"options": {}
},
"id": "68c63908-7a48-4a8e-ad3c-e992954aff47",
"name": "Embeddings OpenAI",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"typeVersion": 1,
"position": [
3640,
700
],
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"tableName": {
"__rl": true,
"value": "documents",
"mode": "list",
"cachedResultName": "documents"
},
"options": {
"queryName": "match_documents"
}
},
"id": "b4853166-86fb-4edc-bce2-799f399c12b5",
"name": "Supabase Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"typeVersion": 1,
"position": [
3560,
560
],
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"content": "",
"height": 520,
"width": 460,
"color": 3
},
"type": "n8n-nodes-base.stickyNote",
"position": [
3540,
400
],
"typeVersion": 1,
"id": "94e015bc-81d9-4c0a-851b-fdeddc0367ec",
"name": "Sticky Note5"
},
{
"parameters": {
"name": "user_documents",
"description": "Contains all the information about prices that you can check to answer user questions."
},
"id": "800f22f6-715b-4634-9d00-f3a7ba0af7bd",
"name": "busca_documentos",
"type": "@n8n/n8n-nodes-langchain.toolVectorStore",
"typeVersion": 1,
"position": [
3640,
420
]
},
{
"parameters": {
"options": {}
},
"id": "ca54c355-0b88-4592-a67b-3a213c8d559e",
"name": "OpenAI3",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1,
"position": [
3600,
-60
],
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"fieldToSplitOut": "output.messages",
"options": {
"destinationFieldName": "output"
}
},
"id": "9cceeec1-05a5-4cc4-89e6-2d319539f602",
"name": "Segmentos1",
"type": "n8n-nodes-base.splitOut",
"typeVersion": 1,
"position": [
3880,
-300
]
},
{
"parameters": {
"amount": 1.2
},
"id": "f56e438b-dcb2-40c6-bbc9-305a6b200b78",
"name": "1,2s1",
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
4600,
-280
]
},
{
"parameters": {
"options": {}
},
"id": "9bdd57fb-bc43-44ee-bdd0-9e54feb1bd2f",
"name": "Loop Over Items3",
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 3,
"position": [
4020,
-280
]
},
{
"parameters": {},
"id": "173a3fb5-c7a2-4fc7-8da5-242e103e8f61",
"name": "no.op",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
4740,
-280
]
},
{
"parameters": {},
"id": "74573f4b-d683-47ef-93aa-9d27f7779832",
"name": "Replace Me",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
4240,
-280
]
},
{
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"messages\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\"messages\"]\n}"
},
"id": "2e749181-d6e6-41bb-b48e-5b31b2ebdc55",
"name": "OutputParser1",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"typeVersion": 1.2,
"position": [
3760,
-60
]
},
{
"parameters": {
"promptType": "define",
"text": "=Whatsapp message to be splitted and formated: {{ $json.output }}",
"hasOutputParser": true,
"messages": {
"messageValues": [
{
"message": "=Por favor, gere a sa\u00edda no seguinte formato JSON:\n{\n \"messages\": [\n \"splitedMessage\",\n \"splitedMessage\",\n \"splitedMessage\"\n ]\n}\n\nAs mensagens devem ser divididas de forma natural, afinal estamos conversando com um humano, n\u00e3o \u00e9 mesmo?\n\nCertifique-se de que a resposta siga exatamente essa estrutura, incluindo os colchetes e as aspas.\n\n### Jamais separe uma mensagem vazia.\n\n### Certifique-se de que a resposta siga exatamente essa estrutura abaixo, deixando somente entre '*' para negrito e nunca fugindo das demais regras de markdown do whatsapp:\n\t\t\t- *negrito* (substitua '**' por '*')\n\t\t\t- ~tachado~ (caso seja algo que foi exclu\u00eddo ou alterado)\n\t\t\t- _it\u00e1lico_.(extremamente raro)\n - `link` (usar sempre em todos os links)\n\nTudo o que for link, pode colocar entre \"`\", ou seja, na seguinte formata\u00e7\u00e3o: `www.link.com.br`\n"
}
]
}
},
"id": "ea25df6b-25d6-4347-9237-98a2bb96ebc9",
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.
gmailOAuth2openAiApiopenWeatherMapApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
My workflow 14. Uses rssFeedRead, chainLlm, lmChatOpenAi, openWeatherMap. Scheduled trigger; 40 nodes.
Source: https://github.com/Ker102/Kaelux-Automate/blob/main/data/workflows/episodes/episode_2_daily_digest.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 n8n-powered workflow automates the entire lifecycle of real estate lead intake, qualification, routing, assignment, and reporting across multiple channels. It brings WhatsApp inquiries and websit
V2 (2026) available! An intelligent, fully automated news aggregation system that collects articles from multiple sources (RSS feeds + Google Search), uses AI to classify and summarize the most import
kisisel asistan. Uses toolWorkflow, toolHttpRequest, toolCalculator, toolThink. Scheduled trigger; 43 nodes.
This workflow automates end-to-end financial transaction processing for finance teams managing high-volume bank data. It eliminates manual reconciliation by intelligently classifying transactions, det
[](https://youtu.be/sKJAypXDTLA)