{ "name": "IJ - Growth Machine v3.3 - FINAL STABLE", "nodes": [ { "parameters": { "promptType": "define", "text": "={{ $node[\"Code in JavaScript\"].json.user_message }}", "options": { "systemMessage": "# ROLE & IDENTITY\nYou are **Irlanda Já VIP Concierge** - Your mission: Connect Brazilians in Ireland with businesses, professionals, and services from the VIP Database.\n\n**Language:** ALWAYS respond in **Brazilian Portuguese** (informal, helpful, professional tone - like a Brazilian friend helping another).\n\n---\n\n# 🧠 MEMORY & CONTEXT MANAGEMENT\n\n## Rule 1: History Analysis\nALWAYS analyze the last 5 messages in `chat_history` before processing any request.\n\n## Rule 2: Location Logic (Strict Priority)\n\n**a) Explicit:** User mentions city in CURRENT message → Use it.\n - Confirm: \"Certo, buscando em [cidade]...\"\n\n**b) Implicit:** No city NOW + city found in `chat_history` → Use historical city.\n - Confirm implicitly: \"Encontrei em **Dublin**...\"\n\n**c) Missing:** No city anywhere → Ask:\n - \"Em qual cidade você gostaria de buscar?\"\n\n## Rule 3: Context Changes\n- \"agora em Cork\" → Switch to Cork\n- \"e em Galway?\" → Switch to Galway\n- \"outra cidade\" → Ask which city\n- \"lá\"/\"aí\"/\"essa cidade\" → Use last known city\n- City outside Ireland (e.g., \"London\") → \"Só tenho base VIP na Irlanda. Posso ajudar com Dublin, Cork, Galway, Limerick?\"\n\n---\n\n# 🔎 SEARCH INTELLIGENCE (CORE)\n\n## Silent Fallback Protocol\n**NEVER** say \"não encontrei\" without trying ALL relevant categories first.\n- Execute searches internally without narrating attempts\n- Only report failure after exhausting all category options\n\n## Translation Rule (CRITICAL)\nDatabase is in **English**. MUST translate Portuguese → English before tool calls.\n\n**Examples:**\n- \"Cabeleireiro\" → \"hairdresser\" OR \"hair salon\"\n- \"Restaurante brasileiro\" → \"brazilian restaurant\"\n- \"Advogado trabalhista\" → \"employment lawyer\"\n\n**Translation Protocol:**\n- Keep location names in English (Dublin, Cork, Galway)\n- Preserve adjectives: \"barato\" → \"cheap\"/\"affordable\"\n- Always format: `[keyword] [city]` (e.g., \"italian restaurant Dublin\")\n- Expand with synonyms when possible\n\n---\n\n# 🗺️ THEME CLASSIFICATION & FALLBACK MAP\n\n## Step 1: Identify THEME + INTENT\n\nAnalyze user message to determine:\n1. **THEME** (category domain)\n2. **INTENT** (action: buy/sell/repair/hire/attend)\n\nThen follow the exact search order below. **Stop as soon as you find results.**\n\n---\n\n### 💇‍♀️ BEAUTY & AESTHETICS\n**Keywords:** cabelo, cabeleireiro, barbeiro, salão, manicure, pedicure, massagem, estética, maquiagem, sobrancelha, depilação\n\n**Search Order:**\n1. `places` → Salons, Barbershops\n2. `doctors` → Individual Professionals (e.g., \"Ana Hairdresser\")\n3. `servicios` → Home services\n4. `products` → Used equipment\n\n**Synonyms:** cabeleireiro ↔ hairdresser, hair salon | barbeiro ↔ barber, barbershop\n\n---\n\n### 🏥 HEALTH & WELLNESS\n**Keywords:** médico, dentista, psicólogo, fisioterapeuta, nutricionista, terapeuta, clínica\n\n**Search Order:**\n1. `doctors` → Healthcare Professionals\n2. `places` → Clinics, Hospitals\n3. `servicios` → Home healthcare\n\n**Synonyms:** médico ↔ doctor, physician | dentista ↔ dentist | psicólogo ↔ psychologist\n\n---\n\n### 🚗 AUTOMOTIVE\n**Keywords:** mecânico, oficina, carro, moto, peças, conserto, funilaria, pintura\n\n**INTENT Detection:**\n- **IF** intent = BUY/SELL (keywords: comprar, vender, trocar, alugar)\n - Search: `cars` → Vehicle classifieds\n\n- **IF** intent = REPAIR/MAINTENANCE (keywords: consertar, arrumar, barulho, revisão)\n - Search Order:\n 1. `places` → Garages, Auto shops\n 2. `doctors` → Specialist mechanics\n 3. `servicios` → Mobile mechanics\n\n**Synonyms:** mecânico ↔ mechanic, auto repair | oficina ↔ garage, workshop\n\n---\n\n### 🍔 FOOD & DRINK\n**Keywords:** restaurante, comida, pizza, café, padaria, lanchonete, bar, pub\n\n**Search Order:**\n1. `places` → Restaurants, Cafés, Pubs\n2. `servicios` → Catering, Private chefs\n3. `products` → Used kitchen equipment\n\n**Synonyms:** restaurante ↔ restaurant | café ↔ café, coffee shop | padaria ↔ bakery\n\n---\n\n### 🏠 HOME & CONSTRUCTION\n**Keywords:** encanador, eletricista, pintor, pedreiro, limpeza, faxina, jardineiro, carpinteiro\n\n**Search Order:**\n1. `servicios` → Service providers\n2. `places` → Established companies\n3. `doctors` → Specialized freelancers\n\n**Synonyms:** encanador ↔ plumber | eletricista ↔ electrician | limpeza ↔ cleaning service\n\n---\n\n### 🎓 EDUCATION & FITNESS\n**Keywords:** professor, aula, curso, inglês, música, dança, academia, personal trainer, escola\n\n**Search Order:**\n1. `places` → Schools, Gyms, Studios\n2. `doctors` → Private tutors, Personal trainers\n3. `servicios` → Home lessons\n\n**Synonyms:** academia ↔ gym, fitness center | professor ↔ teacher, tutor | aula ↔ class, lesson\n\n---\n\n### ⚖️ PROFESSIONAL SERVICES\n**Keywords:** advogado, contador, contabilidade, consultor, tradutor, assessoria, visto, imigração\n\n**Search Order:**\n1. `doctors` → Liberal professionals\n2. `places` → Law firms, Accounting offices\n3. `servicios` → Freelance consultants\n\n**Synonyms:** advogado ↔ lawyer, solicitor | contador ↔ accountant | tradutor ↔ translator\n\n---\n\n### 🛌 ACCOMMODATION\n**Keywords:** hotel, hostel, apartamento, quarto, alugar, vaga, acomodação\n\n**Search Order:**\n1. `stays` → Lodging and housing\n\n**Synonyms:** hotel ↔ hotel | hostel ↔ hostel | apartamento ↔ apartment, flat\n\n---\n\n### 🛒 BUY & SELL\n**Keywords:** comprar, vender, usado, celular, móveis, eletrônicos, roupas\n\n**INTENT Detection:**\n- **IF** intent = BUY USED ITEM → `products` → Classifieds\n- **IF** intent = BUY FROM STORE → `places` → Physical stores\n\n**Synonyms:** comprar ↔ buy | vender ↔ sell | usado ↔ used, second-hand\n\n---\n\n### 🎉 EVENTS & ENTERTAINMENT\n**Keywords:** show, festa, encontro, workshop, festival, teatro, balada\n\n**Search Order:**\n1. `events` → Cultural calendar\n\n**Synonyms:** festa ↔ party | show ↔ concert, show | festival ↔ festival\n\n---\n\n# 🔄 EXECUTION WORKFLOW\n\n### Step-by-Step Protocol:\n\n1. **Analyze chat_history** → Extract context (city, previous searches)\n2. **Detect city** → Apply Location Logic (Rule 2)\n3. **Identify THEME** → Match keywords to theme map\n4. **Determine INTENT** → Buy/sell vs. repair/hire\n5. **Translate to English** → Keyword + synonyms + city\n6. **Execute search** → Follow theme's category order\n7. **Silent fallback** → If zero results, try next category automatically\n8. **Format response** → Portuguese, structured, max 5 results\n\n**Do NOT narrate attempts.** Only show final consolidated result.\n\n---\n\n# 📤 OUTPUT FORMAT\n\n## ✅ When Results Found:\nEncontrei [X] opções de [service/product] em [City]:\n\n1. [Business Name]\n[IF Rating > 0: ⭐ [Rating] ([Count] avaliações)]\n[IF Rating = 0 OR Empty: 🆕 Novo! Seja o primeiro a avaliar]\n🔗 [URL]\nDescrição: [Brief description]\n\n2. [Business Name]\n[IF Rating > 0: ⭐ [Rating] ([Count] avaliações)]\n[IF Rating = 0 OR Empty: 🆕 Novo! Seja o primeiro a avaliar]\n🔗 [URL]\nDescrição: [Brief description]\n\n**If many results (>5):** Choose top 5 by rating/relevance and say:\n- \"Encontrei várias opções, selecionei as melhores para você...\"\n\n---\n\n## ❌ When NO Results (after ALL categories tried):\nNão encontrei [service/product] cadastrado em [City] na nossa base VIP no momento.\nAlternativas:\nPosso buscar em outra cidade próxima (Cork, Galway, Limerick)?\nGostaria de ajuda com algum serviço relacionado?\nSe conhece um negócio que deveria estar aqui, peça para se cadastrarem no Irlanda Já!\n\n---\n\n# 🎯 EDGE CASES\n\n**Generic request:**\n- User: \"Quero um profissional\"\n- Response: \"Que tipo de profissional? Por exemplo: médico, advogado, professor, mecânico...\"\n\n**Non-existent category:**\n- User: \"Preciso de um exorcista\"\n- Response: \"Não tenho essa categoria específica, mas posso buscar apoio psicológico ou acompanhamento espiritual. O que prefere?\"\n\n**Multiple cities in one message:**\n- User: \"Barbeiro em Dublin ou Cork\"\n- Action: Search Dublin first (first mentioned)\n- Response: \"Encontrei em Dublin. Gostaria de ver opções em Cork também?\"\n\n**City outside Ireland:**\n- \"No momento só tenho base VIP na Irlanda. Posso ajudar com Dublin, Cork, Galway, Limerick?\"\n\n---\n\n# 🎯 COMMUNICATION STYLE\n\n- **Language:** Brazilian Portuguese ONLY\n- **Tone:** Friendly, direct, informal (não grosseiro)\n- **Approach:** Like a Brazilian friend helping another in Ireland\n- **Avoid:** Technical jargon, overly formal language, English terms in user-facing text\n\n---\n\n# ✅ FINAL CHECKLIST (Before Every Response)\n\n1. ✅ Checked chat_history (last 5 messages)?\n2. ✅ Identified city (explicit/implicit/ask)?\n3. ✅ Determined THEME + INTENT?\n4. ✅ Translated to English for tool call?\n5. ✅ Tried ALL relevant categories (silent fallback)?\n6. ✅ Applied Rating Logic (Star vs \"Novo\")?\n7. ✅ Response in Portuguese, structured, max 5 items?" } }, "type": "@n8n/n8n-nodes-langchain.agent", "typeVersion": 3.1, "position": [ 512, 0 ], "id": "3ce89f71-9ba4-4e96-bd5d-4a0e5821d83a", "name": "AI Agent" }, { "parameters": { "model": { "__rl": true, "value": "gpt-4.1-mini", "mode": "list", "cachedResultName": "gpt-4.1-mini" }, "builtInTools": {}, "options": {} }, "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "typeVersion": 1.3, "position": [ 384, 224 ], "id": "5a17a038-5aa3-4b37-84a6-50a61f010b60", "name": "OpenAI Chat Model", "credentials": { "openAiApi": { "id": "DYMD6RBn20WzKM4e", "name": "OpenAi account" } } }, { "parameters": { "endpointUrl": "https://irlandaja.com/wp-json/flowmattic/v1/mcp-server/25b5a176-8c56-499d-b615-3536396bd058/sse", "serverTransport": "sse", "authentication": "headerAuth", "options": {} }, "type": "@n8n/n8n-nodes-langchain.mcpClientTool", "typeVersion": 1.2, "position": [ 688, 224 ], "id": "cb7354f2-288a-4f0a-b35a-79dbd79e332a", "name": "MCP Client", "credentials": { "httpHeaderAuth": { "id": "HyAthED3b1PgJPKy", "name": "Header Auth account" } } }, { "parameters": { "sessionIdType": "customKey", "sessionKey": "={{ $(\"Code in JavaScript\").first().json.session_id }}", "sessionTTL": 1800 }, "type": "@n8n/n8n-nodes-langchain.memoryRedisChat", "typeVersion": 1.5, "position": [ 544, 224 ], "id": "95592749-3a94-4e47-b37e-8f4a83e54e41", "name": "Redis Chat Memory", "credentials": { "redis": { "id": "laHpbBXpdQ8Psk5J", "name": "Redis account" } } }, { "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict", "version": 3 }, "conditions": [ { "id": "46861601-dd97-453f-a686-fe17ac9e87a1", "leftValue": "={{ $json.body.event }}", "rightValue": "message_created", "operator": { "type": "string", "operation": "equals" } }, { "id": "ba1e41d9-9251-4e7a-a34e-6ca7e02a5e1e", "leftValue": "={{ $json.body.message_type }}", "rightValue": "incoming", "operator": { "type": "string", "operation": "equals", "name": "filter.operator.equals" } } ], "combinator": "and" }, "options": {} }, "type": "n8n-nodes-base.if", "typeVersion": 2.3, "position": [ 160, 0 ], "id": "337b2f02-b9bd-4156-ac93-32fc3de10113", "name": "If" }, { "parameters": { "jsCode": "// Lead AI Architect - Estrutura Corrigida para Chatwoot\nconst msg = $json.body;\n\nreturn [\n {\n json: {\n chat_id: msg.conversation ? msg.conversation.id : (msg.conversation_id || msg.id || 0),\n user_message: msg.content || \"\",\n user_name: (msg.sender && msg.sender.name) ? msg.sender.name : 'Usuário',\n user_phone: (msg.sender && msg.sender.phone_number) ? msg.sender.phone_number : '000',\n session_id: `chatwoot_conv_${msg.conversation ? msg.conversation.id : (msg.id || 0)}`\n }\n }\n];" }, "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 320, 0 ], "id": "32f58029-c046-4ad4-a0d7-1f54c781b269", "name": "Code in JavaScript" }, { "parameters": { "method": "POST", "url": "=https://atendimento.creatizo.com/api/v1/accounts/2/conversations/{{ $('Code in JavaScript').item.json.chat_id }}/messages", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "api_access_token", "value": "b6cy54xrHL5GvA5U5kzHHY4L" } ] }, "sendBody": true, "bodyParameters": { "parameters": [ { "name": "content", "value": "={{ $json.final_text }}" }, { "name": "message_type", "value": "outgoing" } ] }, "options": {} }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.3, "position": [ 1072, 0 ], "id": "28bfc5a1-0bd4-41e6-87a2-ec865f97781f", "name": "HTTP Request" }, { "parameters": { "httpMethod": "POST", "path": "chatwoot-trigger", "options": {} }, "type": "n8n-nodes-base.webhook", "typeVersion": 2.1, "position": [ 0, 0 ], "id": "7b6cf706-4c5c-4fed-8b9b-76c3831ccf49", "name": "Webhook", "webhookId": "04abdae7-c1d3-48e4-97f7-7d875d3c1616" }, { "parameters": { "jsCode": "// SWITCHY INTEGRATION & SLUG GENERATOR + VISUAL CLEANUP\nconst outputText = items[0].json.output || items[0].json.text || \"\";\nconst userData = $(\"Code in JavaScript\").first().json;\n\n// --- CONFIGURATION ---\nconst SWITCHY_API_KEY = \"1c0dccfb-f8c5-413d-950a-15a8340a8900\"; \nconst DOMAIN = \"e.irlanda.vc\";\nconst TARGET_HOST = \"irlandaja.com\";\n\n// --- SLUG LOGIC ---\nlet namePart = (userData.user_name || \"User\").replace(/[^a-zA-Z]/g, '').substring(0, 2).toUpperCase();\nif (namePart.length < 2) namePart = namePart.padEnd(2, 'X');\nlet phonePart = (userData.user_phone || \"0\").replace(/\\D/g, '').slice(-1);\nconst randomPart = Math.random().toString(36).substring(2, 5).toUpperCase();\nconst slugBase = `${namePart}${phonePart}${randomPart}`;\n\n// --- LINK DETECTION ---\nconst urlRegex = /(https?:\\/\\/[^\\s\\)]+)/g;\nconst linksFound = outputText.match(urlRegex) || [];\n// Filtra apenas links que contêm o host alvo (irlandaja.com)\nconst targetLinks = linksFound.filter(link => link.includes(TARGET_HOST));\n\n// Se não houver links para encurtar, retorna o texto limpo\nif (targetLinks.length === 0) {\n let cleanedText = outputText\n .replace(/\\[Link\\]\\((.*?)\\)/g, '$1') // Remove [Link](url) -> url\n .replace(/\\[Link\\]/g, '') // Remove palavra solta [Link]\n .replace(/\\((https?:\\/\\/.*?)\\)/g, ' $1') // Remove parenteses (https://...)\n .replace(/🔗\\s*/g, '🔗 ') // Fix emoji\n .replace(/ +/g, ' '); // Remove espaços duplos\n \n return [{ json: { final_text: cleanedText, links_generated: [], status: \"No links to shorten\", raw_output: outputText } }];\n}\n\n// --- SWITCHY API CALLS ---\nlet finalMessage = outputText;\nlet generatedLinks = [];\n\ntry {\n const promises = targetLinks.map(async (longUrl, index) => {\n const slug = `${slugBase}${index > 0 ? index : ''}`; \n const body = {\n link: {\n url: longUrl,\n domain: DOMAIN,\n id: slug,\n tags: [\"whatsapp-bot\", userData.session_id]\n }\n };\n try {\n const response = await this.helpers.httpRequest({\n method: 'POST',\n url: 'https://api.switchy.io/v1/links/create',\n headers: {\n 'Content-Type': 'application/json',\n 'Api-Authorization': SWITCHY_API_KEY\n },\n body: JSON.stringify(body),\n json: true\n });\n const shortUrl = `https://${DOMAIN}/${slug}`;\n return { long: longUrl, short: shortUrl, success: true };\n } catch (error) {\n return { long: longUrl, error: error.message, success: false };\n }\n });\n\n const results = await Promise.all(promises);\n \n // Substitui os links longos pelos curtos\n results.forEach(res => {\n if (res.success) {\n finalMessage = finalMessage.replace(res.long, res.short);\n generatedLinks.push(res.short);\n }\n });\n\n // --- LIMPEZA VISUAL FINAL (A Parte Nova) ---\n finalMessage = finalMessage\n .replace(/\\[Link\\]\\((.*?)\\)/g, '$1') // Remove markdown [Link](url) mantendo a url\n .replace(/\\[Link\\]/g, '') // Remove a palavra [Link] se sobrou\n .replace(/\\((https?:\\/\\/.*?)\\)/g, ' $1') // Remove parenteses em volta de links\n .replace(/🔗\\s*/g, '🔗 ') // Garante espaço após o emoji\n .replace(/ +/g, ' '); // Remove espaços duplos acidentais\n\n} catch (err) {\n return [{ json: { final_text: outputText, error: err.message, links_generated: [], raw_output: outputText } }];\n}\n\nreturn [{ \n json: { \n final_text: finalMessage, \n links_generated: generatedLinks.join(\", \"),\n raw_output: outputText\n } \n}];" }, "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 800, 0 ], "id": "ec393da2-f69d-43d6-a1f7-2126c4518d9d", "name": "Link Processor & Shortener" }, { "parameters": { "authentication": "serviceAccount", "operation": "append", "documentId": { "__rl": true, "mode": "url", "value": "https://docs.google.com/spreadsheets/d/1aKzqDhjLMlfwVs16UUPH0BTCN3RbUSnpjWSUB2BPfr8/edit?usp=sharing" }, "sheetName": { "__rl": true, "mode": "name", "value": "RAW_CONVERSATIONS" }, "columns": { "mappingMode": "defineBelow", "value": { "timestamp": "={{ $now.format('dd/MM/yyyy HH:mm:ss') }}", "dia_semana": "={{ $now.format('cccc', { locale: 'pt-BR' }) }}", "hora": "={{ $now.format('H') }}", "session_id": "={{ $('Code in JavaScript').item.json.session_id || \"no_session_\" + $now.format('x') }}", "user_name": "={{ $('Code in JavaScript').item.json.user_name || \"Visitante Anônimo\" }}", "user_phone": "={{ $('Code in JavaScript').item.json.user_phone || \"Não Identificado\" }}", "user_message": "={{ $('Code in JavaScript').item.json.user_message || \"(Mensagem Vazia/Mídia)\" }}", "cidade_contexto": "Gerenciado por IA", "ai_response_preview": "={{ $('Link Processor & Shortener').item.json.final_text }}", "link_curto_switchy": "={{ $('Link Processor & Shortener').item.json.links_generated || \"Nenhum link gerado\" }}", "status": "={{ $('Link Processor & Shortener').item.json.final_text && $('Link Processor & Shortener').item.json.final_text.includes(\"Não localizei\") ? \"❌ Gap\" : ($('Link Processor & Shortener').item.json.links_generated && $('Link Processor & Shortener').item.json.links_generated.length > 0 ? \"✅ Conversão\" : ($('Link Processor & Shortener').item.json.final_text ? \"💬 Diálogo\" : \"⚠️ Erro Técnico\")) }}", "utm_campaign": "vip_organic" }, "matchingColumns": [ "id" ], "schema": [ { "id": "timestamp", "displayName": "timestamp", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "dia_semana", "displayName": "dia_semana", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "hora", "displayName": "hora", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "session_id", "displayName": "session_id", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "user_name", "displayName": "user_name", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "user_phone", "displayName": "user_phone", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "user_id_hash", "displayName": "user_id_hash", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "conversation_turn", "displayName": "conversation_turn", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "user_message", "displayName": "user_message", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "cidade_contexto", "displayName": "cidade_contexto", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "cidade_explicita", "displayName": "cidade_explicita", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "categoria_detectada", "displayName": "categoria_detectada", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "post_type_usado", "displayName": "post_type_usado", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "keywords_en", "displayName": "keywords_en", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "qtd_resultados", "displayName": "qtd_resultados", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "status", "displayName": "status", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "melhor_resultado_nome", "displayName": "melhor_resultado_nome", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "melhor_resultado_rating", "displayName": "melhor_resultado_rating", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "link_original", "displayName": "link_original", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "link_curto_switchy", "displayName": "link_curto_switchy", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "utm_campaign", "displayName": "utm_campaign", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "ai_response_preview", "displayName": "ai_response_preview", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "ai_response_length", "displayName": "ai_response_length", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "processing_time_ms", "displayName": "processing_time_ms", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "id", "displayName": "id", "required": false, "defaultMatch": true, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "content", "displayName": "content", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "inbox_id", "displayName": "inbox_id", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "conversation_id", "displayName": "conversation_id", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "message_type", "displayName": "message_type", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "content_type", "displayName": "content_type", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "content_attributes", "displayName": "content_attributes", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "created_at", "displayName": "created_at", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "private", "displayName": "private", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "source_id", "displayName": "source_id", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "sender", "displayName": "sender", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false } ], "attemptToConvertTypes": false, "convertFieldsToString": false }, "options": {} }, "type": "n8n-nodes-base.googleSheets", "typeVersion": 4.5, "position": [ 1280, 0 ], "id": "f1d6ad65-27c0-4f93-8807-2fbaae3a4add", "name": "Google Sheets - Growth Machine", "credentials": { "googleApi": { "id": "eZeLFieqsks9c5wv", "name": "Google Service Account account" } } }, { "parameters": { "method": "GET", "url": "https://irlandaja.com/wp-json/mcp/v1/availability", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "post_id", "value": "={{ $fromAI(\"post_id\") }}" } ] }, "name": "check_availability", "description": "Ferramenta para verificar disponibilidade de agenda/horários. Use quando o usuário perguntar 'tem vaga?', 'horários livres' ou 'agenda'. Requer o 'post_id' (numérico) do local." }, "type": "@n8n/n8n-nodes-langchain.toolHttpRequest", "typeVersion": 1.1, "position": [ 688, 420 ], "id": "check-availability-tool-fixed", "name": "Check Availability Tool" } ], "pinData": {}, "connections": { "OpenAI Chat Model": { "ai_languageModel": [ [ { "node": "AI Agent", "type": "ai_languageModel", "index": 0 } ] ] }, "MCP Client": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] }, "Redis Chat Memory": { "ai_memory": [ [ { "node": "AI Agent", "type": "ai_memory", "index": 0 } ] ] }, "If": { "main": [ [ { "node": "Code in JavaScript", "type": "main", "index": 0 } ] ] }, "Code in JavaScript": { "main": [ [ { "node": "AI Agent", "type": "main", "index": 0 } ] ] }, "Link Processor & Shortener": { "main": [ [ { "node": "HTTP Request", "type": "main", "index": 0 } ] ] }, "HTTP Request": { "main": [ [ { "node": "Google Sheets - Growth Machine", "type": "main", "index": 0 } ] ] }, "Webhook": { "main": [ [ { "node": "If", "type": "main", "index": 0 } ] ] }, "Check Availability Tool": { "ai_tool": [ [ { "node": "AI Agent", "type": "ai_tool", "index": 0 } ] ] } }, "active": true, "settings": { "executionOrder": "v1", "availableInMCP": false }, "versionId": "4a6adf95-4a80-42ce-b578-f5e4109a6f9c", "meta": { "instanceId": "f27718e6d8fbb5a70ec93a2fec0c6c4005cda6dd54e8c4501653675381d6a094" }, "id": "fMtyvwykMiYcnl1Do2H7W", "tags": [] }