{ "name": "Send Cold Emails", "nodes": [ { "parameters": {}, "id": "92adb460-72f6-4786-9498-e52abbbb19a7", "name": "Execute Workflow Trigger", "type": "n8n-nodes-base.executeWorkflowTrigger", "typeVersion": 1, "position": [ 520, 160 ] }, { "parameters": { "assignments": { "assignments": [ { "id": "a5d82b77-2608-4e5b-b9ca-5233d81ffe46", "name": "google_url", "value": "=https://www.google.es/maps/search/{{ $('Execute Workflow Trigger').item.json.text }}/@{{ $json.lat }},{{ $json.long }},11z/", "type": "string" }, { "id": "decf4392-4fca-41da-9860-769c260255a8", "name": "user_id", "value": "={{ $('Execute Workflow Trigger').item.json.id }}", "type": "number" } ] }, "options": {} }, "id": "802628d0-9110-4feb-b845-ee4b9e3f511b", "name": "Edit Fields1", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 1100, 440 ], "onError": "continueRegularOutput" }, { "parameters": { "assignments": { "assignments": [ { "id": "a720e109-d885-4dc0-a1bf-3c9173befcce", "name": "lat", "value": "={{ $json.results[0].geometry.lat }}", "type": "number" }, { "id": "6bd8175c-6ed8-423c-84f9-43fd658a1dc1", "name": "long", "value": "={{ $json.results[0].geometry.lng }}", "type": "number" } ] }, "options": {} }, "id": "8fb8797a-b005-41eb-abb2-d5e534169f5c", "name": "Edit Fields", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 1040, 180 ], "onError": "continueRegularOutput" }, { "parameters": { "url": "={{ $json.google_url }}", "options": {} }, "id": "4779601b-4969-4bb7-8a8c-05ce07146dc1", "name": "HTTP Request", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 1280, 260 ], "onError": "continueRegularOutput" }, { "parameters": { "url": "https://api.opencagedata.com/geocode/v1/json", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "key", "value": "c3bac2cf2dc0482697c5468755aaceba" }, { "name": "q", "value": "={{ $json.city }}, España" } ] }, "options": {} }, "id": "73298590-6b61-4a16-a5eb-d94044569ca5", "name": "HTTP Request2", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 820, 420 ], "executeOnce": false, "onError": "continueRegularOutput" }, { "parameters": { "mode": "runOnceForEachItem", "language": "python", "pythonCode": "from bs4 import BeautifulSoup\n\ndata = _input.item.json\n\ntry:\n # Add a new field called 'myNewField' to the JSON of the item\n html_content =_('HTTP Request1').item.json.data\n # Parse the HTML with BeautifulSoup\n soup = BeautifulSoup(html_content, 'html.parser')\n\n # Extract the content of the tag\n title_tag = soup.title\n if title_tag:\n title = title_tag.text\n else:\n #If <title> is not found, search for the first <h1>\n h1_tag = soup.find('h1')\n if h1_tag:\n title = h1_tag.get_text(strip=True)\n else:\n title = \"\"\n\n return {\n \"url\" : data.url,\n \"title\": title,\n \"email\" : data.email\n }\n\nexcept:\n return {\n \"url\" : data.url,\n \"title\": \"\",\n \"email\" : data.email\n }" }, "id": "7714ffa2-6af5-4eef-adc2-36a48725a242", "name": "Code5", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 2540, 280 ], "executeOnce": false, "onError": "continueRegularOutput" }, { "parameters": { "mode": "runOnceForEachItem", "jsCode": "// Add a new field called 'myNewField' to the JSON of the item\nconst htmlString = $input.item.json.data;\n\n// Refined regular expression to match only valid emails and ignore files with extensions\nconst emailRegex = /\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,63}\\b(?!\\.\\w{2,4}\\b)/i;\n\n// Extract all emails\nconst emails = htmlString.match(emailRegex) || [];\n\n// Use a Set to store unique emails\nconst uniqueEmails = [...new Set(emails.map(em=>em.toLowerCase()))].filter(em=>!em.includes(\".png\") && !em.includes(\"sentry\"));\n\nreturn {\n email: uniqueEmails[0],\n url: $('Code3').item.json.url,\n}" }, "id": "9ee9f0a7-9808-460e-93e5-201cfc9100c2", "name": "Code1", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 2360, 280 ], "onError": "continueRegularOutput" }, { "parameters": { "jsCode": "const cities = [ \"Madrid\", \"Barcelona\", \"Valencia\", \"Sevilla\", \"Zaragoza\", \"Málaga\", \"Murcia\", \"Palma\", \"Las Palmas\",\n \"Bilbao\", \"Alicante\", \"Córdoba\", \"Valladolid\", \"Vigo\", \"Gijón\", \"L'Hospitalet\", \"Vitoria-Gasteiz\",\n \"La Coruña\", \"Elche\", \"Granada\", \"Terrassa\", \"Badalona\", \"Oviedo\", \"Cartagena\", \"Jerez de la Frontera\",\n \"Sabadell\", \"Móstoles\", \"Santa Cruz de Tenerife\", \"Alcalá de Henares\", \"Pamplona\", \"Fuenlabrada\",\n \"Almería\", \"Leganés\", \"Donostia-San Sebastián\", \"Santander\", \"Burgos\", \"Castellón de la Plana\", \n \"Alcorcón\", \"Albacete\", \"Getafe\", \"Salamanca\", \"Huelva\", \"Logroño\", \"Badajoz\", \"Tarragona\", \n \"Lleida\", \"Marbella\", \"León\", \"Cádiz\", \"Dos Hermanas\", \"Mataró\", \"Santa Coloma de Gramenet\", \n \"Jaén\", \"Algeciras\", \"Reus\", \"Telde\", \"Barakaldo\", \"San Cristóbal de La Laguna\", \n \"Torrejón de Ardoz\", \"Parla\", \"Lérida\", \"San Fernando\", \"Roquetas de Mar\", \"Torremolinos\", \n \"Talavera de la Reina\", \"Sant Boi de Llobregat\", \"El Ejido\", \"Rivas-Vaciamadrid\", \"Benidorm\", \n \"Torrevieja\", \"Fuengirola\", \"Lugo\", \"Gandía\", \"Ourense\", \"Pozuelo de Alarcón\", \"Ponferrada\", \n \"Orihuela\", \"Mérida\", \"Rubí\", \"San Sebastián de los Reyes\", \"Toledo\", \"Torrelavega\", \n \"Manresa\", \"San Vicente del Raspeig\", \"Fuenlabrada\", \"Calvia\", \"Elda\", \"Alcoy\", \n \"Paterna\", \"Cáceres\", \"Segovia\", \"Ibiza\", \"Alcobendas\", \"Ávila\", \"Melilla\", \"Ceuta\", \n \"Huesca\", \"Cuenca\"];\n\nconst page = $input.first().json.page;\nconst offset = 5 * page;\nreturn cities.sort((a, b) => 0.5 - Math.random()).map(city=>({city})).splice(0+offset,3+offset);" }, "id": "7ecb89bf-801c-49e8-afb6-e05df738e78d", "name": "Code", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 760, 160 ] }, { "parameters": { "method": "POST", "url": "https://acumbamail.com/webhook/incoming/9AW6nxEvJwL0Nt49NDrzPcylauKQxmLPeip/AyN9IshBBPpd1VnQzVqBQA==/", "sendBody": true, "specifyBody": "json", "jsonBody": "={\n \"body\": \"Services they offer\", \n \"to\": \"email@test.com\", \n \"from\": \"Name\", \n \"subject\": \"Place\"\n}", "options": {} }, "id": "747dc7ec-4940-4ce7-8645-2fa7e36daaff", "name": "HTTP Request3", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 3540, 640 ], "onError": "continueRegularOutput" }, { "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict", "version": 2 }, "conditions": [ { "id": "82904921-f797-4186-86ed-4143f1c6ce8e", "leftValue": "={{ $json.title }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } }, { "id": "d1dadcce-7867-419a-8ac8-c36518b50bf3", "leftValue": "={{ $json.email }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } } ], "combinator": "and" }, "options": {} }, "id": "8040daa6-1f90-4ca7-b5ec-4638b93713e2", "name": "If", "type": "n8n-nodes-base.if", "typeVersion": 2.2, "position": [ 2740, 280 ] }, { "parameters": { "method": "POST", "url": "https://api.perplexity.ai/chat/completions", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "Authorization", "value": "Bearer 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" } ] }, "sendBody": true, "specifyBody": "json", "jsonBody": "={\n \"model\": \"llama-3.1-sonar-small-128k-online\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"Be precise and concise. Return the following data: Name of the owner of the enterprise, city where they are,province of spain where this city is,hours and days where they are open/available, name of the enterprise or if not clear name of the site, names of the services they offer, names of the specialities if they have\"\n},\n {\n \"role\": \"user\",\n \"content\": \"{{ $json.url }}\"\n }\n ]\n}", "options": {} }, "id": "ce15eace-29ab-4464-9b5f-16049733e620", "name": "HTTP Request4", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 2140, 1100 ], "executeOnce": false }, { "parameters": { "mode": "runOnceForEachItem", "jsCode": "const data = $json?.choices[0]?.message?.content\n\nreturn {response: data}" }, "id": "2f0ab220-94a1-499d-917e-0246ba28b72b", "name": "Code2", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 2340, 1100 ] }, { "parameters": { "mode": "runOnceForEachItem", "jsCode": "const {body: data} = $json.message.content;\n\nconst trimedData = data.replaceAll(/\\n/g,\"\");\n\nconst body = trimedData;\n\nreturn {body}" }, "id": "6797c092-5340-4974-8343-3a1d7da9489d", "name": "Code4", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 2980, 1100 ] }, { "parameters": { "modelId": { "__rl": true, "value": "gpt-4o-mini", "mode": "list", "cachedResultName": "GPT-4O-MINI" }, "messages": { "values": [ { "content": "=Transform this text to acomplish the json format and language (spanish): \n{\n \"body\": \"body of the email, explained below\", \n \"to\": \"user email\", \n \"from\": \"mail@iactivos.com\", \n \"subject\": \"User complaining about somthing related to not getting attended properly or in time: Te parece normal 30 min de espera en la Recepción de la clínica?\"\n}\n\nFor the cta use these url: https://iactivos.com/asistente-ia-clinicasdentales/\n\nFor the body follow the next structure and remember to replace the replace the text between [] or adjust any necesarry text to be as personal as you can taking account the clinic data:\n\n¿Cuántos pacientes más vas a dejar escapar antes de hacer algo?\n\nHola [Nombre del Responsable],\n\nHe visto que en tu clínica [Nombre de la Clínica] ofreces un servicio excepcional con tratamientos como [aquí mencionamos un servicio destacado de ellos real que sacamos del escrapeo, ejemplo: blanqueamientos y ortodoncia estética con nombre de doctores o algo concreto]. Pero, ¿cuánto tiempo y esfuerzo te cuesta mantener esa calidad en la atención al cliente?\n\nCada día, más clínicas están automatizando la gestión de citas, consultas rápidas sobre tratamientos y recordatorios post-visita. ¿El resultado? Menos tiempo perdido y más pacientes satisfechos.\n\n¿Te imaginas poder atender preguntas y agendar citas mientras tú y tu equipo estáis en consulta? Con nuestro asistente de IA, tu clínica estará disponible 24/7, incluso cuando tú estés descansando.\n\nNuestros clientes han experimentado:\n\nUn 40% más de reservas confirmadas gracias a la respuesta inmediata.\n\nMenos ausencias con recordatorios automáticos y seguimiento post-tratamiento.\n\nMás tiempo libre para tu equipo para centrarse en lo que de verdad importa: el paciente en la consulta.\n\nOtros ya están aprovechando esta ventaja competitiva. No te quedes atrás.\n\nHaz clic aquí y MIRA EL VÍDEO QUE TENEMOS PREPARADO para descubrir cómo tu clínica puede convertirse en la referencia de atención al cliente en tu ciudad.\n\nNos vemos pronto,\nAmalio | Iactivos\n\nPD: Es un ejemplo real de cómo vas a ahorrar cientos de horas y de euros.\n\nPD2: Solo admitimos 5 clínicas dentales por cada ciudad. Si clicas en el enlace, verás por qué.", "role": "system" }, { "content": "={{ $json.response }}" } ] }, "jsonOutput": true, "options": {} }, "id": "bd6d0b97-2dcb-4749-8ace-452e101510f5", "name": "OpenAI1", "type": "@n8n/n8n-nodes-langchain.openAi", "typeVersion": 1.6, "position": [ 3260, 40 ], "credentials": { "openAiApi": { "id": "2sxsZRWeSYFtgt5k", "name": "OpenAi account" } } }, { "parameters": { "modelId": { "__rl": true, "value": "gpt-4o-mini", "mode": "list", "cachedResultName": "GPT-4O-MINI" }, "messages": { "values": [ { "content": "=From the following info, create a subject for an email to grab the attention to the bussines owner, the idea is that the subject looks like a client complaining aboout something related to one of this topics:\n- To much time waiting to be attended\n- Forgotten info or appointment\n- Calling or emailing without response\n- Having an urgency and not been able to acomplish an appointment\nOne example of this can be the following subject:\n- Te parece normal 30 min de espera en la Recepción de la clínica?\nWich looks like a customer complaining about waiting time to be attended.\n- Intenté agendar una cita a las 11 de la noche y no contestaba nadie!\nWich looks like a customer complaining about calling/emailing without response.\n\nFor inspiration, use some data from the business to make it even more realistic:\n{{ $json.response }}\n\n\nRemember to return a json with the property subject as the subject you have choosen" } ] }, "jsonOutput": true, "options": {} }, "id": "16a17d48-2dd6-4d2f-a45f-95a0c2244fde", "name": "Subject", "type": "@n8n/n8n-nodes-langchain.openAi", "typeVersion": 1.6, "position": [ 2620, 1280 ], "credentials": { "openAiApi": { "id": "2sxsZRWeSYFtgt5k", "name": "OpenAi account" } } }, { "parameters": { "mode": "runOnceForEachItem", "jsCode": "const data = $json.message.content;\n\nreturn data" }, "id": "50ee9c69-5fec-40d2-a068-feea7c6c0ea8", "name": "Code6", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 2980, 1260 ] }, { "parameters": { "assignments": { "assignments": [ { "id": "83f79144-cf9d-4b3f-b2a6-fc72edae007e", "name": "body", "value": "={{ $json.body }}", "type": "string" }, { "id": "820fd8a0-358f-450e-8920-70f152d1d607", "name": "subject", "value": "={{ $json.subject }}", "type": "string" } ] }, "options": {} }, "id": "26011754-d2a3-42c6-ae6f-10b08aa43f55", "name": "Edit Fields2", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 3300, 1380 ] }, { "parameters": { "mode": "combineBySql" }, "id": "8f68860b-fbd9-40f6-b62b-0eb86c11b658", "name": "Merge", "type": "n8n-nodes-base.merge", "typeVersion": 3, "position": [ 3180, 1100 ] }, { "parameters": { "modelId": { "__rl": true, "value": "gpt-4o-mini", "mode": "list", "cachedResultName": "GPT-4O-MINI" }, "messages": { "values": [ { "content": "=From the following info, create a body for an email to grab the attention of the bussines owner, the idea is that the body tells him how much his business can improve including a chatbot. Attack or mention some of the following ideas/concepts/fears/concerns to make them realize that they need this ai chatbot solution in their business:\n- Fear of Time and Resource Drain - Time/resource inefficiency\n- Concern Over Missing Out on New Trends (Competitiveness) - Falling behind competitors\n- Fear of Lost Patients Due to Inconvenient Booking/Support Processes - Missed patient acquisition and retention opportunities\n- Desire for Work-Life Balance and Efficiency for the Team - Operational stress and work-life balance\n- Fear of Financial and Opportunity Loss - Financial loss through inefficiency\n- Fear of Scarcity and Missing a Limited Opportunity - Urgency and scarcity, increasing the fear of missing out\n- Desire for a Competitive Edge (Reputation) - Need for a competitive edge and reputation boost\n- Desire for Improved Patient Retention and Loyalty - Interest in patient retention and loyalty\n\nSome examples of this are the following sentences:\n- \"Solo admitimos 5 clínicas dentales por cada ciudad.\" -> Fear of Scarcity and Missing a Limited Opportunity\n- \"Más tiempo libre para tu equipo para centrarse en lo que de verdad importa: el paciente en la consulta.\" -> Desire for Work-Life Balance and Efficiency for the Team\n- \"Cada día, más clínicas están automatizando la gestión de citas, consultas rápidas sobre tratamientos y recordatorios post-visita\" -> Desire for a Competitive Edge (Reputation)\n- \" tú y tu equipo podéis concentraros en lo que mejor hacéis: atender a los pacientes, mientras el chatbot se encarga del resto.\" -> Desire for Work-Life Balance and Efficiency for the Team\n\nIf you need to include advantages of the ai chatbot, it include:\n- Managing calendar (creating, updating and deleting appointments)\n- Sending reminders about appointments\n- Respond faqs (frecuent asqued cuestions)\n- Talking to the customer about the treatments/services that they offer\n- Showing pending appointments\n and there are things that can do are not available for all as the other features:\n- Custom integration with their CRM: this depends on the crm they are using, the can reach us to know if we work with theirs\n- Voice calls: making and receiving automatic calls will be available soon but it still in beta phase, but can be mentioned.\n\nAlso, if needed, you can include some of the social proof based on some data from our clients:\n- 40% more confirmed bookings thanks to immediate responses.\n- Fewer no-shows with automatic reminders and post-treatment follow-up.\n\n\nRemmember to make the email as personalized possible by including the data of the business that has been passed to you and also that this is a cold email directed at dental clinics, promoting an AI assistant (chatbot) that can manage appointments, answer questions, and assist patients 24/7. Use a persuasive, direct style with touches of humor in the style of Isra Bravo—keeping it professional but not too serious. Include metaphors, short phrases, and emphasize the benefits of using this assistant, without being overly aggressive. The goal is to capture attention and spark curiosity, making the recipient want to learn more. Also feel free to address me informally and use 'you' in a casual tone instead of a formal tone.\n\nFor the last messages, do not include any cta (call to action) or good bye message as this will be manually generated.\n\nReturn the hole html body into an json object with the property body and in spanish please", "role": "system" }, { "content": "={{ $json.response }}" } ] }, "jsonOutput": true, "options": {} }, "id": "3988590a-89e8-4cf9-8136-ccb6d62aa73a", "name": "Body", "type": "@n8n/n8n-nodes-langchain.openAi", "typeVersion": 1.6, "position": [ 2640, 1080 ], "credentials": { "openAiApi": { "id": "2sxsZRWeSYFtgt5k", "name": "OpenAi account" } } }, { "parameters": { "workflowId": { "__rl": true, "value": "ookixS03QIjzTHgD", "mode": "list", "cachedResultName": "Create Custom Email From Link" }, "mode": "each", "options": {} }, "id": "4b94d568-0bca-4865-bb4d-bd4d7bbf4e1a", "name": "Execute Workflow", "type": "n8n-nodes-base.executeWorkflow", "typeVersion": 1.1, "position": [ 2980, 280 ] }, { "parameters": { "assignments": { "assignments": [ { "id": "d523af2d-7550-4a3a-ad56-3a8b7299162f", "name": "body", "value": "={{ $json.body }}<img src=\"https://n8n-clientes-edhvg8h4ghgffybd.spaincentral-01.azurewebsites.net/webhook/analiticas?clinica='{{ $('If').item.json.email }}'\" style=\"display:none;\" loading=\"lazy\"/>", "type": "string" }, { "id": "f59dcb8a-9969-4afb-9fa7-7b9dcd194c92", "name": "subject", "value": "={{ $json.subject }}", "type": "string" }, { "id": "6e98c3e4-5604-4a15-9456-94c5fe397797", "name": "url", "value": "={{ $('If').item.json.url }}", "type": "string" }, { "id": "0ff672af-a353-4d61-a9d5-1379f83b2ba9", "name": "title", "value": "={{ $('If').item.json.title }}", "type": "string" }, { "id": "62940512-ab65-45d8-80a5-65fcc7e136be", "name": "email", "value": "={{ $('If').item.json.email }}", "type": "string" }, { "id": "d0fe4907-c102-4cbe-8158-68d2e60ad06a", "name": "cta", "value": "={{ $json.cta }}", "type": "string" } ] }, "options": {} }, "id": "cf334a40-9b40-485c-bb47-e1bdcb9348b1", "name": "Edit Fields3", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 3200, 280 ] }, { "parameters": { "operation": "append", "documentId": { "__rl": true, "value": "1nCZB6b66Wo5TCwA38cZXmanahLltS0V_gKIqC_AOXk8", "mode": "id" }, "sheetName": { "__rl": true, "value": 712573669, "mode": "list", "cachedResultName": "correctos", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1nCZB6b66Wo5TCwA38cZXmanahLltS0V_gKIqC_AOXk8/edit#gid=712573669" }, "columns": { "mappingMode": "defineBelow", "value": { "email": "={{ $('Merge1').item.json.email }}", "title": "={{ $('Merge1').item.json.title }}", "url": "={{ $('Merge1').item.json.url }}" }, "matchingColumns": [], "schema": [ { "id": "email", "displayName": "email", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "title", "displayName": "title", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "url", "displayName": "url", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true }, { "id": "type", "displayName": "type", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true } ] }, "options": {} }, "id": "d6530c4a-e9bd-41e4-b847-821317c7989e", "name": "Google Sheets2", "type": "n8n-nodes-base.googleSheets", "typeVersion": 4.5, "position": [ 3660, 120 ], "credentials": { "googleSheetsOAuth2Api": { "id": "arDPxDRctkFKiJbu", "name": "Google Sheets account" } } }, { "parameters": { "assignments": { "assignments": [ { "id": "53ef2af2-c3cd-4488-b459-980faca49371", "name": "data", "value": "={{ $('Merge1').item.json }}", "type": "object" }, { "id": "878e5b46-bcec-45b1-9dcb-2be3042e1492", "name": "email", "value": "={{ $('Merge1').item.json.email }}", "type": "string" } ] }, "options": {} }, "id": "04352ba3-2d85-46cd-955d-d1663c3c5726", "name": "Edit Fields4", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 3960, 300 ] }, { "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict", "version": 2 }, "conditions": [ { "id": "830d45d8-b06b-4eb0-8028-a3c619265c3d", "leftValue": "={{ $json.email }}", "rightValue": "", "operator": { "type": "string", "operation": "exists", "singleValue": true } } ], "combinator": "and" }, "options": {} }, "id": "be26fe89-5ad9-4fab-9fc5-e9e8fa19eafa", "name": "If1", "type": "n8n-nodes-base.if", "typeVersion": 2.2, "position": [ 3680, 400 ] }, { "parameters": { "fromEmail": "IActivos comunicaciones@iactivos.info", "toEmail": "amalios622@gmail.com", "subject": "Pruebas IACTIVOS", "emailFormat": "text", "text": "Hey, esta es una prueba para iactivos", "options": { "appendAttribution": false } }, "id": "a8a7b43c-98da-47a3-84f4-1555964a456f", "name": "Send Email", "type": "n8n-nodes-base.emailSend", "typeVersion": 2.1, "position": [ 3020, 680 ], "webhookId": "381dc12a-5060-470f-b5c5-dad2afad4394", "credentials": { "smtp": { "id": "oKAWH5CMTVFzaY82", "name": "Cumunicaciones Info" } } }, { "parameters": {}, "id": "5cd71f9a-e017-4ca0-8ab0-c4014752d2f4", "name": "Merge1", "type": "n8n-nodes-base.merge", "typeVersion": 3, "position": [ 3460, 400 ] }, { "parameters": { "url": "={{ $json.url }}", "options": {} }, "id": "e8581cde-921b-44a0-be93-c59b4acfea05", "name": "HTTP Request1", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 2060, 260 ], "alwaysOutputData": true, "executeOnce": false, "onError": "continueRegularOutput" }, { "parameters": { "jsCode": "const htmlData = $('HTTP Request').all().map(d=>d.json.data).join(\" --- \");\n\n// Helper function to check if a URL has only the main domain (no path)\nfunction isMainDomain(url) {\n // Regular expression to match main domain URLs only\n const mainDomainRegex = /^https?:\\/\\/[^\\/]+\\/?$/;\n return mainDomainRegex.test(url);\n}\n\n// Function to extract URLs without \"google\" or \"gstatic\"\nfunction extractUrls(html) {\n // Regular expression to match URLs until the first backslash or whitespace\n const urlRegex = /https?:\\/\\/[^\\s\\\\\"]+/g;\n // Find all URLs in the HTML\n const urls = html.match(urlRegex) || [];\n // Filter out URLs that contain \"google\" or \"gstatic\"\n return urls.filter(url => !/google|ggpht|schema|gstatic/.test(url)&& isMainDomain(url));\n}\n\n// Usage\nconst urlsRaw = extractUrls(htmlData);\nconst urls = Array.from(new Set(urlsRaw));\n\nreturn urls.map(url=>({url})).slice(0,50);" }, "id": "7be5be7b-4363-4ca2-a439-a1d627a4c5b5", "name": "Code3", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 1520, 260 ], "onError": "continueRegularOutput" }, { "parameters": { "operation": "append", "documentId": { "__rl": true, "value": "1nCZB6b66Wo5TCwA38cZXmanahLltS0V_gKIqC_AOXk8", "mode": "id" }, "sheetName": { "__rl": true, "value": "fallados", "mode": "name" }, "columns": { "mappingMode": "autoMapInputData", "value": {}, "matchingColumns": [], "schema": [ { "id": "email", "displayName": "email", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "title", "displayName": "title", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "url", "displayName": "url", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "type", "displayName": "type", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false } ] }, "options": {} }, "id": "3f60b849-6869-47f3-bca1-16eb42624446", "name": "Google Sheets", "type": "n8n-nodes-base.googleSheets", "typeVersion": 4.5, "position": [ 2980, 520 ], "alwaysOutputData": true, "credentials": { "googleSheetsOAuth2Api": { "id": "arDPxDRctkFKiJbu", "name": "Google Sheets account" } } }, { "parameters": { "workflowId": { "__rl": true, "value": "kff6WMbHSgrXX49x", "mode": "list", "cachedResultName": "Mails Ruleta Rusa" }, "mode": "each", "options": {} }, "id": "f1de0efc-cc94-4b52-8565-b0e8b4130b94", "name": "Execute Workflow1", "type": "n8n-nodes-base.executeWorkflow", "typeVersion": 1.1, "position": [ 4260, 20 ], "disabled": true, "onError": "continueRegularOutput" }, { "parameters": { "options": {} }, "type": "n8n-nodes-base.splitInBatches", "typeVersion": 3, "position": [ 1740, 260 ], "id": "5695695d-857c-4815-a7c7-58c25a8c5ce5", "name": "Loop Over Items" }, { "parameters": { "method": "POST", "url": "https://adminweb.onia.digital/api/emails", "sendBody": true, "bodyParameters": { "parameters": [ { "name": "subject", "value": "={{ $json.data.subject }}" }, { "name": "html", "value": "={{ $json.data.body }}{{ $json.data.cta }}" }, { "name": "website", "value": "={{ $json.data.url }}" }, { "name": "email", "value": "={{ $json.data.email }}" } ] }, "options": {} }, "id": "f529997a-4444-41cb-ab8d-ede0acb707f5", "name": "HTTP Request5", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 4220, 300 ], "onError": "continueRegularOutput" }, { "parameters": {}, "type": "n8n-nodes-base.noOp", "typeVersion": 1, "position": [ 1960, 160 ], "id": "e7e6aff5-a748-4ddd-ac0e-163870ab532f", "name": "No Operation, do nothing" } ], "pinData": { "Execute Workflow Trigger": [ { "json": { "text": "clinica dental", "id": "1040056102", "page": 0 } } ] }, "connections": { "Edit Fields1": { "main": [ [ { "node": "HTTP Request", "type": "main", "index": 0 } ] ] }, "Edit Fields": { "main": [ [ { "node": "Edit Fields1", "type": "main", "index": 0 } ] ] }, "HTTP Request": { "main": [ [ { "node": "Code3", "type": "main", "index": 0 } ] ] }, "HTTP Request2": { "main": [ [ { "node": "Edit Fields", "type": "main", "index": 0 } ] ] }, "Code5": { "main": [ [ { "node": "If", "type": "main", "index": 0 } ] ] }, "Code1": { "main": [ [ { "node": "Code5", "type": "main", "index": 0 } ] ] }, "Code": { "main": [ [ { "node": "HTTP Request2", "type": "main", "index": 0 } ] ] }, "If": { "main": [ [ { "node": "Execute Workflow", "type": "main", "index": 0 } ], [ { "node": "Google Sheets", "type": "main", "index": 0 } ] ] }, "HTTP Request4": { "main": [ [ { "node": "Code2", "type": "main", "index": 0 } ] ] }, "Code2": { "main": [ [ { "node": "Body", "type": "main", "index": 0 }, { "node": "Subject", "type": "main", "index": 0 } ] ] }, "Code4": { "main": [ [ { "node": "Merge", "type": "main", "index": 0 } ] ] }, "Subject": { "main": [ [ { "node": "Code6", "type": "main", "index": 0 } ] ] }, "Code6": { "main": [ [ { "node": "Merge", "type": "main", "index": 1 } ] ] }, "Merge": { "main": [ [ { "node": "Edit Fields2", "type": "main", "index": 0 } ] ] }, "Body": { "main": [ [ { "node": "Code4", "type": "main", "index": 0 } ] ] }, "Execute Workflow": { "main": [ [ { "node": "Edit Fields3", "type": "main", "index": 0 } ] ] }, "Edit Fields3": { "main": [ [ { "node": "Merge1", "type": "main", "index": 0 } ] ] }, "If1": { "main": [ [ { "node": "Edit Fields4", "type": "main", "index": 0 } ], [ { "node": "Loop Over Items", "type": "main", "index": 0 } ] ] }, "Edit Fields4": { "main": [ [ { "node": "HTTP Request5", "type": "main", "index": 0 } ] ] }, "Merge1": { "main": [ [ { "node": "If1", "type": "main", "index": 0 } ] ] }, "HTTP Request1": { "main": [ [ { "node": "Code1", "type": "main", "index": 0 } ] ] }, "Code3": { "main": [ [ { "node": "Loop Over Items", "type": "main", "index": 0 } ] ] }, "Google Sheets": { "main": [ [ { "node": "Merge1", "type": "main", "index": 1 } ] ] }, "Execute Workflow Trigger": { "main": [ [ { "node": "Code", "type": "main", "index": 0 } ] ] }, "Loop Over Items": { "main": [ [ { "node": "No Operation, do nothing", "type": "main", "index": 0 } ], [ { "node": "HTTP Request1", "type": "main", "index": 0 } ] ] }, "Execute Workflow1": { "main": [ [] ] }, "HTTP Request5": { "main": [ [ { "node": "Loop Over Items", "type": "main", "index": 0 } ] ] } }, "active": false, "settings": { "executionOrder": "v1" }, "versionId": "d0c354a1-d9aa-41d3-aace-c1adb8896b0c", "meta": { "templateCredsSetupCompleted": true, "instanceId": "558d88703fb65b2d0e44613bc35916258b0f0bf983c5d4730c00c424b77ca36a" }, "id": "KTTJv7MBHOhxEYw5", "tags": [ { "createdAt": "2024-11-24T18:58:20.538Z", "updatedAt": "2024-11-24T18:58:20.538Z", "id": "LfakYAbYpTWCaiAk", "name": "email-mkt" } ] }