{
    "name": "Whatsapp AI Agent",
    "nodes": [
        {
            "parameters": {
                "promptType": "define",
                "text": "={{ \n  $json.messages?.[0]?.text?.body\n  ?? $json.messages?.[0]?.interactive?.button_reply?.title\n  ?? $json.messages?.[0]?.interactive?.list_reply?.title\n  ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.text?.body\n  ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.interactive?.button_reply?.title\n  ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.interactive?.list_reply?.title\n  ?? ''\n}}",
                "hasOutputParser": true,
                "options": {
                    "systemMessage": "=You are an intelligent virtual assistant trained to deliver accurate, customized price quotations using the official knowledge base of Drob Idea for Digital & Electronic Trading Ltd. You can store client data (name, phone, country, service type, price) into a database after the conversation ends.\n\nLANGUAGE POLICY (HARD REQUIREMENT)\n- All customer-facing messages must be in Arabic (Modern Standard Arabic).\n- Automation payloads (e.g., JSON sent to the next node) are not visible to the customer and may remain in English.\n\nOBJECTIVE\nRun a professional, interactive conversation:\n1) Collect the client’s basic data.\n2) Let the client choose the required service from a vertical, numbered list.\n3) Ask detailed scoping questions.\n4) Provide the final price quote.\n5) After quoting, send the client data as JSON to the next node.\n\nSTRICT PRICING RULES\n- Do not propose any price unless it exists in the knowledge base or the approved fallback price table.\n- Never exceed $2500 for any quote.\n- If there is no exact match, use the approved fallback prices.\n- Do not rely on personal estimates or external data beyond the approved sources.\n\nLIST & FORMATTING RULES (FOR CUSTOMER MESSAGES IN ARABIC)\n- Present every list\/choice on separate lines (vertical layout only). Never use horizontal\/inline lists.\n- Start each line with a clear number or emoji, e.g.:\n1️⃣ ...\n2️⃣ ...\n- Never place two bullet points on the same line. Use \\n line breaks between items.\n\nCOLLECTING BASIC DATA (ARABIC FLOW)\n- At the beginning, if any of (name, phone number, country) is missing, politely ask for them first in Arabic.\n- When possible, infer the country from the phone country code; if uncertain, ask the client to confirm.\n\nWELCOME MESSAGE (ARABIC)\n👋 أهلًا وسهلًا بك في شركة دروب أيديا!  \nمن فضلك اختر ما ترغب بالاطّلاع عليه:  \n1️⃣ 💰 عرض سعر لخدماتنا  \n2️⃣ ℹ️ معلومات عن شركتنا  \n3️⃣ 📱 آخر الأعمال للتطبيقات  \n4️⃣ 🌐 آخر الأعمال للمواقع الإلكترونية  \n5️⃣ 🎨 آخر الأعمال للهويات البصرية  \n6️⃣ 🎥 آخر الأعمال للفيديوهات  \n7️⃣ 📄 بروفايل الشركة باللغة العربية  \n8️⃣ 📄 بروفايل الشركة باللغة الانجليزية\n9️⃣ 📜 ترخيص الشركة وفروعها\n🔟 🎨 طلبات مخصصة لاعمالك\n\n\n📌تعليمات اساسية وصارمة يجب الالتزام فيها \n➡️ في حالة اختيار \"عرض سعر\" سنكمل الفلو الحالي مع جمع البيانات التفصيلية.  \n\n➡️ في حالة اختيار \"البروفايل\" يتم عرض الملف المطلوب مباشرة.  \n\nSERVICE MENU TO DISPLAY (ARABIC WORDING; EACH ON ITS OWN LINE)\n1️⃣ 🌐 تصميم موقع إلكتروني  \n   - تطوير المواقع الإبداعية  \n   - تصميم مواقع التجارة الإلكترونية  \n   - مواقع الحجوزات  \n   - أنظمة إدارة المحتوى  \n   - تحسين محركات البحث SEO  \n   - استضافة المواقع  \n\n2️⃣ 📱 تصميم تطبيق إلكتروني  \n  - تطبيق متجر الكتروني يوزر \n  - تطبيق توصيل الطلبات لمتجر الكتروني او منفصل \n  - تطبيق تاجر لمتجر الكتروني \n  - تطبيق يشبة اوبر وكريم  \n  - تطبيق خدمي يقدم خدمات \n\n\n3️⃣ 🎨 تصميم هوية بصرية  \n   - تصميم الشعارات  \n   - تطوير هوية العلامة التجارية  \n   - تصميم واجهة المستخدم\/UX UI  \n   - التصميم الجرافيكي  \n\n4️⃣ 🛒 تطوير متجر إلكتروني  \n   - منصات بيع عبر الإنترنت  \n   - تصميم صفحات الهبوط  \n   - تكامل CRM  \n\n5️⃣ 📢 تسويق رقمي  \n   - استشارات استراتيجية التسويق  \n   - تحسين وسائل التواصل الاجتماعي  \n   - حملات الإعلانات المدفوعة  \n   - التسويق عبر البريد الإلكتروني  \n   - إدارة السمعة على الإنترنت  \n   - التحليلات والرؤى  \n\n6️⃣ 🎥 إنتاج فيديو  \n   - فيديوهات الموشن والجرافيك  \n   - المونتاج والتحرير  \n   - إنتاج فيديو ترويجي  \n   - الواقع الافتراضي  \n\n7️⃣ 💡 استشارات تقنية  \n   - برمجة مخصصة  \n   - تكامل Chatbot  \n   - حلول أمن المعلومات  \n\n8️⃣ 🤖 حلول الذكاء الاصطناعي والأتمتة\n   - بوتات واتساب\n   - بوتات ويب\n   - أتمتة الأعمال\n   - توليد محتوى وتحليلات\n   - متابعة الاعمال وفلتر الايميلات\n   - جميع انواع الاتمتة التي تخدم عملك\n\nAPPROVED FALLBACK PRICES (USE ONLY IF KB HAS NO EXACT MATCH; NEVER EXCEED $2500)\n1️⃣ 🌐  أسعار تصميم موقع إلكتروني\n🌐 موقع تعريفي بسيط — 180–250$\n🌐 موقع الابداعية — 190–260$\n🌐 موقع تعريفي معقد — 280$  \n🛒 تصميم مواقع التجارة الإلكترونية — 600$  \n🍽 موقع حجوزات — 600$  \n💱 أنظمة إدارة المحتوى —  600-800$  \n🌐 تحسين محركات البحث — 90$ لكل 5 صفحات\n🛒 استضافة المواقع  — 100-300$\n\n2️⃣ 📱 اسعار تصميم تطبيق إلكتروني  \n📱 دولار تطبيق واحد لليوزر فقط -  550 – 600 $  \n🛒 تطبيق متجر الكتروني يوزر -  600 – 900 $\n🚚 تطبيق توصيل الطلبات لمتجر الكتروني او منفصل -   300- 350 $\n📦 تطبيق تاجر لمتجر الكتروني - 450 – 600 $  \n🚗 تطبيق يشبة اوبر وكريم  - 1900 – 2800 $\n🐕‍🦺 تطبيق خدمي يقدم خدمات -  1200 – 1600 $\n\n\n3️⃣ 🎨 اسعار تصميم هوية بصرية  \n🖼️ تصميم الشعارات – 50 – 150$ \n🔗 تطوير هوية العلامة التجارية  -  50 – 300 $\n🧩  تصميم واجهة المستخدم\/UX UI  -  لكل صفحة 20$  و *10$* في حالة الصفحات اكثر من 5 صفحات \n🔥  تصميم  واجهة مستخدم \/ UX UI  للمشروع كامل – الرجاء ارسال رابط الواتساب للتواصل \n🖌️ التصميم الجرافيكي – 50 – 500 $\n\n\n4️⃣ 🛒 أسعار تطوير متجر إلكتروني\n🛒 منصات بيع عبر الإنترنت — 300–450$\n📄 تصميم صفحات الهبوط — 150–250$\n🔗 تكامل CRM — 250–400$\n\n5️⃣ 📢 أسعار  تسويق رقمي\n💡 استشارات استراتيجية التسويق — 100–200$\n📱 تحسين وسائل التواصل الاجتماعي — 150–300$\n📢 حملات الإعلانات المدفوعة — 200–400$\n✉️ التسويق عبر البريد الإلكتروني — 100–200$\n👥 إدارة السمعة على الإنترنت — 200–350$\n📊 التحليلات والرؤى — 120–250$\n\n6️⃣ 🎥 أسعار إنتاج فيديو\n🎞️ فيديوهات الموشن والجرافيك — 250–450$\n✂️ المونتاج والتحرير — 150–300$\n🎬 إنتاج فيديو ترويجي — 300–500$\n🕶️ الواقع الافتراضي — 400–500$\n\n7️⃣ 💡 أسعار استشارات تقنية\n🖥️ برمجة مخصصة — 200–450$\n🤖 تكامل Chatbot — 250–400$\n🔐 حلول أمن المعلومات — 300–500$\n\n8️⃣ 🤖 أسعار حلول الذكاء الاصطناعي والأتمتة\n💬 بوتات واتساب — 200–350$\n🌐 بوتات ويب — 200–350$\n⚙️ أتمتة الأعمال — 250–450$\n📝 توليد محتوى وتحليلات — 150–300$\n📂 متابعة الأعمال وفلترة الإيميلات — 200–400$\n🚀 جميع أنواع الأتمتة التي تخدم عملك — 300–500$\n---\n2️⃣ ℹ️ معلومات عن شركتنا\n➡️ في حالة اختيار \"معلومات عن شركتنا\" يتم جلب هذة البيانات \n{{ $json.docs_content ? \"🔎 معلومات من موقع الشركة (ملخّص):\\n\" + $json.docs_content + \"\\n\\n\" : \"\" }}\n---\n3️⃣ 📱 آخر الأعمال للتطبيقات \n➡️ في حالة اختيار \"آخر الأعمال للتطبيقات\" يتم جلب البيانات هذة البيانات  {{ $json.docs_content ? 'النص المرجعي (آخر الأعمال):\\n' + $json.docs_content : '' }}\n---\n4️⃣ 🌐 آخر الأعمال للمواقع الإلكترونية  \n➡️ في حالة اختيار \"آخر الأعمال للمواقع الالكترونية\" يتم جلب هذة البيانات  {{ $json.docs_content ? 'النص المرجعي (آخر الأعمال):\\n' + $json.docs_content : '' }}\n---\n\nCONVERSATION FLOW (ARABIC TO THE CUSTOMER)\n- الترحيب وجمع البيانات الأساسية.\n- عرض قائمة أنواع الخدمات للاختيار.\n- طرح الأسئلة التفصيلية حسب الخدمة.\n- تقديم العرض النهائي بسعر ومدة واضحتين (مع الالتزام بقواعد التسعير أعلاه).\n- إذا لم يوجد تطابق في قاعدة المعرفة، استخدم الأسعار الاحتياطية.\n- واصل المحادثة بنفس التسلسل دون إعادة البدء.\n\nEND-OF-CONVERSATION ACTIONS (ARABIC TO THE CUSTOMER)\nOnly after you have fully completed the conversation and presented the final quote:\n1) Send the WhatsApp contact link:\nhttps:\/\/api.whatsapp.com\/send?phone=962798402930\n2) Then add exactly the phrase: انتهت المحادثة\n\nAUTOMATION PAYLOAD (STRICT OUTPUT RULES; NOT VISIBLE TO THE CUSTOMER)\n- At the very end (after collecting all five fields and presenting the quote): send only the final JSON object below (no extra text, no greetings). Fields must be present exactly as named; price must be a number (no $ sign).\n----\nDo not display this 👇 final JSON to the customer in chat\n\nFINAL JSON SCHEMA send to SET \n{\n {\n  \"انتهت المحادثة\": true,\n  \"name\": \"Customer full name\",\n  \"phone_number\": \"Phone with country code\",\n  \"country\": \"Country name\",\n  \"service_type\": \"Selected service type\",\n  \"sub_service\": \"Selected sub service\",\n  \"price\": 1234\n}\n\n}\n"
                }
            },
            "type": "@n8n\/n8n-nodes-langchain.agent",
            "typeVersion": 1.7,
            "position": [
                2992,
                -32
            ],
            "id": "d855fb3a-0e8e-41bd-9711-a7866f7928c9",
            "name": "AI Agent",
            "alwaysOutputData": false
        },
        {
            "parameters": {
                "operation": "send",
                "phoneNumberId": "731974480005551",
                "recipientPhoneNumber": "={{ $('WhatsApp_Receive').item.json.contacts[0].wa_id }}",
                "textBody": "={{ $json.output.message }}",
                "additionalFields": []
            },
            "type": "n8n-nodes-base.whatsApp",
            "typeVersion": 1,
            "position": [
                3776,
                -128
            ],
            "id": "2e2c8e48-a578-466b-81c6-713aeec9d49f",
            "name": "Send message",
            "webhookId": "d220461b-4240-4720-9b14-35b57516633f",
            "credentials": {
                "whatsAppApi": {
                    "id": "k3Ywbr1yYGS6lxCU",
                    "name": "WhatsApp account"
                }
            }
        },
        {
            "parameters": {
                "pineconeIndex": {
                    "__rl": true,
                    "value": "n8n-price-offers",
                    "mode": "list",
                    "cachedResultName": "n8n-price-offers"
                },
                "options": []
            },
            "type": "@n8n\/n8n-nodes-langchain.vectorStorePinecone",
            "typeVersion": 1.3,
            "position": [
                2992,
                416
            ],
            "id": "f21e8355-505e-4e81-aba6-0069d2bdf3a0",
            "name": "Pinecone Vector Store",
            "credentials": {
                "pineconeApi": {
                    "id": "eliwNj7WZ1PTR4Zl",
                    "name": "PineconeApi account"
                }
            }
        },
        {
            "parameters": {
                "description": "This vector store contains detailed service packages and pricing offers provided by DropIdea. Each entry includes the service type, a short description, estimated cost in USD, and the expected delivery time. The data is designed to help provide precise, custom-tailored price estimates based on client needs such as website design, mobile apps, branding, e-commerce, and other digital solutions."
            },
            "type": "@n8n\/n8n-nodes-langchain.toolVectorStore",
            "typeVersion": 1.1,
            "position": [
                3088,
                208
            ],
            "id": "bf4a07f7-814f-4756-8bea-f1c313a297dc",
            "name": "Answer questions with a vector store"
        },
        {
            "parameters": {
                "conditions": {
                    "options": {
                        "caseSensitive": true,
                        "leftValue": "",
                        "typeValidation": "strict",
                        "version": 2
                    },
                    "conditions": [
                        {
                            "id": "51f761d4-8143-4f39-b210-6addeff90355",
                            "leftValue": "={{ $json.finished }}",
                            "rightValue": "true",
                            "operator": {
                                "type": "string",
                                "operation": "equals"
                            }
                        }
                    ],
                    "combinator": "and"
                },
                "options": []
            },
            "type": "n8n-nodes-base.if",
            "typeVersion": 2.2,
            "position": [
                4000,
                80
            ],
            "id": "144f8d34-7fbb-4cb5-a659-52c3c7376039",
            "name": "If"
        },
        {
            "parameters": [],
            "type": "n8n-nodes-base.noOp",
            "typeVersion": 1,
            "position": [
                4224,
                176
            ],
            "id": "fbc922b2-51be-4eee-925b-4cb187aeb692",
            "name": "No Operation, do nothing"
        },
        {
            "parameters": {
                "schemaType": "manual",
                "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"finished\": {\n      \"type\": \"boolean\",\n      \"description\": \"false أثناء الحوار، true فقط عند اكتمال البيانات وتقديم العرض النهائي.\"\n    },\n    \"message\": {\n      \"type\": \"string\",\n      \"minLength\": 1,\n      \"description\": \"النص العربي الذي سيُرسل للعميل عبر واتساب (قوائم عمودية، أسطر منفصلة).\"\n    },\n    \"name\": { \"type\": \"string\", \"minLength\": 2 },\n    \"phone_number\": {\n      \"type\": \"string\",\n      \"pattern\": \"^\\\\+?\\\\d{7,20}$\",\n      \"description\": \"رقم الهاتف مع مفتاح الدولة.\"\n    },\n    \"country\": { \"type\": \"string\", \"minLength\": 2 },\n\n    \"service_type\": {\n      \"type\": \"string\",\n      \"enum\": [\n        \"تصميم موقع إلكتروني\",\n        \"تصميم تطبيق إلكتروني\",\n        \"تصميم هوية بصرية\",\n        \"تطوير متجر إلكتروني\",\n        \"تسويق رقمي\",\n        \"إنتاج فيديو\",\n        \"استشارات تقنية\",\n        \"حلول الذكاء الاصطناعي والأتمتة\"\n      ],\n      \"description\": \"الخدمة الرئيسية المختارة.\"\n    },\n\n    \"sub_service\": {\n      \"type\": \"string\",\n      \"description\": \"الخدمة الفرعية المطابقة للخدمة الرئيسية المختارة.\"\n    },\n\n    \"price\": {\n      \"type\": \"number\",\n      \"minimum\": 0,\n      \"maximum\": 2500,\n      \"description\": \"المبلغ بالدولار بدون رمز $. الحد الأعلى 2500 حسب السياسة.\"\n    }\n  },\n\n  \"required\": [\"finished\", \"message\"],\n  \"additionalProperties\": false,\n\n  \"allOf\": [\n    { \"if\": { \"properties\": { \"finished\": { \"const\": true } }, \"required\": [\"finished\"] },\n      \"then\": { \"required\": [\"finished\", \"message\", \"name\", \"phone_number\", \"country\", \"service_type\", \"sub_service\", \"price\"] }\n    },\n\n    { \"if\": { \"properties\": { \"service_type\": { \"const\": \"تصميم موقع إلكتروني\" } }, \"required\": [\"service_type\"] },\n      \"then\": { \"properties\": { \"sub_service\": { \"enum\": [\n        \"تطوير المواقع الإبداعية\",\n        \"تصميم مواقع التجارة الإلكترونية\",\n        \"مواقع الحجوزات\",\n        \"أنظمة إدارة المحتوى\",\n        \"تحسين محركات البحث SEO\",\n        \"استضافة المواقع\"\n      ] } } }\n    },\n\n    { \"if\": { \"properties\": { \"service_type\": { \"const\": \"تصميم تطبيق إلكتروني\" } }, \"required\": [\"service_type\"] },\n      \"then\": { \"properties\": { \"sub_service\": { \"enum\": [\n        \"تطبيق متجر الكتروني يوزر\",\n        \"تطبيق توصيل الطلبات لمتجر الكتروني او منفصل\",\n        \"تطبيق تاجر لمتجر الكتروني\",\n        \"تطبيق يشبة اوبر وكريم\",\n        \"تطبيق خدمي يقدم خدمات\"\n      ] } } }\n    },\n\n    { \"if\": { \"properties\": { \"service_type\": { \"const\": \"تصميم هوية بصرية\" } }, \"required\": [\"service_type\"] },\n      \"then\": { \"properties\": { \"sub_service\": { \"enum\": [\n        \"تصميم الشعارات\",\n        \"تطوير هوية العلامة التجارية\",\n        \"تصميم واجهة المستخدم\/UX UI\",\n        \"التصميم الجرافيكي\"\n      ] } } }\n    },\n\n    { \"if\": { \"properties\": { \"service_type\": { \"const\": \"تطوير متجر إلكتروني\" } }, \"required\": [\"service_type\"] },\n      \"then\": { \"properties\": { \"sub_service\": { \"enum\": [\n        \"منصات بيع عبر الإنترنت\",\n        \"تصميم صفحات الهبوط\",\n        \"تكامل CRM\"\n      ] } } }\n    },\n\n    { \"if\": { \"properties\": { \"service_type\": { \"const\": \"تسويق رقمي\" } }, \"required\": [\"service_type\"] },\n      \"then\": { \"properties\": { \"sub_service\": { \"enum\": [\n        \"استشارات استراتيجية التسويق\",\n        \"تحسين وسائل التواصل الاجتماعي\",\n        \"حملات الإعلانات المدفوعة\",\n        \"التسويق عبر البريد الإلكتروني\",\n        \"إدارة السمعة على الإنترنت\",\n        \"التحليلات والرؤى\"\n      ] } } }\n    },\n\n    { \"if\": { \"properties\": { \"service_type\": { \"const\": \"إنتاج فيديو\" } }, \"required\": [\"service_type\"] },\n      \"then\": { \"properties\": { \"sub_service\": { \"enum\": [\n        \"فيديوهات الموشن والجرافيك\",\n        \"المونتاج والتحرير\",\n        \"إنتاج فيديو ترويجي\",\n        \"الواقع الافتراضي\"\n      ] } } }\n    },\n\n    { \"if\": { \"properties\": { \"service_type\": { \"const\": \"استشارات تقنية\" } }, \"required\": [\"service_type\"] },\n      \"then\": { \"properties\": { \"sub_service\": { \"enum\": [\n        \"برمجة مخصصة\",\n        \"تكامل Chatbot\",\n        \"حلول أمن المعلومات\"\n      ] } } }\n    },\n\n    { \"if\": { \"properties\": { \"service_type\": { \"const\": \"حلول الذكاء الاصطناعي والأتمتة\" } }, \"required\": [\"service_type\"] },\n      \"then\": { \"properties\": { \"sub_service\": { \"enum\": [\n        \"بوتات واتساب\",\n        \"بوتات ويب\",\n        \"أتمتة الأعمال\",\n        \"توليد محتوى وتحليلات\",\n        \"متابعة الاعمال وفلتر الايميلات\",\n        \"جميع انواع الاتمتة التي تخدم عملك\"\n      ] } } }\n    }\n  ]\n}",
                "autoFix": true
            },
            "type": "@n8n\/n8n-nodes-langchain.outputParserStructured",
            "typeVersion": 1.3,
            "position": [
                3408,
                208
            ],
            "id": "3e14be13-0265-4c76-b030-604a7d2929b6",
            "name": "Structured Output Parser"
        },
        {
            "parameters": {
                "assignments": {
                    "assignments": [
                        {
                            "id": "5488cc34-28d6-4f69-b81e-aa39e1f40f47",
                            "name": "name",
                            "value": "={{ $json.output.name }}",
                            "type": "string"
                        },
                        {
                            "id": "75efcd05-4351-424e-a032-2a1440cfb811",
                            "name": "phone_number",
                            "value": "={{ $json.output.phone_number }}",
                            "type": "string"
                        },
                        {
                            "id": "941f9a5c-32a5-44fb-8c87-f56b54bb1645",
                            "name": "country",
                            "value": "={{ $json.output.country }}",
                            "type": "string"
                        },
                        {
                            "id": "0a9835a2-f265-4852-9eb1-2eb72449dbb9",
                            "name": "service",
                            "value": "={{ $json.output.service_type }}",
                            "type": "string"
                        },
                        {
                            "id": "4aeac9f1-6f1e-45ab-8f33-20fa207b96ee",
                            "name": "price",
                            "value": "={{ $json.output.price }}",
                            "type": "string"
                        },
                        {
                            "id": "280f5ca8-37d3-445e-b87f-2d8017686a5e",
                            "name": "finished",
                            "value": "={{ $json.output.finished }}",
                            "type": "string"
                        },
                        {
                            "id": "204eb0a6-e9a5-4c16-abce-58c108f6112a",
                            "name": "sub_service",
                            "value": "={{ $json.output.sub_service }}",
                            "type": "string"
                        }
                    ]
                },
                "options": []
            },
            "type": "n8n-nodes-base.set",
            "typeVersion": 3.4,
            "position": [
                3776,
                80
            ],
            "id": "fbe1bc8b-0d42-4ae2-a817-5f2400565a90",
            "name": "Edit Fields"
        },
        {
            "parameters": {
                "schema": {
                    "__rl": true,
                    "mode": "list",
                    "value": "public"
                },
                "table": {
                    "__rl": true,
                    "value": "client_data",
                    "mode": "list",
                    "cachedResultName": "client_data"
                },
                "columns": {
                    "mappingMode": "defineBelow",
                    "value": {
                        "name": "={{ $json.name }}",
                        "phone_number": "={{ $json.phone_number }}",
                        "country": "={{ $json.country }}",
                        "service_type": "={{ $json.service }}",
                        "price": "={{ $json.price }}",
                        "Sub-service": "={{ $json.sub_service }}"
                    },
                    "matchingColumns": [
                        "id"
                    ],
                    "schema": [
                        {
                            "id": "id",
                            "displayName": "id",
                            "required": false,
                            "defaultMatch": true,
                            "display": true,
                            "type": "number",
                            "canBeUsedToMatch": true,
                            "removed": true
                        },
                        {
                            "id": "created_at",
                            "displayName": "created_at",
                            "required": false,
                            "defaultMatch": false,
                            "display": true,
                            "type": "dateTime",
                            "canBeUsedToMatch": true,
                            "removed": true
                        },
                        {
                            "id": "name",
                            "displayName": "name",
                            "required": false,
                            "defaultMatch": false,
                            "display": true,
                            "type": "string",
                            "canBeUsedToMatch": true
                        },
                        {
                            "id": "phone_number",
                            "displayName": "phone_number",
                            "required": false,
                            "defaultMatch": false,
                            "display": true,
                            "type": "string",
                            "canBeUsedToMatch": true
                        },
                        {
                            "id": "country",
                            "displayName": "country",
                            "required": false,
                            "defaultMatch": false,
                            "display": true,
                            "type": "string",
                            "canBeUsedToMatch": true
                        },
                        {
                            "id": "service_type",
                            "displayName": "service_type",
                            "required": false,
                            "defaultMatch": false,
                            "display": true,
                            "type": "string",
                            "canBeUsedToMatch": true
                        },
                        {
                            "id": "price",
                            "displayName": "price",
                            "required": false,
                            "defaultMatch": false,
                            "display": true,
                            "type": "string",
                            "canBeUsedToMatch": true
                        },
                        {
                            "id": "Sub-service",
                            "displayName": "Sub-service",
                            "required": false,
                            "defaultMatch": false,
                            "display": true,
                            "type": "string",
                            "canBeUsedToMatch": true,
                            "removed": false
                        }
                    ],
                    "attemptToConvertTypes": false,
                    "convertFieldsToString": false
                },
                "options": []
            },
            "type": "n8n-nodes-base.postgres",
            "typeVersion": 2.6,
            "position": [
                4224,
                -32
            ],
            "id": "5ae51cef-b610-49cf-a105-ac140756fad5",
            "name": "Insert rows in a table",
            "credentials": {
                "postgres": {
                    "id": "VrRSp705gu0IHQy1",
                    "name": "Postgres account"
                }
            }
        },
        {
            "parameters": {
                "sessionIdType": "customKey",
                "sessionKey": "={{ $json.sessionId }}",
                "contextWindowLength": 50
            },
            "type": "@n8n\/n8n-nodes-langchain.memoryPostgresChat",
            "typeVersion": 1.3,
            "position": [
                2960,
                208
            ],
            "id": "c5e339b9-39e7-4dfd-9f7b-fcddb9f7f4eb",
            "name": "Postgres Chat Memory",
            "credentials": {
                "postgres": {
                    "id": "VrRSp705gu0IHQy1",
                    "name": "Postgres account"
                }
            }
        },
        {
            "parameters": {
                "updates": [
                    "messages"
                ],
                "options": []
            },
            "type": "n8n-nodes-base.whatsAppTrigger",
            "typeVersion": 1,
            "position": [
                -304,
                -48
            ],
            "id": "494bceed-3ab0-409c-a62d-7af05898928a",
            "name": "WhatsApp_Receive",
            "webhookId": "2dad59e3-50b9-4a5b-b53c-13d5d1a4acbe",
            "credentials": {
                "whatsAppTriggerApi": {
                    "id": "WXfwDNE7D5hbQAVQ",
                    "name": "WhatsApp OAuth account"
                }
            }
        },
        {
            "parameters": {
                "assignments": {
                    "assignments": [
                        {
                            "id": "340f4be2-1432-44c2-8236-7a52159a3aa2",
                            "name": "sessionId",
                            "value": "={{   String(     $json.messages?.[0]?.from     ?? $json.contacts?.[0]?.wa_id     ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.from     ?? $json.entry?.[0]?.changes?.[0]?.value?.contacts?.[0]?.wa_id   ) }}",
                            "type": "string"
                        }
                    ]
                },
                "includeOtherFields": true,
                "options": []
            },
            "type": "n8n-nodes-base.set",
            "typeVersion": 3.4,
            "position": [
                -80,
                -48
            ],
            "id": "36a4c80f-29cc-4fee-ae18-ff62bcd06778",
            "name": "Make SessionId1",
            "alwaysOutputData": false
        },
        {
            "parameters": {
                "model": {
                    "__rl": true,
                    "mode": "list",
                    "value": "claude-sonnet-4-20250514",
                    "cachedResultName": "Claude 4 Sonnet"
                },
                "options": []
            },
            "type": "@n8n\/n8n-nodes-langchain.lmChatAnthropic",
            "typeVersion": 1.3,
            "position": [
                2832,
                208
            ],
            "id": "8e06121c-015c-4cde-9e36-baba253a8b65",
            "name": "Anthropic Chat Model",
            "credentials": {
                "anthropicApi": {
                    "id": "ZtrfJqD7xC9RXnqv",
                    "name": "Anthropic account"
                }
            }
        },
        {
            "parameters": [],
            "type": "@n8n\/n8n-nodes-langchain.embeddingsGoogleGemini",
            "typeVersion": 1,
            "position": [
                3072,
                624
            ],
            "id": "ae14e17a-827c-403f-a673-fe35edec1048",
            "name": "Embeddings Google Gemini",
            "credentials": {
                "googlePalmApi": {
                    "id": "go62wL4a7Q4uxCV5",
                    "name": "Google Gemini(PaLM) Api account"
                }
            }
        },
        {
            "parameters": {
                "model": {
                    "__rl": true,
                    "mode": "list",
                    "value": "claude-sonnet-4-20250514",
                    "cachedResultName": "Claude 4 Sonnet"
                },
                "options": []
            },
            "type": "@n8n\/n8n-nodes-langchain.lmChatAnthropic",
            "typeVersion": 1.3,
            "position": [
                3280,
                416
            ],
            "id": "09a0f8ec-97a0-410c-aefd-a3242ffbd7a8",
            "name": "Anthropic Chat Model1",
            "credentials": {
                "anthropicApi": {
                    "id": "ZtrfJqD7xC9RXnqv",
                    "name": "Anthropic account"
                }
            }
        },
        {
            "parameters": {
                "model": {
                    "__rl": true,
                    "mode": "list",
                    "value": "claude-sonnet-4-20250514",
                    "cachedResultName": "Claude 4 Sonnet"
                },
                "options": []
            },
            "type": "@n8n\/n8n-nodes-langchain.lmChatAnthropic",
            "typeVersion": 1.3,
            "position": [
                3488,
                416
            ],
            "id": "1b3ae2e9-e12f-46c8-92e6-4d3fe57cb520",
            "name": "Anthropic Chat Model2",
            "credentials": {
                "anthropicApi": {
                    "id": "ZtrfJqD7xC9RXnqv",
                    "name": "Anthropic account"
                }
            }
        },
        {
            "parameters": {
                "operation": "get",
                "documentURL": "https:\/\/docs.google.com\/document\/d\/1cvanisAWbP2EACA8BqvbKuZ2Y_2lHpT5W6jokyvpyVs\/edit?tab=t.0"
            },
            "type": "n8n-nodes-base.googleDocs",
            "typeVersion": 2,
            "position": [
                1040,
                -32
            ],
            "id": "fb2ea427-344a-4303-b5d5-0f58ffe9fe6a",
            "name": "Application works",
            "notesInFlow": false,
            "credentials": {
                "googleDocsOAuth2Api": {
                    "id": "wu7kvyECAfMfhwCK",
                    "name": "Google Docs account"
                }
            }
        },
        {
            "parameters": {
                "conditions": {
                    "options": {
                        "caseSensitive": true,
                        "leftValue": "",
                        "typeValidation": "strict",
                        "version": 2
                    },
                    "conditions": [
                        {
                            "id": "97378db9-2093-4b34-8d89-0c3641f96719",
                            "leftValue": "={{ \n  $json.messages?.[0]?.text?.body\n  ?? $json.messages?.[0]?.interactive?.button_reply?.title\n  ?? $json.messages?.[0]?.interactive?.list_reply?.title\n  ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.text?.body\n  ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.interactive?.button_reply?.title\n  ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.interactive?.list_reply?.title\n  ?? ''\n}}",
                            "rightValue": "=",
                            "operator": {
                                "type": "string",
                                "operation": "notEquals"
                            }
                        }
                    ],
                    "combinator": "and"
                },
                "options": []
            },
            "type": "n8n-nodes-base.if",
            "typeVersion": 2.2,
            "position": [
                144,
                -48
            ],
            "id": "6b1711ed-b21e-4564-a42d-b32eafa4b26e",
            "name": "Verify the message"
        },
        {
            "parameters": {
                "conditions": {
                    "options": {
                        "caseSensitive": true,
                        "leftValue": "",
                        "typeValidation": "strict",
                        "version": 2
                    },
                    "conditions": [
                        {
                            "id": "9dd355bf-aa8d-4fac-9eea-b3a6a4b1b7c0",
                            "leftValue": "={{\n  (\n    $json.messages?.[0]?.text?.body\n    ?? $json.messages?.[0]?.interactive?.button_reply?.title\n    ?? $json.messages?.[0]?.interactive?.list_reply?.title\n    ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.text?.body\n    ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.interactive?.button_reply?.title\n    ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.interactive?.list_reply?.title\n    ?? ''\n  )\n  .replace(\/\\s+\/g,' ')\n  .replace(\/[^\\u0600-\\u06FF0-9a-zA-Z ]\/g,'')\n  .trim()\n}}",
                            "rightValue": "^(3|٣|.*\\bالتطبيقات\\b.*)$",
                            "operator": {
                                "type": "string",
                                "operation": "regex"
                            }
                        },
                        {
                            "id": "dc14c4f3-4bea-48a4-8bae-aa144fea66b7",
                            "leftValue": "={{   (     $json.messages?.[0]?.text?.body     ?? $json.messages?.[0]?.interactive?.button_reply?.title     ?? $json.messages?.[0]?.interactive?.list_reply?.title     ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.text?.body     ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.interactive?.button_reply?.title     ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.interactive?.list_reply?.title     ?? ''   )   .replace(\/\\s+\/g,' ')   .replace(\/[^\\u0600-\\u06FF0-9a-zA-Z ]\/g,'')   .trim() }}",
                            "rightValue": "^(4|٤|.*\\bالمواقع\\b.*|.*\\bالمواقع الالكترونية\\b.*)$",
                            "operator": {
                                "type": "string",
                                "operation": "regex"
                            }
                        },
                        {
                            "id": "daf38ec8-7012-43c2-a505-7d49a57c5812",
                            "leftValue": "={{   (     $json.messages?.[0]?.text?.body     ?? $json.messages?.[0]?.interactive?.button_reply?.title     ?? $json.messages?.[0]?.interactive?.list_reply?.title     ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.text?.body     ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.interactive?.button_reply?.title     ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.interactive?.list_reply?.title     ?? ''   )   .replace(\/\\s+\/g,' ')   .replace(\/[^\\u0600-\\u06FF0-9a-zA-Z ]\/g,'')   .trim() }}",
                            "rightValue": "^(2|٢)\\b|(?:معلومات|نبذة|عن\\s*الشركة|بروفايل|Profile|Company\\s*Profile|About)\\b",
                            "operator": {
                                "type": "string",
                                "operation": "regex"
                            }
                        }
                    ],
                    "combinator": "or"
                },
                "options": []
            },
            "type": "n8n-nodes-base.if",
            "typeVersion": 2.2,
            "position": [
                368,
                -144
            ],
            "id": "bffc4d5f-6d5a-440e-88c8-1a0cfc2dd968",
            "name": "Category \"Latest Works\""
        },
        {
            "parameters": {
                "conditions": {
                    "options": {
                        "caseSensitive": true,
                        "leftValue": "",
                        "typeValidation": "strict",
                        "version": 2
                    },
                    "conditions": [
                        {
                            "id": "ff703fa1-f984-422d-90bf-80763b52f2f0",
                            "leftValue": "={{   $json.messages?.[0]?.text?.body   ?? $json.messages?.[0]?.interactive?.button_reply?.title   ?? $json.messages?.[0]?.interactive?.list_reply?.title   ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.text?.body   ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.interactive?.button_reply?.title   ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.interactive?.list_reply?.title   ?? '' }}",
                            "rightValue": "^(3|٣)\\b|التطبيقات\\b|آخر\\s*الأعمال\\s*للتطبيقات|آخر\\s*أعمال\\s*التطبيقات",
                            "operator": {
                                "type": "string",
                                "operation": "regex"
                            }
                        }
                    ],
                    "combinator": "and"
                },
                "options": []
            },
            "type": "n8n-nodes-base.if",
            "typeVersion": 2.2,
            "position": [
                592,
                320
            ],
            "id": "bf2e5f30-ab79-482f-89f0-cc64bd2f296b",
            "name": "If-Apps"
        },
        {
            "parameters": {
                "conditions": {
                    "options": {
                        "caseSensitive": true,
                        "leftValue": "",
                        "typeValidation": "strict",
                        "version": 2
                    },
                    "conditions": [
                        {
                            "id": "b6f653a7-7071-4140-9aad-f55226917088",
                            "leftValue": "={{   $json.messages?.[0]?.text?.body   ?? $json.messages?.[0]?.interactive?.button_reply?.title   ?? $json.messages?.[0]?.interactive?.list_reply?.title   ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.text?.body   ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.interactive?.button_reply?.title   ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.interactive?.list_reply?.title   ?? '' }}",
                            "rightValue": "^(4|٤)\\b|المواقع\\b|المواقع\\s*الإلكترونية\\b|آخر\\s*الأعمال\\s*للمواقع|آخر\\s*أعمال\\s*المواقع",
                            "operator": {
                                "type": "string",
                                "operation": "regex"
                            }
                        }
                    ],
                    "combinator": "and"
                },
                "options": []
            },
            "type": "n8n-nodes-base.if",
            "typeVersion": 2.2,
            "position": [
                816,
                416
            ],
            "id": "8b99b7c8-0a61-40af-a2a1-2f5b88569961",
            "name": "If-Web"
        },
        {
            "parameters": {
                "operation": "get",
                "documentURL": "https:\/\/docs.google.com\/document\/d\/1qTMUkcKln4-2PqVLDQf8gjDk10rl8abEAmVCXlvTlcI\/edit?tab=t.0"
            },
            "type": "n8n-nodes-base.googleDocs",
            "typeVersion": 2,
            "position": [
                1040,
                176
            ],
            "id": "551485c0-68e9-425d-b312-7fe193714e39",
            "name": "web works",
            "notesInFlow": false,
            "credentials": {
                "googleDocsOAuth2Api": {
                    "id": "wu7kvyECAfMfhwCK",
                    "name": "Google Docs account"
                }
            }
        },
        {
            "parameters": {
                "assignments": {
                    "assignments": [
                        {
                            "id": "1055b218-1468-4902-b499-da46cece8433",
                            "name": "docs_content",
                            "value": "={{    ($json.content ??      (($json.body?.content || [])       .map(s => (s.paragraph?.elements || [])         .map(e => e.textRun?.content || '').join(''))       .join('\\n')     )   )   .replace(\/\\u00A0\/g,' ')   .replace(\/\\s+\\n\/g,'\\n')   .replace(\/\\n{3,}\/g,'\\n\\n')   .trim() }}",
                            "type": "string"
                        }
                    ]
                },
                "options": []
            },
            "type": "n8n-nodes-base.set",
            "typeVersion": 3.4,
            "position": [
                1264,
                -32
            ],
            "id": "020dd9c6-a1d8-44be-b1ac-36a33b0e3513",
            "name": "Attach Docs (Apps)"
        },
        {
            "parameters": {
                "assignments": {
                    "assignments": [
                        {
                            "id": "1055b218-1468-4902-b499-da46cece8433",
                            "name": "docs_content",
                            "value": "={{    ($json.content ??      (($json.body?.content || [])       .map(s => (s.paragraph?.elements || [])         .map(e => e.textRun?.content || '').join(''))       .join('\\n')     )   )   .replace(\/\\u00A0\/g,' ')   .replace(\/\\s+\\n\/g,'\\n')   .replace(\/\\n{3,}\/g,'\\n\\n')   .trim() }}",
                            "type": "string"
                        }
                    ]
                },
                "options": []
            },
            "type": "n8n-nodes-base.set",
            "typeVersion": 3.4,
            "position": [
                1264,
                176
            ],
            "id": "53750862-02ca-4892-a1c0-4b3f1ae3158b",
            "name": "عقدة Attach Docs (Web)"
        },
        {
            "parameters": {
                "mode": "combine",
                "combineBy": "combineByPosition",
                "options": []
            },
            "type": "n8n-nodes-base.merge",
            "typeVersion": 3.2,
            "position": [
                2608,
                96
            ],
            "id": "eeb79226-e4d1-430f-9797-781856a3ea2e",
            "name": "Merge Context + Docs"
        },
        {
            "parameters": [],
            "type": "n8n-nodes-base.merge",
            "typeVersion": 3.2,
            "position": [
                1488,
                48
            ],
            "id": "51063674-c902-438d-94bb-ba6696ecf232",
            "name": "Merge Docs"
        },
        {
            "parameters": [],
            "type": "n8n-nodes-base.noOp",
            "typeVersion": 1,
            "position": [
                368,
                48
            ],
            "id": "85875cb7-4882-4751-a515-4a03e79afb8d",
            "name": "No Operation, do nothing3"
        },
        {
            "parameters": {
                "conditions": {
                    "options": {
                        "caseSensitive": true,
                        "leftValue": "",
                        "typeValidation": "strict",
                        "version": 2
                    },
                    "conditions": [
                        {
                            "id": "b6f653a7-7071-4140-9aad-f55226917088",
                            "leftValue": "={{   $json.messages?.[0]?.text?.body   ?? $json.messages?.[0]?.interactive?.button_reply?.title   ?? $json.messages?.[0]?.interactive?.list_reply?.title   ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.text?.body   ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.interactive?.button_reply?.title   ?? $json.entry?.[0]?.changes?.[0]?.value?.messages?.[0]?.interactive?.list_reply?.title   ?? '' }}",
                            "rightValue": "^(2|٢)\\b|(?:معلومات|نبذة|عن\\s*الشركة|بروفايل|Profile|Company\\s*Profile|About)\\b",
                            "operator": {
                                "type": "string",
                                "operation": "regex"
                            }
                        }
                    ],
                    "combinator": "and"
                },
                "options": []
            },
            "type": "n8n-nodes-base.if",
            "typeVersion": 2.2,
            "position": [
                1040,
                560
            ],
            "id": "9fd283a1-ac49-43d0-af76-ec4111bf23fc",
            "name": "If_Info"
        },
        {
            "parameters": [],
            "type": "n8n-nodes-base.noOp",
            "typeVersion": 1,
            "position": [
                1264,
                704
            ],
            "id": "8e634943-840f-42e4-bcaa-2df4a8d07b39",
            "name": "No Operation, do nothing1"
        },
        {
            "parameters": {
                "assignments": {
                    "assignments": [
                        {
                            "id": "6fe9a1e0-9347-46d9-981f-c14230d1a058",
                            "name": "site_url",
                            "value": "https:\/\/dropidea.com",
                            "type": "string"
                        },
                        {
                            "id": "5739f2a2-7047-4b62-ae4f-ad04325526fe",
                            "name": "paths",
                            "value": "={{ [\n  \"\/about-us\",\n  \"\/team\",\n  \"\/وظائف-شاغرة\",\n  \"\/faq\",\n  \"\/our-services\",\n  \"\/service\/website-design\",\n  \"\/service\/design-development\",\n  \"\/service\/e-marketing-and-digital-marketing-consulting\",\n  \"\/service\/video-motion\",\n  \"\/service\/seo-sem\",\n  \"\/service\/chatbot-ai\",\n  \"\/service\/brand-identity\",\n  \"\/our-portfolio\",\n  \"\/contact\"\n] }}",
                            "type": "array"
                        }
                    ]
                },
                "options": []
            },
            "type": "n8n-nodes-base.set",
            "typeVersion": 3.4,
            "position": [
                1264,
                512
            ],
            "id": "bec9bf29-a719-4e88-b0e5-c74cfb213604",
            "name": "Set (Company URLs)"
        },
        {
            "parameters": {
                "url": "={{ $json.url }}",
                "sendHeaders": true,
                "headerParameters": {
                    "parameters": [
                        {
                            "name": "User-Agent",
                            "value": "Mozilla\/5.0 (compatible; n8n-fetchbot\/1.0)"
                        },
                        {
                            "name": "Accept-Language",
                            "value": "ar,en;q=0.9"
                        }
                    ]
                },
                "options": []
            },
            "type": "n8n-nodes-base.httpRequest",
            "typeVersion": 4.2,
            "position": [
                1712,
                512
            ],
            "id": "625d7eb4-1df5-484d-b14b-0579a424579a",
            "name": "HTTP Request",
            "onError": "continueRegularOutput"
        },
        {
            "parameters": {
                "jsCode": "const base = $json.site_url.replace(\/\\\/+$\/, '');\nconst raw = $json.paths;\nconst list = Array.isArray(raw) ? raw : String(raw).split(\/\\r?\\n\/);\n\nconst paths = list\n  .map(p => (p || '').trim())\n  .filter(Boolean)\n  .map(p => p.startsWith('\/') ? p : `\/${p}`);\n\nreturn paths.map(p => ({ json: { url: base + p } }));"
            },
            "type": "n8n-nodes-base.code",
            "typeVersion": 2,
            "position": [
                1488,
                512
            ],
            "id": "9e323acf-72c0-4bb9-bcf8-3aca2d83530e",
            "name": "Function (Build URL items"
        },
        {
            "parameters": {
                "jsCode": "function strip(html) {\n  return String(html || '')\n    .replace(\/<script[\\s\\S]*?<\\\/script>\/gi, ' ')\n    .replace(\/<style[\\s\\S]*?<\\\/style>\/gi, ' ')\n    .replace(\/<[^>]+>\/g, ' ')\n    .replace(\/\\s+\/g, ' ')\n    .trim();\n}\nreturn [{ json: { text: strip($json.body), url: $json.url } }];\n"
            },
            "type": "n8n-nodes-base.code",
            "typeVersion": 2,
            "position": [
                1936,
                512
            ],
            "id": "3f070219-d874-423e-b37b-dc49dbfe2856",
            "name": "Function (HTML → text)"
        },
        {
            "parameters": {
                "jsCode": "const items = $input.all();\nconst parts = items.map(i => i.json.text).filter(t => t && t.length > 50);\nlet joined = parts.join('\\n\\n---\\n\\n');\nconst MAX = 20000; \/\/ حدّ أقصى للحروف\nif (joined.length > MAX) joined = joined.slice(0, MAX);\nreturn [{ json: { docs_content: `مقتطفات من موقع الشركة:\\n\\n${joined}` } }];\n"
            },
            "type": "n8n-nodes-base.code",
            "typeVersion": 2,
            "position": [
                2160,
                512
            ],
            "id": "dbce1c41-fc7d-4394-897a-3cc8defe2ae1",
            "name": "Function (Join pages text → docs_content)"
        },
        {
            "parameters": {
                "conditions": {
                    "options": {
                        "caseSensitive": true,
                        "leftValue": "",
                        "typeValidation": "strict",
                        "version": 2
                    },
                    "conditions": [
                        {
                            "id": "2ee8216c-db29-402c-a185-d03b0b647f8b",
                            "leftValue": "={{ !!$json.docs_content && $json.docs_content.length > 120 }}",
                            "rightValue": "",
                            "operator": {
                                "type": "boolean",
                                "operation": "true",
                                "singleValue": true
                            }
                        }
                    ],
                    "combinator": "and"
                },
                "options": []
            },
            "type": "n8n-nodes-base.if",
            "typeVersion": 2.2,
            "position": [
                2384,
                512
            ],
            "id": "cea27f87-5622-4afd-819b-3fc7aee3ab82",
            "name": "If (docs ok)"
        },
        {
            "parameters": [],
            "type": "n8n-nodes-base.noOp",
            "typeVersion": 1,
            "position": [
                2608,
                608
            ],
            "id": "8dcfe3fa-a40c-4ec0-9d83-144556e99053",
            "name": "No Operation, do nothing2"
        }
    ],
    "pinData": {
        "WhatsApp_Receive": [
            {
                "json": {
                    "messaging_product": "whatsapp",
                    "metadata": {
                        "display_phone_number": "15076726092",
                        "phone_number_id": "731974480005551"
                    },
                    "contacts": [
                        {
                            "profile": {
                                "name": "شركة دروب أيديا للتجارة الرقمية والالكترونية ذ.م.م"
                            },
                            "wa_id": "962798402930"
                        }
                    ],
                    "messages": [
                        {
                            "from": "962798402930",
                            "id": "wamid.HBgMOTYyNzk4NDAyOTMwFQIAEhggRDNGNkU5RENEMzU0NTM0NzI0QTFENjA3RDIyNUI3MEIA",
                            "timestamp": "1755787652",
                            "text": {
                                "body": "مرحبا"
                            },
                            "type": "text"
                        }
                    ],
                    "field": "messages"
                }
            }
        ]
    },
    "connections": {
        "AI Agent": {
            "main": [
                [
                    {
                        "node": "Send message",
                        "type": "main",
                        "index": 0
                    },
                    {
                        "node": "Edit Fields",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Pinecone Vector Store": {
            "ai_tool": [
                []
            ],
            "ai_vectorStore": [
                [
                    {
                        "node": "Answer questions with a vector store",
                        "type": "ai_vectorStore",
                        "index": 0
                    }
                ]
            ]
        },
        "Answer questions with a vector store": {
            "ai_tool": [
                [
                    {
                        "node": "AI Agent",
                        "type": "ai_tool",
                        "index": 0
                    }
                ]
            ]
        },
        "If": {
            "main": [
                [
                    {
                        "node": "Insert rows in a table",
                        "type": "main",
                        "index": 0
                    }
                ],
                [
                    {
                        "node": "No Operation, do nothing",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Send message": {
            "main": [
                []
            ]
        },
        "Structured Output Parser": {
            "ai_outputParser": [
                [
                    {
                        "node": "AI Agent",
                        "type": "ai_outputParser",
                        "index": 0
                    }
                ]
            ]
        },
        "Edit Fields": {
            "main": [
                [
                    {
                        "node": "If",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Postgres Chat Memory": {
            "ai_memory": [
                [
                    {
                        "node": "AI Agent",
                        "type": "ai_memory",
                        "index": 0
                    }
                ]
            ]
        },
        "WhatsApp_Receive": {
            "main": [
                [
                    {
                        "node": "Make SessionId1",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Make SessionId1": {
            "main": [
                [
                    {
                        "node": "Verify the message",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Anthropic Chat Model": {
            "ai_languageModel": [
                [
                    {
                        "node": "AI Agent",
                        "type": "ai_languageModel",
                        "index": 0
                    }
                ]
            ]
        },
        "Embeddings Google Gemini": {
            "ai_embedding": [
                [
                    {
                        "node": "Pinecone Vector Store",
                        "type": "ai_embedding",
                        "index": 0
                    }
                ]
            ]
        },
        "Anthropic Chat Model1": {
            "ai_languageModel": [
                [
                    {
                        "node": "Answer questions with a vector store",
                        "type": "ai_languageModel",
                        "index": 0
                    }
                ]
            ]
        },
        "Anthropic Chat Model2": {
            "ai_languageModel": [
                [
                    {
                        "node": "Structured Output Parser",
                        "type": "ai_languageModel",
                        "index": 0
                    }
                ]
            ]
        },
        "Application works": {
            "main": [
                [
                    {
                        "node": "Attach Docs (Apps)",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Verify the message": {
            "main": [
                [
                    {
                        "node": "Category \"Latest Works\"",
                        "type": "main",
                        "index": 0
                    }
                ],
                [
                    {
                        "node": "No Operation, do nothing3",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Category \"Latest Works\"": {
            "main": [
                [
                    {
                        "node": "If-Apps",
                        "type": "main",
                        "index": 0
                    },
                    {
                        "node": "Merge Context + Docs",
                        "type": "main",
                        "index": 0
                    }
                ],
                [
                    {
                        "node": "AI Agent",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "If-Apps": {
            "main": [
                [
                    {
                        "node": "Application works",
                        "type": "main",
                        "index": 0
                    }
                ],
                [
                    {
                        "node": "If-Web",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "If-Web": {
            "main": [
                [
                    {
                        "node": "web works",
                        "type": "main",
                        "index": 0
                    }
                ],
                [
                    {
                        "node": "If_Info",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "web works": {
            "main": [
                [
                    {
                        "node": "عقدة Attach Docs (Web)",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Attach Docs (Apps)": {
            "main": [
                [
                    {
                        "node": "Merge Docs",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "عقدة Attach Docs (Web)": {
            "main": [
                [
                    {
                        "node": "Merge Docs",
                        "type": "main",
                        "index": 1
                    }
                ]
            ]
        },
        "Merge Context + Docs": {
            "main": [
                [
                    {
                        "node": "AI Agent",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Merge Docs": {
            "main": [
                [
                    {
                        "node": "Merge Context + Docs",
                        "type": "main",
                        "index": 1
                    }
                ]
            ]
        },
        "If_Info": {
            "main": [
                [
                    {
                        "node": "Set (Company URLs)",
                        "type": "main",
                        "index": 0
                    },
                    {
                        "node": "Merge Context + Docs",
                        "type": "main",
                        "index": 0
                    }
                ],
                [
                    {
                        "node": "No Operation, do nothing1",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Set (Company URLs)": {
            "main": [
                [
                    {
                        "node": "Function (Build URL items",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "HTTP Request": {
            "main": [
                [
                    {
                        "node": "Function (HTML → text)",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Function (Build URL items": {
            "main": [
                [
                    {
                        "node": "HTTP Request",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Function (HTML → text)": {
            "main": [
                [
                    {
                        "node": "Function (Join pages text → docs_content)",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Function (Join pages text → docs_content)": {
            "main": [
                [
                    {
                        "node": "If (docs ok)",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "If (docs ok)": {
            "main": [
                [
                    {
                        "node": "Merge Context + Docs",
                        "type": "main",
                        "index": 1
                    }
                ],
                [
                    {
                        "node": "No Operation, do nothing2",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        }
    },
    "active": true,
    "settings": {
        "executionOrder": "v1"
    },
    "versionId": "d13826f8-c56b-408b-92d1-15b2bedaede6",
    "meta": {
        "templateCredsSetupCompleted": true,
        "instanceId": "a85fc6519b374e86e01063acbb733de8f006266ec78aa34c0f3dbebd8434a16e"
    },
    "id": "cE0yirxIhVPeNKzt",
    "tags": []
}