{
  "name": "Estimate construction costs from text, photos and PDFs with Telegram, GPT‑4/Gemini and DDC CWICR",
  "nodes": [
    {
      "id": "c77b9d88-2822-49f7-b1f7-5dd8a50a7989",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2208,
        864
      ],
      "parameters": {
        "width": 420,
        "height": 132,
        "content": "⭐ **If you find our tools helpful**, please consider **starring our repository** on [GitHub](https://github.com/datadrivenconstruction/OpenConstructionEstimate-DDC-CWICR). \n\nYour support helps us impr"
      }
    },
    {
      "id": "b976eaa7-64c8-44da-a068-2c87ba286b5d",
      "name": "🔐 Credentials Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2208,
        1008
      ],
      "parameters": {
        "width": 428,
        "height": 1200,
        "content": "## 🔐 API CREDENTIALS SETUP\n\n### ⬇️ Configure node `🔑 TOKEN` below:\n\n```json\n{\n  \"bot_token\": \"YOUR_BOT_TOKEN\",\n  \"AI_PROVIDER\": \"gemini\",\n  \"GEMINI_API_KEY\": \"YOUR_KEY\",\n  \"OPENAI_API_KEY\": \"YOUR_KEY\""
      }
    },
    {
      "id": "7d603c66-1ea8-47f7-9825-3162a72d0861",
      "name": "UI Messages",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -896,
        208
      ],
      "parameters": {
        "width": 384,
        "height": 692,
        "content": "## 🌍 UI Messages\n\nTelegram menus:\n- Language selection\n- Photo request\n- Analysis options\n- Help text\n- Error messages\n\nAll localized in Config node"
      }
    },
    {
      "id": "ea106c90-9541-4a13-8456-ff3352714f3f",
      "name": "Route Switch",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1232,
        688
      ],
      "parameters": {
        "width": 308,
        "height": 1136,
        "content": "## 🔀 Route Switch\n\n**17 Actions:**\n\n| # | Action | Description |\n|---|--------|-------------|\n| 0 | show_lang | Language menu |\n| 1 | ask_photo | Request photo |\n| 2 | lang_selected | Save language |\n"
      }
    },
    {
      "id": "c5c73cb9-6b1b-472e-a7a7-7af0c63a689f",
      "name": "Config & Localization",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1472,
        1008
      ],
      "parameters": {
        "width": 220,
        "height": 808,
        "content": "## 🌐 Config\n\n**9 Languages:**\nDE, EN, RU, ES, FR, IT, PL, PT, UK\n\n**Contains:**\n- UI messages\n- Button labels\n- Currency symbols\n- Database mapping\n- System prompts\n\n**Auto-selects:**\n- Database by la"
      }
    },
    {
      "id": "95cda5bd-7882-4136-9027-e983b69967e9",
      "name": "Main Router",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1760,
        1008
      ],
      "parameters": {
        "width": 268,
        "height": 808,
        "content": "## 🧠 Main Router\n\nCentral message handler:\n\n**Input:** Telegram Update\n\n**Processing:**\n- Parse message/callback\n- Manage user sessions\n- Detect content type\n- Route to action\n\n**Output:**\n`action` → "
      }
    },
    {
      "id": "364cd5eb-f4f7-40b7-a981-c0051d4fb308",
      "name": "Checklist",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2544,
        1328
      ],
      "parameters": {
        "width": 324,
        "height": 428,
        "content": "## ✅ CHECKLIST\n\n**1. Telegram Bot**\n- [ ] Created via @BotFather\n- [ ] Token in 🔑 TOKEN\n- [ ] Credential configured\n\n**2. OpenAI**\n- [ ] API key obtained\n- [ ] Added to 🔑 TOKEN\n\n**3. Gemini/GPT-4**\n- "
      }
    },
    {
      "id": "89b7cc09-4159-4e5c-9354-aa2124b11219",
      "name": "Telegram Credentials",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2544,
        1776
      ],
      "parameters": {
        "width": 328,
        "height": 436,
        "content": "## ⚙️ Telegram Credentials\n\n### Setup n8n Credential:\n\n1. **Settings** → Credentials\n2. **Add** → Telegram API\n3. Enter Bot Token\n4. **Save**\n\n### Configure Trigger:\n1. Select credential in `Telegram "
      }
    },
    {
      "id": "e6f22398-fdf5-49de-b81a-570691e0809c",
      "name": "Intro",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2544,
        864
      ],
      "parameters": {
        "width": 318,
        "height": 440,
        "content": "## 🚀 DDC CWICR Pipeline\n### Construction Cost Estimation Bot\n\n**Version:** 10.3 Enhanced\n**Author:** DataDrivenConstruction.io\n\n**Features:**\n- 📷 Photo analysis (GPT-4 Vision / Gemini)\n- 📄 PDF floor p"
      }
    },
    {
      "id": "d6ebe802-df6f-4a4a-bb92-2e9d4349b19c",
      "name": "Agg",
      "type": "n8n-nodes-base.code",
      "position": [
        1008,
        2160
      ]
    },
    {
      "id": "bbbcfcaa-81de-4e05-98c1-c5c005c5f6b5",
      "name": "🗑️ Delete Progress Msg",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        832,
        2160
      ]
    },
    {
      "id": "5fdc516f-bc6b-4613-afb4-aac2d0863c82",
      "name": "🗑️ Delete Work Msg",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        640,
        2160
      ]
    },
    {
      "id": "085bef11-75f5-4b87-8d03-b48f0d35e029",
      "name": "🧹 Prep Cleanup",
      "type": "n8n-nodes-base.code",
      "position": [
        464,
        2160
      ]
    },
    {
      "id": "3f30a182-fa54-45fd-b259-01e60b1f9e09",
      "name": "Acc",
      "type": "n8n-nodes-base.code",
      "position": [
        1184,
        2960
      ]
    },
    {
      "id": "61587d91-08a4-4444-aa10-7412c1044888",
      "name": "📤 Edit Result",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1008,
        2960
      ]
    },
    {
      "id": "4f7a0cec-1f13-42f6-b667-521ffdf1a160",
      "name": "📊 Update Result",
      "type": "n8n-nodes-base.code",
      "position": [
        848,
        2960
      ]
    },
    {
      "id": "d9f47e58-5041-4e40-b83d-db1446c33788",
      "name": "1️⃣ Prep Query",
      "type": "n8n-nodes-base.code",
      "position": [
        1184,
        2560
      ]
    },
    {
      "id": "3f571e9d-54ec-4cbc-8d4a-016e98aa691a",
      "name": "💾 Save Work Msg",
      "type": "n8n-nodes-base.code",
      "position": [
        1008,
        2560
      ]
    },
    {
      "id": "5e4d6280-54eb-4003-abc6-0b1a65b85aeb",
      "name": "📤 Send Work",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        832,
        2560
      ]
    },
    {
      "id": "298424b6-a27f-4213-acfa-00355e55abf5",
      "name": "🗑️ Delete Prev",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        640,
        2560
      ]
    },
    {
      "id": "3d061508-ba4c-4138-83cc-4bdbf2b61d2a",
      "name": "📝 Prep Work Msg",
      "type": "n8n-nodes-base.code",
      "position": [
        464,
        2560
      ]
    },
    {
      "id": "b4a6f71f-4b4b-45a3-9e3b-b947849994e1",
      "name": "Loop",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        192,
        2256
      ]
    },
    {
      "id": "e6bef734-a432-4c92-8157-f4d0637457b2",
      "name": "Prep Works",
      "type": "n8n-nodes-base.code",
      "position": [
        -48,
        2256
      ]
    },
    {
      "id": "2861b910-50e2-4da2-b094-0729a451ffe3",
      "name": "Save Progress ID",
      "type": "n8n-nodes-base.code",
      "position": [
        -224,
        2256
      ]
    },
    {
      "id": "1ff11965-3d5d-4f71-a77d-2e826124348b",
      "name": "📤 Send Progress",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -432,
        2256
      ]
    },
    {
      "id": "ae966de2-9499-41b2-b042-6e6afd09c219",
      "name": "📝 Prep Progress",
      "type": "n8n-nodes-base.code",
      "position": [
        -672,
        2256
      ]
    },
    {
      "id": "cf55b185-8ee0-4fdd-ba0d-7871cefe27b2",
      "name": "📄 PDF Download Prep",
      "type": "n8n-nodes-base.code",
      "position": [
        -240,
        1696
      ]
    },
    {
      "id": "8ec32217-3765-43f0-97c3-bf93537fdcd6",
      "name": "🧹 Deduplicate & Merge",
      "type": "n8n-nodes-base.code",
      "position": [
        1968,
        1568
      ]
    },
    {
      "id": "82860aeb-1b85-4c4e-a97d-b22d3b6ddc4b",
      "name": "📤 Send Works",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2608,
        1328
      ]
    },
    {
      "id": "a90e8421-983b-4d69-b7ff-33209f45e184",
      "name": "📊 Show Works",
      "type": "n8n-nodes-base.code",
      "position": [
        2480,
        1472
      ]
    },
    {
      "id": "19a3735f-b966-48c3-a83e-5c0c9122fe0a",
      "name": "📦 Accumulate Pages",
      "type": "n8n-nodes-base.code",
      "position": [
        2208,
        1712
      ]
    },
    {
      "id": "37b2c0c2-0df0-4c52-a492-1516065d9e07",
      "name": "🏠 Parse PDF Page",
      "type": "n8n-nodes-base.code",
      "position": [
        1984,
        1712
      ]
    },
    {
      "id": "c060c9ed-960a-4dc5-a353-d7626525853e",
      "name": "👁️ Call Vision PDF",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1760,
        1712
      ]
    },
    {
      "id": "f5b2b616-d25f-4174-8f08-416deffe08f1",
      "name": "👁️ Prep Vision PDF",
      "type": "n8n-nodes-base.code",
      "position": [
        1536,
        1712
      ]
    },
    {
      "id": "452a8445-7f83-4adc-9bd4-74eb3269948c",
      "name": "🔁 Loop PDF Pages",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1328,
        1696
      ]
    },
    {
      "id": "01bc5a5b-160a-42b2-a70b-96bf101b50c1",
      "name": "📄 Prep Pages Loop",
      "type": "n8n-nodes-base.code",
      "position": [
        1104,
        1696
      ]
    },
    {
      "id": "65af249b-61c8-4e32-8ff3-85dc1a4c4849",
      "name": "📤 PDF Received",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        880,
        1696
      ]
    },
    {
      "id": "2744b78d-8522-4d10-964b-9c42471b3af8",
      "name": "📝 Prep PDF Message",
      "type": "n8n-nodes-base.code",
      "position": [
        656,
        1696
      ]
    },
    {
      "id": "668cea57-5db4-4e3c-80e0-b118fd7471de",
      "name": "📄 Split PDF Pages",
      "type": "n8n-nodes-base.code",
      "position": [
        448,
        1696
      ]
    },
    {
      "id": "04c81dbc-547c-4de3-9e26-2524a9ab85e9",
      "name": "📄 Download PDF",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        224,
        1696
      ]
    },
    {
      "id": "15cb3ffe-a7ca-4012-8818-cf3e5a546cf4",
      "name": "📄 Get PDF Path",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -16,
        1696
      ]
    },
    {
      "id": "7a2b25b7-a115-4f32-99cd-5533b51c48c6",
      "name": "Merge To Vision1",
      "type": "n8n-nodes-base.code",
      "position": [
        1008,
        1344
      ]
    },
    {
      "id": "ad2d437c-7f99-4804-a83e-c38bec553cfc",
      "name": "📤 No Photos Msg1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        832,
        1024
      ]
    },
    {
      "id": "0328789b-cbae-4e5f-b027-eba05a7c24bc",
      "name": "IF No Photos1",
      "type": "n8n-nodes-base.if",
      "position": [
        544,
        1072
      ]
    },
    {
      "id": "6d1879fc-9f72-45b6-bd17-808508e4c422",
      "name": "Merge Vision1",
      "type": "n8n-nodes-base.code",
      "position": [
        1472,
        1344
      ]
    },
    {
      "id": "7768ef04-9fa7-4ccf-8726-658d20b9d468",
      "name": "Call Vision1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1312,
        1344
      ]
    },
    {
      "id": "7d5ffd29-d8de-427e-8812-eb0d53b5b690",
      "name": "Prep Vision1",
      "type": "n8n-nodes-base.code",
      "position": [
        1168,
        1344
      ]
    },
    {
      "id": "edddbbbe-e972-4c44-b57f-9d1e86768a4a",
      "name": "Convert To Base",
      "type": "n8n-nodes-base.code",
      "position": [
        832,
        1344
      ]
    },
    {
      "id": "7a2d0390-802f-4f04-966b-3a9b87652ba2",
      "name": "Download Photo File1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        640,
        1344
      ]
    },
    {
      "id": "3cd89191-d2e5-4bfc-a156-959fb6282bba",
      "name": "Get File Path1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        464,
        1344
      ]
    },
    {
      "id": "bab03931-39fe-4a2e-9f86-7d05ccea2b46",
      "name": "Use Stored Base64",
      "type": "n8n-nodes-base.code",
      "position": [
        832,
        1184
      ]
    },
    {
      "id": "61ced79f-d12a-4285-96f4-31a3c6618574",
      "name": "IF Skip Download",
      "type": "n8n-nodes-base.if",
      "position": [
        272,
        1136
      ]
    },
    {
      "id": "545a0532-c51c-40e1-8b13-2995b21c189a",
      "name": "9️⃣ Calculate",
      "type": "n8n-nodes-base.code",
      "position": [
        640,
        2960
      ]
    },
    {
      "id": "7d3d1e50-0625-4d4e-91d4-099ea87aa29f",
      "name": "8️⃣ Apply Rerank",
      "type": "n8n-nodes-base.code",
      "position": [
        448,
        2960
      ]
    },
    {
      "id": "58b35003-2cb2-45bd-85b9-904880344e88",
      "name": "7️⃣ LLM Rerank",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1360,
        2768
      ]
    },
    {
      "id": "6e1e913c-995d-4f5a-843b-b567bb9bbd7b",
      "name": "6️⃣ Prep Rerank",
      "type": "n8n-nodes-base.code",
      "position": [
        1184,
        2768
      ]
    },
    {
      "id": "94286c7c-17c2-4aac-966b-c7de4510dbe2",
      "name": "5️⃣ Qdrant Search",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1008,
        2768
      ]
    },
    {
      "id": "0e9d4cda-40d3-40be-a3d3-4f545515878b",
      "name": "4️⃣ Extract Embedding",
      "type": "n8n-nodes-base.code",
      "position": [
        848,
        2768
      ]
    },
    {
      "id": "26067864-f69d-475d-a226-798f2cc85f2a",
      "name": "3️⃣ OpenAI Embedding",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        640,
        2768
      ]
    },
    {
      "id": "4b47c060-4955-48f8-8f30-fc86e71f8f65",
      "name": "2️⃣ Extract Transform",
      "type": "n8n-nodes-base.code",
      "position": [
        448,
        2768
      ]
    },
    {
      "id": "5e7573f6-e820-4169-94f8-38bcc976f455",
      "name": "1.5️⃣ LLM Transform",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1360,
        2560
      ]
    },
    {
      "id": "5730871f-d323-4bef-a6bc-df237d7c0120",
      "name": "Parse Text LLM",
      "type": "n8n-nodes-base.code",
      "position": [
        -656,
        1472
      ]
    },
    {
      "id": "9b1e2dcf-e28d-4757-843b-a084c2d67704",
      "name": "📤 Details",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -672,
        2560
      ]
    },
    {
      "id": "fd9ab335-40db-4a70-8d69-874eb71ca2ca",
      "name": "View Details",
      "type": "n8n-nodes-base.code",
      "position": [
        -864,
        2560
      ]
    },
    {
      "id": "55090509-0d4e-45ff-af52-159396c1e4e3",
      "name": "📤 Fallback",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -880,
        1904
      ]
    },
    {
      "id": "635465bb-9607-4542-af66-a84051bed2b4",
      "name": "📤 Help",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -864,
        2560
      ]
    },
    {
      "id": "cbdbf90f-6d11-4c5a-a535-846985347634",
      "name": "📤 Send PDF",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -432,
        2400
      ]
    },
    {
      "id": "24c92682-d981-4898-93f4-eec576ba3357",
      "name": "IF PDF",
      "type": "n8n-nodes-base.if",
      "position": [
        -672,
        2416
      ]
    },
    {
      "id": "64c08403-f77a-4c12-8b89-265c989c8446",
      "name": "Generate PDF",
      "type": "n8n-nodes-base.code",
      "position": [
        -864,
        2416
      ]
    },
    {
      "id": "44e37da4-e4bd-4d0e-bd22-210045d2fa91",
      "name": "📤 Send Excel",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -672,
        2720
      ]
    },
    {
      "id": "20dd2b37-f393-4676-a0ae-f51b771ee4e9",
      "name": "Generate Excel",
      "type": "n8n-nodes-base.code",
      "position": [
        -864,
        2720
      ]
    },
    {
      "id": "b5c3151e-c099-4212-96c3-09883d81e106",
      "name": "📤 Send HTML",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1648,
        2192
      ]
    },
    {
      "id": "421bf313-e942-4bf1-af81-1e43bbe47fb1",
      "name": "Prep HTML File",
      "type": "n8n-nodes-base.code",
      "position": [
        1488,
        2192
      ]
    },
    {
      "id": "43c8bf7d-505f-4938-bb0e-acd88c2c9369",
      "name": "📤 Final",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1488,
        2032
      ]
    },
    {
      "id": "20facbec-b1db-4de1-8f13-5a9c83ec08cb",
      "name": "Final",
      "type": "n8n-nodes-base.code",
      "position": [
        1344,
        2160
      ]
    },
    {
      "id": "27f841fe-3dda-4479-935c-ea27db52b85f",
      "name": "Generate HTML",
      "type": "n8n-nodes-base.code",
      "position": [
        1184,
        2160
      ]
    },
    {
      "id": "b5ce02bc-1d4b-49ff-bd34-2244ca2a542a",
      "name": "Answer Calc CB",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -864,
        2256
      ]
    },
    {
      "id": "a508aba4-0189-4dbb-b9e2-c0cbceb288fd",
      "name": "📤 Works Updated",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -672,
        2064
      ]
    },
    {
      "id": "2893b600-dbe5-40d7-be75-25e07c87a22f",
      "name": "Works Updated",
      "type": "n8n-nodes-base.code",
      "position": [
        -880,
        2064
      ]
    },
    {
      "id": "604b8dbf-163c-48eb-ba40-9bea7e6575db",
      "name": "📤 Ask New Work",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -656,
        1072
      ]
    },
    {
      "id": "8eefdc4b-08b6-4687-90f8-d8ef271696f5",
      "name": "Edit Menu",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -896,
        928
      ],
      "parameters": {
        "width": 384,
        "height": 296,
        "content": "## ✏️ Edit Menu\n\n**Quantity controls:**\n- +1, -1, +10, -10\n- ×2, ÷2\n\n**Actions:**\n- 🗑️ Delete work\n- ✅ Done editing\n- ➕ Add new work\n\n**Data:** Stored in StaticData"
      }
    },
    {
      "id": "f0f0edf2-e07a-45ca-8d9b-46484d615b53",
      "name": "Parse AI",
      "type": "n8n-nodes-base.code",
      "position": [
        1648,
        1344
      ]
    },
    {
      "id": "b30de9b7-9827-42ce-876e-ec17088f593d",
      "name": "📤 Analyze Options",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -656,
        944
      ]
    },
    {
      "id": "afd0f5c5-af51-47bf-94a6-40ba84787303",
      "name": "📤 Ask Photo",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -656,
        752
      ]
    },
    {
      "id": "fd178d4c-5b34-4612-a1a6-dfd0ad2156b2",
      "name": "Answer Photo CB",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -864,
        752
      ]
    },
    {
      "id": "0b768ae2-44f4-46b7-931a-381da810420e",
      "name": "📤 Lang OK",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -656,
        608
      ]
    },
    {
      "id": "bc394458-02ef-43d9-9f6f-6332699bbafa",
      "name": "Answer Lang CB",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -864,
        608
      ]
    },
    {
      "id": "4c826493-5537-4a95-a765-f35a00d2014a",
      "name": "📤 Lang Menu",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -864,
        464
      ]
    },
    {
      "id": "3129142d-9018-4611-bec3-9f80d90e43f1",
      "name": "Route",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1216,
        1136
      ]
    },
    {
      "id": "835a5db4-f0e0-45c4-9e7d-c9ef1a7f465c",
      "name": "Config",
      "type": "n8n-nodes-base.code",
      "position": [
        -1424,
        1392
      ]
    },
    {
      "id": "a0234943-000e-42fb-9a75-0432dbd3b71a",
      "name": "Main",
      "type": "n8n-nodes-base.code",
      "position": [
        -1680,
        1392
      ]
    },
    {
      "id": "a73da24e-48b2-4d5d-910a-a0ad3b914f8e",
      "name": "🔑 TOKEN",
      "type": "n8n-nodes-base.set",
      "position": [
        -1952,
        1392
      ]
    },
    {
      "id": "32aae0b5-4d2a-4aa2-8e6c-f0d5fdef483f",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -2144,
        1392
      ]
    },
    {
      "id": "10bf7718-bc60-478d-abcd-e7347b36d09f",
      "name": "Block 4 - Vision",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        848
      ],
      "parameters": {
        "width": 2248,
        "height": 644,
        "content": "## 👁️ Block 4: Vision Analysis Pipeline\n\n**Photo Analysis Flow:**\n```\nRefine → Prep Download → Get File → Download → Convert Base64 → Merge → Prep Vision → Call API → Parse AI → Show Works\n```\n\n**AI P"
      }
    },
    {
      "id": "547f468a-a1cc-4607-a160-cb24594665cf",
      "name": "Block 5 - PDF",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        1536
      ],
      "parameters": {
        "width": 2896,
        "height": 312,
        "content": "## 📄 Block 5: PDF Floor Plan Processing\n\n**PDF Pipeline:**\n```\nDownload Prep → Get Path → Download → Split Pages → Loop → Vision per Page → Parse → Accumulate\n```\n\n**Features:**\n- Multi-page PDF suppo"
      }
    },
    {
      "id": "4aa87cec-13e9-4c06-b6d7-7bd0d02505a2",
      "name": "Block 6 - Calculation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        96,
        2384
      ],
      "parameters": {
        "width": 1728,
        "height": 724,
        "content": "## 🔄 Block 6: Calculation Loop\n\n**Per Work Item:**\n```\nPrep Query → LLM Transform → Embedding → Qdrant Search → Rerank → Calculate → Update Result → Accumulate\n```\n\n**Vector Search:**\n- OpenAI embeddi"
      }
    },
    {
      "id": "99c168d5-2470-4153-bbb6-e46bc81ebba4",
      "name": "Block 7 - Reports",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        96,
        1936
      ],
      "parameters": {
        "width": 1720,
        "height": 420,
        "content": "## 📊 Block 7: Aggregation & Reports\n\n**Final Processing:**\n```\nCleanup → Delete Messages → Aggregate → Generate HTML → Final Message → Send HTML\n```\n\n**Report Contents:**\n- Work items with resources\n-"
      }
    },
    {
      "id": "8518453e-cbde-4a6a-a6b3-3e40daa9a511",
      "name": "Block 8 - Export",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1248,
        2208
      ],
      "parameters": {
        "width": 1320,
        "height": 692,
        "content": "## 📥 Block 8: Export Options\n\n**Available Exports:**\n- 📊 **Excel (CSV)** — Spreadsheet format\n- 📄 **PDF** — Professional document\n- 🌐 **HTML** — Interactive report\n\n**View Details:**\n- Full resource b"
      }
    },
    {
      "id": "eaf3c968-6165-4e51-9418-fb55243ca68d",
      "name": "Qdrant Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1568,
        2704
      ],
      "parameters": {
        "width": 236,
        "height": 384,
        "content": "## 🔍 Vector Search Setup\n\n**Qdrant Collections:**\n- `DDC_CWICR_DE` — German\n- `DDC_CWICR_EN` — English  \n- `DDC_CWICR_RU` — Russian\n- ... (9 languages total)\n\n**To enable:**\n1. Install Qdrant locally/"
      }
    },
    {
      "id": "fb3a5397-d567-4fc9-9320-0c0f5b84cce6",
      "name": "Refine Analysis",
      "type": "n8n-nodes-base.code",
      "position": [
        -320,
        1184
      ]
    },
    {
      "id": "743f34f4-4130-46c5-97d9-db79ab95da7d",
      "name": "IF Skip Refine",
      "type": "n8n-nodes-base.if",
      "position": [
        -176,
        1120
      ]
    },
    {
      "id": "bc87508c-2997-4a43-83e9-7a117c7444f0",
      "name": "📤 Ask Photo Refine",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        32,
        992
      ]
    },
    {
      "id": "fdcf8603-4a6e-40dd-9b41-0ad4ab68203a",
      "name": "Prep Photo Download",
      "type": "n8n-nodes-base.code",
      "position": [
        32,
        1136
      ]
    },
    {
      "id": "ab7e8b09-6672-400e-8a7f-295a54816079",
      "name": "Prep Text LLM",
      "type": "n8n-nodes-base.code",
      "position": [
        -1056,
        1472
      ]
    },
    {
      "id": "5054346e-8316-4c37-93a8-af028b02b605",
      "name": "Call Text LLM",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -856,
        1472
      ]
    },
    {
      "id": "87e2e087-b1aa-4a34-9c13-8f457cec3a5d",
      "name": "Edit Menu",
      "type": "n8n-nodes-base.code",
      "position": [
        -864,
        2080
      ]
    },
    {
      "id": "eaaa85c6-b3a5-4569-b5af-d22d08511024",
      "name": "📤 Edit Menu",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -672,
        2080
      ]
    }
  ],
  "connections": {
    "Acc": {
      "main": [
        [
          {
            "node": "Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Agg": {
      "main": [
        [
          {
            "node": "Generate HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop": {
      "main": [
        [
          {
            "node": "🧹 Prep Cleanup",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "📝 Prep Work Msg",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Main": {
      "main": [
        [
          {
            "node": "Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Final": {
      "main": [
        [
          {
            "node": "Prep HTML File",
            "type": "main",
            "index": 0
          },
          {
            "node": "📤 Final",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route": {
      "main": [
        [
          {
            "node": "📤 Lang Menu",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Answer Lang CB",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Answer Photo CB",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "📤 Analyze Options",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "📤 Analyze Options",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Refine Analysis",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Works Updated",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Edit Menu",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "📤 Ask New Work",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Answer Calc CB",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Generate Excel",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Generate PDF",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "📤 Help",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "View Details",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Refine Analysis",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prep Text LLM",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "📄 PDF Download Prep",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "📤 Fallback",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Config": {
      "main": [
        [
          {
            "node": "Route",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF PDF": {
      "main": [
        [
          {
            "node": "📤 Send PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI": {
      "main": [
        [
          {
            "node": "📊 Show Works",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Menu": {
      "main": [
        [
          {
            "node": "📤 Edit Menu",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prep Works": {
      "main": [
        [
          {
            "node": "Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🔑 TOKEN": {
      "main": [
        [
          {
            "node": "Main",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call Vision1": {
      "main": [
        [
          {
            "node": "Merge Vision1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate PDF": {
      "main": [
        [
          {
            "node": "IF PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prep Vision1": {
      "main": [
        [
          {
            "node": "Call Vision1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "View Details": {
      "main": [
        [
          {
            "node": "📤 Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call Text LLM": {
      "main": [
        [
          {
            "node": "Parse Text LLM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate HTML": {
      "main": [
        [
          {
            "node": "Final",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF No Photos1": {
      "main": [
        [
          {
            "node": "📤 No Photos Msg1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Use Stored Base64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Vision1": {
      "main": [
        [
          {
            "node": "Parse AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prep Text LLM": {
      "main": [
        [
          {
            "node": "Call Text LLM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Works Updated": {
      "main": [
        [
          {
            "node": "📤 Works Updated",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Answer Calc CB": {
      "main": [
        [
          {
            "node": "📝 Prep Progress",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Answer Lang CB": {
      "main": [
        [
          {
            "node": "📤 Lang OK",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Excel": {
      "main": [
        [
          {
            "node": "📤 Send Excel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get File Path1": {
      "main": [
        [
          {
            "node": "Download Photo File1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Skip Refine": {
      "main": [
        [
          {
            "node": "📤 Ask Photo Refine",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prep Photo Download",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Text LLM": {
      "main": [
        [
          {
            "node": "📊 Show Works",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prep HTML File": {
      "main": [
        [
          {
            "node": "📤 Send HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📤 Send Work": {
      "main": [
        [
          {
            "node": "💾 Save Work Msg",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Answer Photo CB": {
      "main": [
        [
          {
            "node": "📤 Ask Photo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert To Base": {
      "main": [
        [
          {
            "node": "Merge To Vision1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Refine Analysis": {
      "main": [
        [
          {
            "node": "IF Skip Refine",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📊 Show Works": {
      "main": [
        [
          {
            "node": "📤 Send Works",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Skip Download": {
      "main": [
        [
          {
            "node": "IF No Photos1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get File Path1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge To Vision1": {
      "main": [
        [
          {
            "node": "Prep Vision1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Progress ID": {
      "main": [
        [
          {
            "node": "Prep Works",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "🔑 TOKEN",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📤 Edit Result": {
      "main": [
        [
          {
            "node": "Acc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9️⃣ Calculate": {
      "main": [
        [
          {
            "node": "📊 Update Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Use Stored Base64": {
      "main": [
        [
          {
            "node": "Merge To Vision1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📄 Download PDF": {
      "main": [
        [
          {
            "node": "📄 Split PDF Pages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📄 Get PDF Path": {
      "main": [
        [
          {
            "node": "📄 Download PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📤 PDF Received": {
      "main": [
        [
          {
            "node": "📄 Prep Pages Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🧹 Prep Cleanup": {
      "main": [
        [
          {
            "node": "🗑️ Delete Work Msg",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1️⃣ Prep Query": {
      "main": [
        [
          {
            "node": "1.5️⃣ LLM Transform",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7️⃣ LLM Rerank": {
      "main": [
        [
          {
            "node": "8️⃣ Apply Rerank",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "💾 Save Work Msg": {
      "main": [
        [
          {
            "node": "1️⃣ Prep Query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📊 Update Result": {
      "main": [
        [
          {
            "node": "📤 Edit Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📝 Prep Progress": {
      "main": [
        [
          {
            "node": "📤 Send Progress",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📝 Prep Work Msg": {
      "main": [
        [
          {
            "node": "🗑️ Delete Prev",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📤 Send Progress": {
      "main": [
        [
          {
            "node": "Save Progress ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6️⃣ Prep Rerank": {
      "main": [
        [
          {
            "node": "7️⃣ LLM Rerank",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prep Photo Download": {
      "main": [
        [
          {
            "node": "IF Skip Download",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🏠 Parse PDF Page": {
      "main": [
        [
          {
            "node": "📦 Accumulate Pages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🔁 Loop PDF Pages": {
      "main": [
        [
          {
            "node": "🧹 Deduplicate & Merge",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "👁️ Prep Vision PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🗑️ Delete Prev": {
      "main": [
        [
          {
            "node": "📤 Send Work",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "8️⃣ Apply Rerank": {
      "main": [
        [
          {
            "node": "9️⃣ Calculate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Photo File1": {
      "main": [
        [
          {
            "node": "Convert To Base",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📄 Prep Pages Loop": {
      "main": [
        [
          {
            "node": "🔁 Loop PDF Pages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📄 Split PDF Pages": {
      "main": [
        [
          {
            "node": "📝 Prep PDF Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5️⃣ Qdrant Search": {
      "main": [
        [
          {
            "node": "6️⃣ Prep Rerank",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📝 Prep PDF Message": {
      "main": [
        [
          {
            "node": "📤 PDF Received",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📦 Accumulate Pages": {
      "main": [
        [
          {
            "node": "🔁 Loop PDF Pages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📄 PDF Download Prep": {
      "main": [
        [
          {
            "node": "📄 Get PDF Path",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1.5️⃣ LLM Transform": {
      "main": [
        [
          {
            "node": "2️⃣ Extract Transform",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "👁️ Call Vision PDF": {
      "main": [
        [
          {
            "node": "🏠 Parse PDF Page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "👁️ Prep Vision PDF": {
      "main": [
        [
          {
            "node": "👁️ Call Vision PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🗑️ Delete Work Msg": {
      "main": [
        [
          {
            "node": "🗑️ Delete Progress Msg",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3️⃣ OpenAI Embedding": {
      "main": [
        [
          {
            "node": "4️⃣ Extract Embedding",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🧹 Deduplicate & Merge": {
      "main": [
        [
          {
            "node": "📊 Show Works",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2️⃣ Extract Transform": {
      "main": [
        [
          {
            "node": "3️⃣ OpenAI Embedding",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4️⃣ Extract Embedding": {
      "main": [
        [
          {
            "node": "5️⃣ Qdrant Search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🗑️ Delete Progress Msg": {
      "main": [
        [
          {
            "node": "Agg",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}