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 →
{
"name": "Bread-Meat-Delivery",
"nodes": [
{
"parameters": {
"model": "gpt-4.1-mini-2025-04-14",
"options": {
"temperature": 0.5
}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1,
"position": [
3140,
680
],
"id": "dd77c46f-1f2f-442f-8b5c-bd130db13287",
"name": "OpenAI Chat Model",
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "69918e5c-6cbf-44a1-a0a8-e6bdd9646860",
"name": "text",
"value": "={{ $node[\"fields\"].json[\"text\"] }}",
"type": "string"
},
{
"id": "d5f56632-01ff-492a-98f1-c4f4dd7cc601",
"name": "session_id",
"value": "={{ $node[\"fields\"].json[\"ConversationID\"] }}",
"type": "string"
},
{
"id": "85351078-014d-476b-a79d-1b9cf0d604d9",
"name": "date_time",
"value": "={{ $now.format('yyyy-MM-dd')}}",
"type": "string"
},
{
"id": "142e0a72-710c-4497-9dae-d6c6bc9511e8",
"name": "week_day",
"value": "={{ $today.weekdayLong}}",
"type": "string"
},
{
"id": "17dd323e-622c-48d5-b870-86ed37aa7067",
"name": "horario",
"value": "={{ $now.format('HH:mm:ss')}}",
"type": "string"
},
{
"id": "b45baf98-0908-44ba-bb24-051e838ccf40",
"name": "name",
"value": "={{ $node[\"Run Cadastro Cliente\"].json[\"name\"] }}",
"type": "string"
},
{
"id": "957f3018-b2e2-4a3d-a278-b6406c259f94",
"name": "location",
"value": "={{ $node[\"Run Cadastro Cliente\"].json[\"location\"] }}",
"type": "string"
},
{
"id": "26024e25-594a-4572-884f-9b79916a9f2e",
"name": "customer_name",
"value": "={{ $node[\"Run Cadastro Cliente\"].json[\"customer_name\"] }}",
"type": "string"
},
{
"id": "703c9c77-1660-4583-803c-1353c1d20778",
"name": "phone",
"value": "={{ $node[\"Run Cadastro Cliente\"].json[\"phone\"] }}",
"type": "string"
},
{
"id": "a6303600-ad4e-4839-b6fb-f84c0768c09a",
"name": "full_address",
"value": "={{ $node[\"Run Cadastro Cliente\"].json[\"full_address\"] }}",
"type": "string"
},
{
"id": "26281099-e2c7-4938-87d2-699ea7655513",
"name": "lat",
"value": "={{ $node[\"Run Cadastro Cliente\"].json[\"lat\"] }}",
"type": "string"
},
{
"id": "d4a99a36-ca92-4e86-ab72-fc8d53d931b8",
"name": "long",
"value": "={{ $node[\"Run Cadastro Cliente\"].json[\"long\"] }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
2620,
380
],
"id": "2af6bbfd-ca72-41ed-9282-996f8b007d55",
"name": "Config"
},
{
"parameters": {
"promptType": "define",
"text": "==Configura\u00e7\u00e3o do Agente:\nVoc\u00ea \u00e9 um agente de atendimento da Bread&Meat, especializado em carnes e acompanhamentos por delivery via WhatsApp. \nN\u00e3o misture mensagens internas com conversas ao cliente.\n\nFerramentas dispon\u00edveis: \n- enviar_cardapio \n- buscar_itens \n- create_order \n- add_item_to_order \n- remove_item_from_order \n- calcula_frete \n- update_order_status \n- get_order_items \n- SendWhatsappInvoice \n- memory.get \n- memory.set \n\nMem\u00f3ria de contexto (em Redis): \n- ultimo_tipo: estado atual (\u201cselecao\u201d quando aguardando escolha) \n- ultimas_opcoes: array de { nome, preco, quantidade } \n- order_id: ID do pedido em cadastramento \n- last_action: controle de etapas (\u201cpending_finalize\u201d) \n\nFluxo de intera\u00e7\u00e3o:\n\n0. Carregar mem\u00f3ria \nexecute a tool memory.get \"input\":{ \"key\":\"status-{{$json.phone}}\" } \n\u2014 interno: memory_state = response.value \n\n1. Sauda\u00e7\u00e3o / In\u00edcio \nSe texto =~ `/^(bom dia|boa tarde|boa noite|oi|ol[\u00e1a])$/i`: \n memory_state = { ultimo_tipo:null, ultimas_opcoes:[], order_id:null, last_action:null } \n execute a tool memory.set \"input\":{ \"key\":\"status-{{$json.phone}}\",\"value\":memory_state } \n execute a tool enviar_cardapio \"input\":{ \"phone\":\"{{$json.phone}}\" } \n texto puro: Ol\u00e1, {{$json.customer_name}}! Vamos de costela hoje? Qual categoria deseja? \nPare.\n\n2. Fallback de busca \nSe memory_state.last_action != \"pending_finalize\" **e** texto n\u00e3o =~ `/^\\d+$/` **e** texto n\u00e3o corresponde a sauda\u00e7\u00e3o ou remo\u00e7\u00e3o: \n execute a tool buscar_itens \"input\":{ \"phone\":\"{{$json.phone}}\",\"texto\":\"{{$json.text}}\" } \n \u2014 interno: memory_state.ultimo_tipo = \"selecao\"; memory_state.ultimas_opcoes = response.opcoes \n execute a tool memory.set \"input\":{ \"key\":\"status-{{$json.phone}}\",\"value\":memory_state } \nPare.\n\n3. Exibir resultados da busca \nSe memory_state.ultimo_tipo == \"selecao\" **e** response.resposta existe: \n texto puro: {{response.resposta}} \n texto puro: Por favor, informe o n\u00famero da op\u00e7\u00e3o de \"{{$json.text}}\" que deseja pedir. \nPare.\n\n4. Sele\u00e7\u00e3o de item \nSe memory_state.ultimo_tipo == \"selecao\" **e** texto =~ `/^\\d+$/`: \n N = parseInt(texto); item = memory_state.ultimas_opcoes[N-1] \n se memory_state.order_id == null: \n execute a tool create_order \"input\":{ \"phone\":\"{{$json.phone}}\",\"customer\":\"{{$json.customer_name}}\",\"address\":\"{{$json.full_address}}\",\"distance\":{{$json.distancia}} } \n \u2014 interno: memory_state.order_id = response.order_id \n execute a tool memory.set \"input\":{ \"key\":\"status-{{$json.phone}}\",\"value\":memory_state } \n execute a tool add_item_to_order \"input\":{ \"order_id\":{{$memory.order_id}},\"nome\":\"{{item.nome}}\",\"preco\":{{item.preco}},\"quantidade\":{{item.quantidade}} } \n texto puro: Item \"{{item.nome}}\" adicionado ao pedido. Algo mais? \n sen\u00e3o: \n execute a tool add_item_to_order \"input\":{ \"order_id\":{{$memory.order_id}},\"nome\":\"{{item.nome}}\",\"preco\":{{item.preco}},\"quantidade\":{{item.quantidade}} } \n texto puro: Item \"{{item.nome}}\" adicionado. Algo mais? \n memory_state.ultimo_tipo = null \n execute a tool memory.set \"input\":{ \"key\":\"status-{{$json.phone}}\",\"value\":memory_state } \nPare.\n\n5. C\u00e1lculo de frete \nSe texto =~ `/^(n\u00e3o|finalizar)$/i` **e** memory_state.last_action != \"pending_finalize\": \n execute a tool calcula_frete \"input\":{ \"query\":{{$json.distancia}} } \n \u2014 interno: memory_state.last_action = \"pending_finalize\" \n execute a tool memory.set \"input\":{ \"key\":\"status-{{$json.phone}}\",\"value\":memory_state } \nPare.\n\n6. Apresentar frete \nSe memory_state.last_action == \"pending_finalize\" **e** response.frete existe **e** texto n\u00e3o =~ `/^(?:sim|s|ok|okay|claro|confirmar)$/i`: \n texto puro: Frete: R$ {{response.frete.toFixed(2)}}. Deseja confirmar o pedido? \nPare.\n\n7. Confirma\u00e7\u00e3o final \nSe memory_state.last_action == \"pending_finalize\" **e** texto =~ `/^(?:sim|s|ok|okay|claro|confirmar)$/i`: \n execute a tool update_order_status \"input\":{ \"order_id\":{{$memory.order_id}},\"status\":\"solicitado\" } \n execute a tool get_order_items \"input\":{ \"order_id\":{{$memory.order_id}} } \n \u2014 interno: total = \u03a3(i.preco * i.quantidade) \n texto puro: \n Pedido #{{$memory.order_id}} confirmado! \n Itens: \n {{response.itens.map(i => `${i.quantidade}x ${i.nome} \u2013 R$ ${i.preco.toFixed(2)}`).join('\\n')}} \n Total: R$ {{total.toFixed(2)}} \n execute a tool SendWhatsappInvoice \"input\":{ \"message\":\"Pedido #{{$memory.order_id}}:\\n\" + response.itens.map(i => `${i.quantidade}x ${i.nome}`).join(\"\\n\") + `\\nTotal: R$ ${total.toFixed(2)}` } \n memory_state = { ultimo_tipo:null, ultimas_opcoes:[], order_id:null, last_action:null } \n execute a tool memory.set \"input\":{ \"key\":\"status-{{$json.phone}}\",\"value\":memory_state } \nPare.\n\n**Estilo:** \n- Cada tool-call em sua pr\u00f3pria linha com JSON colado (`\"input\":{...}`) sem espa\u00e7os extras. \n- \u201cPare\u201d interrompe o fluxo ap\u00f3s cada etapa. \n- Mem\u00f3ria carregada no in\u00edcio e gravada sempre que muda. \n",
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 1.7,
"position": [
3780,
340
],
"id": "d34fa69b-0f0a-437b-acc6-58cd6776493e",
"name": "Agendamento AI",
"notesInFlow": false
},
{
"parameters": {
"method": "POST",
"url": "={{ $('fields').item.json.evolutiom_api_url }}/chat/getBase64FromMediaMessage/{{ $('fields').item.json.evolution_instance }}",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "apikey",
"value": "={{ $('fields').item.json.evolution_api_key }}"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "message.key.id",
"value": "={{ $('fields').item.json.MessageID }}"
},
{
"name": "convertToMp4",
"value": "true"
}
]
},
"options": {}
},
"id": "0b5da6f3-c72a-4c62-8fc8-323433ad3426",
"name": "GetAudio-HTTP Request",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
1660,
200
],
"alwaysOutputData": true
},
{
"parameters": {
"content": "# Debounce",
"height": 529,
"width": 2244,
"color": 3
},
"id": "3bfc4f80-35ad-4df2-b250-3603338f0118",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-700,
1360
]
},
{
"parameters": {
"operation": "toBinary",
"sourceProperty": "base64",
"options": {
"fileName": "audio",
"mimeType": "={{ $json.mimetype }}"
}
},
"id": "02310207-6bfa-4a65-b314-dc888774f0ef",
"name": "Convert to File",
"type": "n8n-nodes-base.convertToFile",
"typeVersion": 1.1,
"position": [
1900,
200
],
"onError": "continueRegularOutput"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "d2fce443-aed1-46fe-b0ba-fca2170c6493",
"name": "text",
"value": "={{ $json.messages.join(' ') }}",
"type": "string"
}
]
},
"options": {}
},
"id": "da059ec1-86bc-47fd-83da-c522b33dc558",
"name": "AgruparMSGs",
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
1940,
1400
]
},
{
"parameters": {
"amount": 0
},
"id": "afc7c999-2c38-4296-bf78-edeb2f7b1e3e",
"name": "Wait",
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
920,
1500
]
},
{
"parameters": {
"operation": "push",
"list": "=msgs-{{$json.phone }}",
"messageData": "={{ $json.text }}"
},
"id": "1decaa8c-fef2-4f66-8021-54f12d725463",
"name": "RedisPushMsgs",
"type": "n8n-nodes-base.redis",
"typeVersion": 1,
"position": [
680,
1500
],
"credentials": {
"redis": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "delete",
"key": "=msgs-{{ $json.phone }}"
},
"id": "9046f38e-0d94-4eb6-9544-b4bb1b9f95e7",
"name": "RedisClearMSGs",
"type": "n8n-nodes-base.redis",
"typeVersion": 1,
"position": [
2160,
1380
],
"credentials": {
"redis": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "get",
"propertyName": "=messages",
"key": "=msgs-{{ $json.phone }}",
"options": {}
},
"id": "0279e030-2304-480f-9afb-cbed7f62d173",
"name": "ListaMsg-Redis",
"type": "n8n-nodes-base.redis",
"typeVersion": 1,
"position": [
1200,
1500
],
"credentials": {
"redis": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "df119838-c757-4618-a3c8-2e1aede4115b",
"name": "text",
"value": "={{ $('fields').item.json.extendedTextMessage }}",
"type": "string"
}
]
},
"options": {}
},
"id": "e6104802-5c39-4d3b-863d-7fdd3ba0a35c",
"name": "SetTextExtendedTextMessage",
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
1800,
860
]
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "df119838-c757-4618-a3c8-2e1aede4115b",
"name": "text",
"value": "={{ $('fields').item.json.ephemeralMessage }}",
"type": "string"
}
]
},
"options": {}
},
"id": "4f1e68e5-5bc0-4ef2-8b33-6ad531795ee5",
"name": "SetEphemeralMessage",
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
1800,
640
]
},
{
"parameters": {
"numberInputs": 4
},
"id": "c87a35be-1e42-4c9d-9bef-99a9e7fb6513",
"name": "Merge",
"type": "n8n-nodes-base.merge",
"typeVersion": 3,
"position": [
2100,
560
],
"alwaysOutputData": true
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 1
},
"conditions": [
{
"id": "ec39573f-f92a-4fe4-a832-0a137de8e7d0",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.messages?.first() }}",
"rightValue": "={{ $('RedisPushMsgs').item.json.text }}"
}
],
"combinator": "and"
},
"options": {}
},
"id": "f1880944-f7ea-4718-b1b1-b8a9aacb32e3",
"name": "Should Continue?",
"type": "n8n-nodes-base.if",
"position": [
1560,
1500
],
"typeVersion": 2
},
{
"parameters": {},
"id": "a06b0407-f01e-4be7-9b6a-4397962c0315",
"name": "FimFluxo",
"type": "n8n-nodes-base.noOp",
"position": [
2160,
1680
],
"typeVersion": 1
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "6ace55bc-45c2-4cfe-b8a7-64a409c44b47",
"leftValue": "={{ $json.body.event }}",
"rightValue": "messages.upsert",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "or"
},
"options": {}
},
"id": "69dfeb16-4f62-407d-b180-65809556b4dd",
"name": "If",
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
-640,
220
]
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"leftValue": "={{ $json.fromMe }}",
"rightValue": "false",
"operator": {
"type": "string",
"operation": "equals"
}
}
],
"combinator": "and"
}
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "216b830c-ed10-4839-b6f0-29589acea816",
"leftValue": "={{ $json.fromMe }}",
"rightValue": "true",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
}
}
]
},
"options": {}
},
"id": "99003175-5fd2-4550-a864-1d82515085fd",
"name": "FromMe-Switch",
"type": "n8n-nodes-base.switch",
"typeVersion": 3.2,
"position": [
-580,
480
]
},
{
"parameters": {
"operation": "delete",
"key": "=traplist-{{ $('fields').item.json.phone }}"
},
"id": "cfafc5aa-b543-4828-88cb-e669338ab690",
"name": "RemoveFromTrapList",
"type": "n8n-nodes-base.redis",
"typeVersion": 1,
"position": [
-320,
1000
],
"credentials": {
"redis": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "push",
"list": "=traplist-{{ $('fields').item.json.phone }}",
"messageData": "true"
},
"id": "fd36f660-e849-42b0-b42b-b01a505bf021",
"name": "AddTrapList",
"type": "n8n-nodes-base.redis",
"typeVersion": 1,
"position": [
-320,
820
],
"credentials": {
"redis": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"method": "POST",
"url": "={{ $('fields').item.json.evolutiom_api_url }}/message/sendText/{{ $('fields').item.json.evolution_instance }}",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "apikey",
"value": "={{ $('fields').item.json.evolution_api_key }}"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "number",
"value": "={{$('fields').item.json.phone}}"
},
{
"name": "text",
"value": "=Chatbot parado para o n\u00famero : {{$('RemoveCliente').item.json.phone }}"
},
{
"name": "key,fromMe",
"value": "false"
}
]
},
"options": {}
},
"id": "75d53960-babc-4f37-aabe-a27d35e5c87a",
"name": "Evolution API - HTTP Request3",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
20,
820
]
},
{
"parameters": {
"method": "POST",
"url": "={{ $('fields').item.json.evolutiom_api_url }}/message/sendText/{{ $('fields').item.json.evolution_instance }}",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "apikey",
"value": "={{ $('fields').item.json.evolution_api_key }}"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "number",
"value": "={{$('fields').item.json.phone}}"
},
{
"name": "text",
"value": "=Chatbot inciado para o n\u00famero : {{$('RemoveCliente').item.json.phone }}"
},
{
"name": "key,fromMe",
"value": "false"
}
]
},
"options": {}
},
"id": "f765ddc2-66ce-49b0-b461-2633d9b41dee",
"name": "Evolution API - HTTP Request2",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
20,
1000
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "1cebe163-b56d-4bb2-ba87-c716fee0d32f",
"leftValue": "={{ $json['trap-list'] }}",
"rightValue": "",
"operator": {
"type": "array",
"operation": "empty",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"id": "77d8c7d0-9fd1-463f-9053-9b7ae5b7c587",
"name": "If1",
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
660,
80
]
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"leftValue": "={{ $('fields').item.json.type }}",
"rightValue": "audioMessage",
"operator": {
"type": "string",
"operation": "equals"
}
}
],
"combinator": "and"
}
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "8ad5e3e1-4996-444b-ae49-e3cc69b41cff",
"leftValue": "={{ $('fields').item.json.type }}",
"rightValue": "conversation",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
}
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "82ed6c89-f8f0-42dc-af37-3a9ba88be43f",
"leftValue": "={{ $('fields').item.json.type }}",
"rightValue": "ephemeralMessage",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
}
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "4b1379ec-28c5-4fbf-9e64-774c6ca4c551",
"leftValue": "={{ $('fields').item.json.type }}",
"rightValue": "extendedTextMessage",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
}
}
]
},
"options": {}
},
"id": "bc4c49d0-163b-40fb-a3af-807d9a756490",
"name": "Switch",
"type": "n8n-nodes-base.switch",
"typeVersion": 3.2,
"position": [
1380,
340
],
"onError": "continueRegularOutput"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "df119838-c757-4618-a3c8-2e1aede4115b",
"name": "text",
"value": "={{ $('fields').item.json.text }}",
"type": "string"
},
{
"id": "bfcc306a-b34d-463c-b3ee-aea90b23342f",
"name": "phone",
"value": "={{ $('fields').item.json.phone }}",
"type": "string"
}
]
},
"options": {}
},
"id": "9d1d32bb-3135-471f-b687-bfd1d20bfd23",
"name": "SetConversation",
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
1800,
440
]
},
{
"parameters": {
"httpMethod": "POST",
"path": "f735a0b6-5839-491c-bcbd-1fa910e631b8",
"options": {}
},
"id": "ae05eb91-3776-4c80-a2ce-ab2872c4589a",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
-940,
220
]
},
{
"parameters": {
"resource": "audio",
"operation": "transcribe",
"options": {}
},
"id": "0bf0fea6-ea5a-41dd-b13a-95de98e7d458",
"name": "OpenAI",
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1.4,
"position": [
2080,
200
],
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"leftValue": "={{ $('Webhook').item.json.body.data.message.conversation }}",
"rightValue": "@stop",
"operator": {
"type": "string",
"operation": "equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "stop"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "a637b2ac-6c58-496c-a0fe-722e4d74d25f",
"leftValue": "={{ $('Webhook').item.json.body.data.message.conversation }}",
"rightValue": "@start",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "start"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "f5214def-ae82-4f6b-87a7-7a316b586fc8",
"leftValue": "={{ $('Webhook').item.json.body.data.message.conversation }}",
"rightValue": "=^\\d+\\s+(em_preparo|saiu_para_entrega|entregue|finalizado|cancelado)$",
"operator": {
"type": "string",
"operation": "regex"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "update_status"
}
]
},
"options": {}
},
"id": "433af185-d39b-46e8-a924-0a28db1629c5",
"name": "RemoveCliente",
"type": "n8n-nodes-base.switch",
"typeVersion": 3.2,
"position": [
-560,
900
]
},
{
"parameters": {
"operation": "binaryToPropery",
"options": {}
},
"id": "e29c893e-ffd7-4eb2-b318-7c56d7272242",
"name": "Audio-Base64-Extract from File",
"type": "n8n-nodes-base.extractFromFile",
"typeVersion": 1,
"position": [
5620,
900
]
},
{
"parameters": {
"method": "POST",
"url": "={{ $('fields').item.json.evolutiom_api_url }}/message/sendWhatsAppAudio/{{ $('fields').item.json.evolution_instance }}",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "apikey",
"value": "={{ $('fields').item.json.evolution_api_key }}"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "number",
"value": "={{ $('fields').item.json.remoteJid }}"
},
{
"name": "audio",
"value": "={{ $json.data }}"
},
{
"name": "key.fromMe",
"value": "false"
},
{
"name": "options.encoding",
"value": "true"
}
]
},
"options": {}
},
"id": "8fe5ca69-0c77-412b-af54-c129ba2d4495",
"name": "(audio)Evolution API - HTTP Request1",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
5620,
700
]
},
{
"parameters": {
"method": "POST",
"url": "={{ $node[\"fields\"].json[\"evolution_api_url\"] }}/message/sendText/{{ $node[\"fields\"].json[\"evolution_instance\"] }}",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "apikey",
"value": "={{ $node[\"fields\"].json[\"evolution_api_key\"]"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "number",
"value": "={{$node[\"fields\"].json[\"phone\"]}}"
},
{
"name": "text",
"value": "={{ $json.output }}"
}
]
},
"options": {}
},
"id": "29ab7cba-7208-46a3-986e-41f4a4a8a54f",
"name": "Evolution API - HTTP Request",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
5580,
420
]
},
{
"parameters": {},
"id": "92516477-c380-41e8-8d6f-12e113b249f6",
"name": "Merge3",
"type": "n8n-nodes-base.merge",
"typeVersion": 3,
"position": [
5380,
900
]
},
{
"parameters": {
"method": "POST",
"url": "=https://api.elevenlabs.io/v1/text-to-speech/{{ $('fields').item.json.ElevenLabsVozID }}",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
},
{
"name": "xi-api-key",
"value": "={{ $('fields').item.json['ElevenLabsAPI-KEY'] }}"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"text\":\"'{{$('IF-ElevenLabs').item.json.output?.replaceAll('\"',\"\").replaceAll('\\n','').replaceAll('*','').replaceAll('-','').replaceAll(':00',' horas ') }}'\",\n \"model_id\":\"eleven_multilingual_v2\",\n \"voice_settings\":{\n \"stability\":0.5,\n \"similarity_boost\":0.8,\n \"style\":0.0,\n \"use_speaker_boost\":true\n }\n} ",
"options": {}
},
"id": "30547811-e36c-4c1e-9ad7-f11a57c427d0",
"name": "ElevenLabsGenerateVoice",
"type": "n8n-nodes-base.httpRequest",
"position": [
5120,
1060
],
"typeVersion": 4.2
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "906ff569-de44-4bd7-bb17-5691a0dab3e1",
"leftValue": "={{ $('fields').item.json.EnableElevenLabsAPI }}",
"rightValue": "true",
"operator": {
"type": "string",
"operation": "equals"
}
}
],
"combinator": "and"
},
"options": {}
},
"id": "fb0b6a3b-db29-4ae4-9540-88b9192c8b2f",
"name": "IF-ElevenLabs",
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
4760,
1060
]
},
{
"parameters": {
"resource": "audio",
"input": "={{ $json.output }}",
"options": {
"response_format": "mp3"
}
},
"id": "741b62fd-35b8-4fb8-b892-f35962484cb3",
"name": "OpenAI1",
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1.4,
"position": [
5120,
820
],
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"numberInputs": 3
},
"id": "306fbf97-6175-474c-a80b-b75687297fc8",
"name": "Merge2",
"type": "n8n-nodes-base.merge",
"typeVersion": 3,
"position": [
5160,
420
]
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 1
},
"conditions": [
{
"leftValue": "={{ $node[\"fields\"].json[\"type\"] }}",
"rightValue": "conversation",
"operator": {
"type": "string",
"operation": "equals"
},
"id": "8b1224a7-4481-4428-9c91-8b8446c42a56"
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "conversation"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 1
},
"conditions": [
{
"id": "4dfe8b37-6e0e-4c64-84cd-8b2db244b457",
"leftValue": "={ $node[\"fields\"].json[\"type\"] }}",
"rightValue": "extendedTextMessage",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
}
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 1
},
"conditions": [
{
"id": "c42b80d7-89c4-4aa0-9e6c-f4f8804e9e81",
"leftValue": "={{ $node[\"fields\"].json[\"type\"] }}",
"rightValue": "audioMessage",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
}
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 1
},
"conditions": [
{
"id": "175d9f7f-22d4-4cff-b065-277cbbb3dbcc",
"leftValue": "={{ $node[\"fields\"].json[\"type\"] }}",
"rightValue": "ephemeralMessage",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "web"
}
]
},
"options": {
"allMatchingOutputs": true
}
},
"id": "4b62f9e3-a099-42ee-97f1-e6667093a7b9",
"name": "Switch1",
"type": "n8n-nodes-base.switch",
"typeVersion": 3,
"position": [
4740,
420
],
"alwaysOutputData": false
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "6949633a-3ba1-41e6-9213-4c81ed55431c",
"leftValue": "={{ $('fields').item.json.AllWaysReplyText }}",
"rightValue": "true",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"options": {}
},
"id": "0de5e590-0a5d-4eba-9e3a-6f94984ed5da",
"name": "If2",
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
4760,
660
]
},
{
"parameters": {
"content": "# Evolution API\n",
"height": 1040,
"width": 1320
},
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
3080,
300
],
"id": "917377ee-8d2d-464b-9cbb-b9761236cb64",
"name": "Sticky Note2"
},
{
"parameters": {
"content": "# Stop / Start Bot / Atualiza Status Pedido",
"height": 680,
"width": 1000,
"color": 4
},
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-700,
700
],
"id": "a87bdcee-7682-45c3-a25c-ed9f946c1eaf",
"name": "Sticky Note"
},
{
"parameters": {
"operation": "get",
"tableId": "chats",
"filters": {
"conditions": [
{
"keyName": "phone",
"keyValue": "={{ $node[\"fields\"].json[\"phone\"] }}"
},
{
"keyName": "app",
"keyValue": "delivery"
}
]
}
},
"type": "n8n-nodes-base.supabase",
"typeVersion": 1,
"position": [
2920,
1560
],
"id": "083c2a02-a154-4ff3-bbd3-01a48ce82bc2",
"name": "FindPhone",
"alwaysOutputData": true,
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
},
"onError": "continueRegularOutput"
},
{
"parameters": {
"tableId": "chats",
"fieldsUi": {
"fieldValues": [
{
"fieldId": "phone",
"fieldValue": "={{ $('fields').item.json.phone }}"
},
{
"fieldId": "updated_at",
"fieldValue": "={{ $now}}"
},
{
"fieldId": "conversation_id",
"fieldValue": "={{ $('Config').item.json.session_id }}"
},
{
"fieldId": "app",
"fieldValue": "delivery"
}
]
}
},
"type": "n8n-nodes-base.supabase",
"typeVersion": 1,
"position": [
3480,
1440
],
"id": "7374f305-4f77-49bf-90f3-9d75e5191f84",
"name": "AddChat-Supabase",
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "update",
"tableId": "chats",
"filters": {
"conditions": [
{
"keyName": "phone",
"condition": "eq",
"keyValue": "={{ $node[\"fields\"].json[\"phone\"] }}"
}
]
},
"fieldsUi": {
"fieldValues": [
{
"fieldId": "updated_at",
"fieldValue": "={{ $now }}"
}
]
}
},
"type": "n8n-nodes-base.supabase",
"typeVersion": 1,
"position": [
3480,
1680
],
"id": "f344086a-569b-4b1a-a953-cc06ce7c8bb9",
"name": "UpdateChat-Supabase",
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {},
"type": "n8n-nodes-base.merge",
"typeVersion": 3,
"position": [
3740,
1560
],
"id": "6e379bda-5121-4cd8-81a3-2273e509d890",
"name": "Merge1"
},
{
"parameters": {
"tableId": "chat_messages",
"fieldsUi": {
"fieldValues": [
{
"fieldId": "phone",
"fieldValue": "={{ $json.phone }}"
},
{
"fieldId": "conversation_id",
"fieldValue": "={{ $json.phone }}"
},
{
"fieldId": "bot_message",
"fieldValue": "={{ $('Agendamento AI').item.json.output }}"
},
{
"fieldId": "user_message",
"fieldValue": "={{ $('Config').item.json.text }}"
},
{
"fieldId": "message_type",
"fieldValue": "={{ $('fields').item.json.type }}"
}
]
}
},
"type": "n8n-nodes-base.supabase",
"typeVersion": 1,
"position": [
3980,
1560
],
"id": "af1e09d5-520f-47b6-8e71-3f6f1085c005",
"name": "CreateMessage-Supabase",
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "defac08a-6745-422b-bb05-90da9f47d91b",
"leftValue": "={{ $('FindPhone').last().json.values() }}",
"rightValue": "",
"operator": {
"type": "array",
"operation": "empty",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
3240,
1560
],
"id": "e76a1c47-941e-43a5-bca7-92a734ab2c15",
"name": "If3"
},
{
"parameters": {
"content": "# Hist\u00f3rico SupaBase",
"height": 520,
"width": 1400,
"color": 4
},
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
2780,
1360
],
"id": "794a91a0-b32e-488e-a30e-504fc9b1edc1",
"name": "Sticky Note3"
},
{
"parameters": {
"operation": "getAll",
"tableId": "chats",
"filters": {
"conditions": [
{
"keyName": "app",
"condition": "eq",
"keyValue": "delivery"
},
{
"keyName": "updated_at",
"condition": "gt",
"keyValue": "={{ $now.plus(5,'minutes') }}"
}
]
}
},
"type": "n8n-nodes-base.supabase",
"typeVersion": 1,
"position": [
1740,
2380
],
"id": "5a12a89e-fdcd-4854-90fd-db7cdf726a28",
"name": "ListChats-Supabase",
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"aggregate": "aggregateAllItemData",
"destinationFieldName": "conversas",
"include": "specifiedFields",
"fieldsToInclude": "id,message_type,created_at,user_message, bot_message,phone, conversation_id",
"options": {}
},
"type": "n8n-nodes-base.aggregate",
"typeVersion": 1,
"position": [
2340,
2260
],
"id": "5acb6575-9e32-49d8-9908-90f6cf341c04",
"name": "Aggregate"
},
{
"parameters": {
"operation": "getAll",
"tableId": "chat_messages",
"matchType": "allFilters",
"filters": {
"conditions": [
{
"keyName": "phone",
"condition": "eq",
"keyValue": "={{ $json.phone }}"
},
{
"keyName": "active",
"condition": "eq",
"keyValue": "true"
}
]
}
},
"type": "n8n-nodes-base.supabase",
"typeVersion": 1,
"position": [
2340,
2000
],
"id": "ea46dff7-d058-44e3-9dc8-8724bcc55793",
"name": "ListMessages-Supabase",
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"jsCode": "return $('Aggregate').all().map(item => {\n // Tenta acessar a propriedade 'conversas' e verifica se ela \u00e9 um array\n const conversas = item.json.conversas || []; // Garante que \u00e9 pelo menos um array vazio\n\n if (!Array.isArray(conversas)) {\n throw new Error(\"A propriedade 'conversas' n\u00e3o \u00e9 um array.\");\n }\n\n // Processa cada conversa e verifica as mensagens\n const textoUnico = conversas.map(conversa => {\n const cliente = conversa.user_message || \"sem mensagem do chatbot\";\n const agente = conversa.bot_message || \"sem resposta\";\n \n // Verifica se a data existe e formata\n const dataOriginal = conversa.created_at || \"Data da Mensagem indispon\u00edvel\";\n const dataFormatada = dataOriginal !== \"Data da Mensagem indispon\u00edvel\"\n ? formatarData(dataOriginal)\n : dataOriginal;\n\n return `em: ${dataFormatada}\\n\\n - agente(chatbot): ${agente} \\n - cliente: ${cliente}\\n`;\n }).join('\\n\\n');\n\n // Retorna o texto final como resultado\n return {\n json: {\n texto: textoUnico\n }\n };\n});\n\n// Fun\u00e7\u00e3o para formatar a data\nfunction formatarData(dataString) {\n const data = new Date(dataString); // Converte a string em objeto Date\n if (isNaN(data)) {\n return \"Data inv\u00e1lida\"; // Retorna se a data n\u00e3o for v\u00e1lida\n }\n \n // Formata no padr\u00e3o DD/MM/YYYY HH:mm\n const dia = String(data.getDate()).padStart(2, '0');\n const mes = String(data.getMonth() + 1).padStart(2, '0'); // M\u00eas come\u00e7a em 0\n const ano = data.getFullYear();\n const horas = String(data.getHours()).padStart(2, '0');\n const minutos = String(data.getMinutes()).padStart(2, '0');\n \n return `${dia}/${mes}/${ano} ${horas}:${minutos}`;\n}\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
2340,
2480
],
"id": "f81dbdaf-323b-4dab-ba81-f42ff3793ab5",
"name": "Code1"
},
{
"parameters": {
"promptType": "define",
"text": "=# Voc\u00ea \u00e9 um agente facilitador de vendas e est\u00e1 buscando conversas n\u00e3o finalizadas entre o cliente e um agent de IA. \n\n# Cria a responda apenas a resposta n\u00e3o precisa justificar sua resposta\n\n# Identifique o cliente n\u00e3o enviou mais mensagens de resposta\n\n# Se o cliente n\u00e3o responder mesmo assim, agrade\u00e7a e diga que ir\u00e1 encerrar o pedido e est\u00e1 a disposi\u00e7\u00e3o para outros pedidos\n\n# Use frase simples e naturais como nos exemplos\n\nExemplos : \n - 'Oi .. ainda est\u00e1 ai'\n - 'E ai ? vamos finalizar o pedido?' \n\n# Conversa entre o cliete e o agente de IA:\n{{ $json.texto }}"
},
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"typeVersion": 1.5,
"position": [
3040,
2000
],
"id": "3aacc469-cd21-436f-9074-7ebfee2b33cf",
"name": "Basic LLM Chain"
},
{
"parameters": {
"inputText": "={{ $json.texto }}",
"categories": {
"categories": [
{
"category": "pendente_resposta",
"description": "A conversa est\u00e1 pendente devido a uma informa\u00e7\u00e3o que o cliente ficou de fornecer ou confirmar"
},
{
"category": "encerrada",
"description": "Houve um desfecho da conversa e o agente de IA se despediu"
},
{
"category": "sem_resposta",
"description": "=Se o cliente n\u00e3o respondeu mais as mensagens do agente - mensagem do cliente vazia"
}
]
},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.textClassifier",
"typeVersion": 1,
"position": [
2680,
2160
],
"id": "0d718e08-bb60-4ff9-bba4-51a87ef9e336",
"name": "Text Classifier"
},
{
"parameters": {
"tableId": "chat_messages",
"fieldsUi": {
"fieldValues": [
{
"fieldId": "phone",
"fieldValue": "={{ $('Aggregate').item.json.conversas.last().phone }}"
},
{
"fieldId": "conversation_id",
"fieldValue": "={{ $('Aggregate').item.json.conversas.last().phone }}"
},
{
"fieldId": "message_type",
"fieldValue": "={{ $('Aggregate').item.json.conversas.last().message_type }}"
},
{
"fieldId": "bot_message",
"fieldValue": "={{ $json.text }}"
}
]
}
},
"type": "n8n-nodes-base.supabase",
"typeVersion": 1,
"position": [
3460,
2160
],
"id": "66a81f2c-d47b-45ec-a2e4-f361968c8dd1",
"name": "Supabase",
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"options": {}
},
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 3,
"position": [
2040,
2000
],
"id": "955723d6-37ed-4b28-a4b4-eefcae37a5df",
"name": "Loop Over Items1"
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1,
"position": [
2740,
2000
],
"id": "485e66f2-e666-41f5-b2a3-16ad06c66206",
"name": "OpenAI Chat Model2",
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1,
"position": [
2760,
2340
],
"id": "1454b434-372c-4e0d-a77e-a41f71e3c5ff",
"name": "OpenAI Chat Model3",
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {},
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
3480,
2520
],
"id": "ac7c55e6-1a6c-46bc-b856-5a3726083aeb",
"name": "Wait1"
},
{
"parameters": {
"rule": {
"interval": [
{
"field": "minutes"
}
]
}
},
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.2,
"position": [
1720,
2020
],
"id": "d4804b52-c339-4f8c-be0f-a7e3c2a9504f",
"name": "Schedule Trigger",
"disabled": true
},
{
"parameters": {
"operation": "update",
"tableId": "chat_messages",
"filters": {
"conditions": [
{
"keyName": "phone",
"condition": "eq",
"keyValue": "={{ $('Aggregate')?.item?.json?.conversas?.last()?.phone }}"
}
]
},
"fieldsUi": {
"fieldValues": [
{
"fieldId": "active",
"fieldValue": "false"
}
]
}
},
"type": "n8n-nodes-base.supabase",
"typeVersion": 1,
"position": [
2760,
2480
],
"id": "26ec3edc-aab3-444c-9e37-5ee2c9544206",
"name": "DisableMessage-Supabase",
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"content": "# Follow UP\n",
"height": 840,
"width": 2580,
"color": 4
},
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
1600,
1940
],
"id": "f772c018-b8ea-4b41-bde6-e48d6755d2c8",
"name": "Sticky Note5"
},
{
"parameters": {
"method": "POST",
"url": "={{ $json.evolution_api_url }}/message/sendText/{{ $json.evolution_api_instance }}",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "apikey",
"value": "={{ $json.evolution_api_key }}"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "number",
"value": "={{ $json.phone }}"
},
{
"name": "text",
"value": "={{ $json.output }}"
}
]
},
"options": {}
},
"id": "3fb42ec4-8bfd-400e-bcf0-0d0fbc59e969",
"name": "Evolution API - HTTP Request1",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
3920,
2000
]
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "c9c00627-84a9-49a9-bc7e-d923a5918346",
"name": "output",
"value": "={{ $json.text }}",
"type": "string"
},
{
"id": "1e57eb87-d78f-424b-ab84-7738ce384405",
"name": "evolution_api_url",
"value": "---COLOQUE SUA URL ----",
"type": "string"
},
{
"id": "44fd293f-0a32-4499-90fc-bffca5bb524b",
"name": "evolution_api_key",
"value": "---COLOQUE SUA KEY ----",
"type": "string"
},
{
"id": "8fd329d8-2237-4ad3-a496-ee49b5042fc5",
"name": "evolution_api_instance",
"value": "---COLOQUE SUA INSTANCIA ----",
"type": "string"
},
{
"id": "0e34f673-b6dc-4748-89d2-a178dfe91853",
"name": "phone",
"value": "={{ $('Aggregate').item.json.conversas.last().phone }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
3680,
2000
],
"id": "8cb9853f-3135-45fe-8497-9d716bc3192a",
"name": "SetConfig"
},
{
"parameters": {
"operation": "download",
"fileId": {
"__rl": true,
"value": "1vKvNIxMCyv1Dx7prKHNXp43dqSXLn6i5",
"mode": "list",
"cachedResultName": "conhecimento_pizza_boa.txt",
"cachedResultUrl": "https://drive.google.com/file/d/1vKvNIxMCyv1Dx7prKHNXp43dqSXLn6i5/view?usp=drivesdk"
},
"options": {}
},
"type": "n8n-nodes-base.googleDrive",
"typeVersion": 3,
"position": [
460,
2040
],
"id": "444bac22-35d7-49c5-97c4-ffa5b4de2210",
"name": "Google Drive",
"credentials": {
"googleDriveOAuth2Api": {
"n
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.
googleDriveOAuth2ApiopenAiApiredissupabaseApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Bread-Meat-Delivery. Uses lmChatOpenAi, agent, httpRequest, redis. Webhook trigger; 91 nodes.
Source: https://github.com/UanBeiral/restauranteai/blob/cab01e7ff3610c0db81e2a5a2544362c43bd3413/n8n/Bread_Meat_Delivery.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.
Camila IA. Uses postgres, crypto, redis, agent. Webhook trigger; 92 nodes.
Hi! I’m Amanda, a creator of intelligent automations using n8n and Make. I’ve been building AI-powered workflows for over 2 years, always focused on usability and innovation. This one here is very spe
HeyDinastia. Uses executeCommand, httpRequest, youTube, postgres. Webhook trigger; 66 nodes.
This workflow automates customer support across multiple channels (Email, Live Chat, WhatsApp, Slack, Discord) using AI-powered responses enhanced with Retrieval Augmented Generation (RAG) and your pr
This workflow automates multi-channel AI-driven sales engagement for lead qualification, service information delivery, and consultation booking. It integrates WhatsApp, Facebook Messenger, Instagram D