diff --git a/n8n/orcamento-exames-imagem.workflow.json b/n8n/orcamento-exames-imagem.workflow.json index f929d4d..a0758d1 100644 --- a/n8n/orcamento-exames-imagem.workflow.json +++ b/n8n/orcamento-exames-imagem.workflow.json @@ -7,8 +7,8 @@ "parameters": { "httpMethod": "POST", "path": "orcamento-exames-zpro", - "options": {}, - "responseMode": "responseNode" + "responseMode": "responseNode", + "options": {} }, "id": "webhook-orcamento", "name": "Webhook - Foto Exame", @@ -133,8 +133,9 @@ { "parameters": { "model": { + "__rl": true, "mode": "id", - "value": "gpt-4o" + "value": "gpt-5.6-luna" }, "builtInTools": {}, "options": {} @@ -212,17 +213,106 @@ "name": "Simple Memory" }, { + "parameters": { + "respondWith": "text", + "responseBody": "={{ $json.output }}", + "options": {} + }, "id": "responder-webhook", "name": "Responder Webhook (texto)", "type": "n8n-nodes-base.respondToWebhook", "typeVersion": 1.5, "position": [ - 900, + 912, -128 + ] + }, + { + "id": "buscar-ticket-zpro", + "name": "Buscar ticket (Z-PRO)", + "type": "n8n-nodes-base.httpRequest", + "typeVersion": 4.4, + "position": [ + -240, + 160 ], "parameters": { - "respondWith": "text", - "responseBody": "={{ $json.output }}", + "method": "POST", + "url": "https://apigchat.gtigrupo.com.br/v2/api/external/ab2d51db-54e3-48c2-8b97-114a20340809/showticketchatbot", + "authentication": "genericCredentialType", + "genericAuthType": "httpHeaderAuth", + "sendBody": true, + "contentType": "json", + "specifyBody": "json", + "jsonBody": "={{ JSON.stringify({ number: $json.telefone }) }}", + "options": { + "timeout": 15000 + } + }, + "credentials": { + "httpHeaderAuth": { + "id": "8XHGuA4cg9z1jUq8", + "name": "ZPRO API Token - Canal QR - MC AGENDAMENTO" + } + }, + "onError": "continueErrorOutput" + }, + { + "id": "mesclar-dados-ticket", + "name": "Mesclar dados do ticket", + "type": "n8n-nodes-base.set", + "typeVersion": 3.4, + "position": [ + -100, + 160 + ], + "parameters": { + "assignments": { + "assignments": [ + { + "id": "merge-sessionid", + "name": "sessionId", + "type": "string", + "value": "={{ $('Extrair campos do webhook').item.json.sessionId }}" + }, + { + "id": "merge-telefone", + "name": "telefone", + "type": "string", + "value": "={{ $('Extrair campos do webhook').item.json.telefone }}" + }, + { + "id": "merge-nomecontato", + "name": "nomeContato", + "type": "string", + "value": "={{ $('Extrair campos do webhook').item.json.nomeContato }}" + }, + { + "id": "merge-entrada", + "name": "entrada", + "type": "string", + "value": "={{ $('Extrair campos do webhook').item.json.entrada }}" + }, + { + "id": "merge-imagemurl", + "name": "imagemUrl", + "type": "string", + "value": "={{ $('Extrair campos do webhook').item.json.imagemUrl }}" + }, + { + "id": "merge-tipomidia", + "name": "tipoMidia", + "type": "string", + "value": "={{ $('Extrair campos do webhook').item.json.tipoMidia }}" + }, + { + "id": "merge-ticketapiraw", + "name": "ticketApiRaw", + "type": "string", + "value": "={{ JSON.stringify($json) }}" + } + ] + }, "options": {} } } @@ -239,17 +329,6 @@ ] ] }, - "Extrair campos do webhook": { - "main": [ - [ - { - "node": "É mensagem de imagem?", - "type": "main", - "index": 0 - } - ] - ] - }, "É mensagem de imagem?": { "main": [ [ @@ -336,6 +415,46 @@ } ] ] + }, + "Extrair campos do webhook": { + "main": [ + [ + { + "node": "Buscar ticket (Z-PRO)", + "type": "main", + "index": 0 + } + ] + ] + }, + "Buscar ticket (Z-PRO)": { + "main": [ + [ + { + "node": "Mesclar dados do ticket", + "type": "main", + "index": 0 + } + ], + [ + { + "node": "Mesclar dados do ticket", + "type": "main", + "index": 0 + } + ] + ] + }, + "Mesclar dados do ticket": { + "main": [ + [ + { + "node": "É mensagem de imagem?", + "type": "main", + "index": 0 + } + ] + ] } }, "settings": {