{
  "name": "Estimate Construction Costs from Revit/IFC Models with GPT-4 and Claude",
  "nodes": [
    {
      "id": "44ac22bc-92ff-450d-ac53-b2b587cc0318",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        944,
        -64
      ]
    },
    {
      "id": "2b81e046-ebc1-4687-8fd2-b9d2a3347a12",
      "name": "Find Category Fields1",
      "type": "n8n-nodes-base.code",
      "position": [
        1360,
        768
      ]
    },
    {
      "id": "65f07357-2e47-41ac-87ee-43d692b7511d",
      "name": "Apply Classification to Groups1",
      "type": "n8n-nodes-base.code",
      "position": [
        1872,
        832
      ]
    },
    {
      "id": "50462cce-7978-4147-b215-25749d3bbf79",
      "name": "Non-Building Elements Output1",
      "type": "n8n-nodes-base.set",
      "position": [
        2272,
        848
      ]
    },
    {
      "id": "93e37bf0-a126-4174-9bc6-a8a5378885a1",
      "name": "AI Classify Categories1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1536,
        832
      ]
    },
    {
      "id": "2adc7c4e-1133-43bd-a3b8-8648a95861be",
      "name": "Is Building Element1",
      "type": "n8n-nodes-base.if",
      "position": [
        2064,
        832
      ]
    },
    {
      "id": "a6b94ddd-8674-4072-8bb0-f2a813b4c042",
      "name": "Check If All Batches Done",
      "type": "n8n-nodes-base.if",
      "position": [
        1024,
        1280
      ]
    },
    {
      "id": "6a62ad33-7c47-495d-b81b-3be78ae0cd81",
      "name": "Collect All Results",
      "type": "n8n-nodes-base.code",
      "position": [
        1200,
        1568
      ]
    },
    {
      "id": "e3ab164d-d34c-4415-9ecc-d1e2dcd35ebe",
      "name": "Process in Batches1",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1184,
        1152
      ]
    },
    {
      "id": "b1504e4e-6a04-4014-aeed-b38dbaa9b12d",
      "name": "Clean Empty Values1",
      "type": "n8n-nodes-base.code",
      "position": [
        1360,
        1152
      ]
    },
    {
      "id": "d152a0a9-71c9-4532-9743-15225429bcc8",
      "name": "AI Agent Enhanced",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1712,
        1152
      ]
    },
    {
      "id": "72e3dd39-013c-43b4-a0e1-9ce4167d37f0",
      "name": "Accumulate Results",
      "type": "n8n-nodes-base.code",
      "position": [
        2288,
        1264
      ]
    },
    {
      "id": "7f62341e-e758-4664-aa1d-62cdba49cd84",
      "name": "Anthropic Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        1472,
        1312
      ]
    },
    {
      "id": "dfb09d43-49c8-47be-af77-e3bef30a5053",
      "name": "Calculate Project Totals1",
      "type": "n8n-nodes-base.code",
      "position": [
        1376,
        1568
      ]
    },
    {
      "id": "4d061758-4051-4bcc-85db-d7ed7fa06ec7",
      "name": "Enhance Excel Output",
      "type": "n8n-nodes-base.code",
      "position": [
        1936,
        1744
      ]
    },
    {
      "id": "d006c84f-3df6-493e-8965-2552f06cc862",
      "name": "Prepare Excel Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1600,
        1744
      ]
    },
    {
      "id": "b55dc4f5-1309-4a06-9924-d796733a21f5",
      "name": "Create Excel File",
      "type": "n8n-nodes-base.spreadsheetFile",
      "position": [
        1760,
        1744
      ]
    },
    {
      "id": "750047a0-76ea-41a6-8e6e-83447eaef026",
      "name": "Prepare Enhanced Prompts",
      "type": "n8n-nodes-base.code",
      "position": [
        1536,
        1152
      ]
    },
    {
      "id": "f5d3ae3d-68fe-43e3-a6df-4bed5a82aefa",
      "name": "Parse Enhanced Response",
      "type": "n8n-nodes-base.code",
      "position": [
        2064,
        1152
      ]
    },
    {
      "id": "428bb655-a1e9-45df-a80c-57c00810e5e9",
      "name": "Generate HTML Report",
      "type": "n8n-nodes-base.code",
      "position": [
        1600,
        1568
      ]
    },
    {
      "id": "e99d0ff0-79ea-4ed1-9878-a23986efe41b",
      "name": "Convert to Binary",
      "type": "n8n-nodes-base.code",
      "position": [
        1776,
        1568
      ]
    },
    {
      "id": "80908a5f-3838-4f47-b579-cadb189cea31",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        224,
        432
      ],
      "parameters": {
        "width": 340,
        "height": 116,
        "content": "⭐ **If you find our tools helpful**, please consider **starring our repository** on [GitHub](https://github.com/datadrivenconstruction/cad2data-Revit-IFC-DWG-DGN-pipeline-with-conversion-validation-qt"
      }
    },
    {
      "id": "478155e4-eb87-4684-9546-871dfb3577f0",
      "name": "Group Data with AI Rules1",
      "type": "n8n-nodes-base.code",
      "position": [
        2256,
        544
      ]
    },
    {
      "id": "45d8e0e5-591b-4469-9766-501806e5f7a1",
      "name": "Extract Headers and Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1584,
        544
      ]
    },
    {
      "id": "d501723a-bf02-4e1b-8f24-5811500868f4",
      "name": "AI Analyze All Headers",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1728,
        544
      ]
    },
    {
      "id": "03b8267f-6ff1-4793-8a03-1c8ba934dbe9",
      "name": "Read Excel File1",
      "type": "n8n-nodes-base.readBinaryFile",
      "position": [
        1216,
        544
      ]
    },
    {
      "id": "b265c8fd-6d6b-49a1-802f-e25598569273",
      "name": "Parse Excel1",
      "type": "n8n-nodes-base.spreadsheetFile",
      "position": [
        1408,
        544
      ]
    },
    {
      "id": "4430c041-3a5d-4235-b092-fcd6c7b4a0ba",
      "name": "Create - Excel filename1",
      "type": "n8n-nodes-base.set",
      "position": [
        1376,
        -64
      ]
    },
    {
      "id": "7ff93cb0-8c5a-4dfb-97d0-3caaa1940bc8",
      "name": "Check - Does Excel file exist?1",
      "type": "n8n-nodes-base.readBinaryFile",
      "position": [
        1568,
        -64
      ]
    },
    {
      "id": "93cc0ed5-4eac-4907-8638-65010834605a",
      "name": "If - File exists?1",
      "type": "n8n-nodes-base.if",
      "position": [
        1744,
        -64
      ]
    },
    {
      "id": "85ead84d-193e-46c0-9d9f-9ccc07f2518b",
      "name": "Extract - Run converter1",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        1504,
        144
      ]
    },
    {
      "id": "8b6b3e88-90b9-4dbc-81fd-9aa8378f8981",
      "name": "Info - Skip conversion1",
      "type": "n8n-nodes-base.set",
      "position": [
        1936,
        -80
      ]
    },
    {
      "id": "5b2c4e88-5254-4682-a1d2-8f200952fba4",
      "name": "Check - Did extraction succeed?1",
      "type": "n8n-nodes-base.if",
      "position": [
        1712,
        144
      ]
    },
    {
      "id": "672e73cc-d8a8-4033-8b7a-347ef46ba89a",
      "name": "Error - Show what went wrong1",
      "type": "n8n-nodes-base.set",
      "position": [
        1936,
        80
      ]
    },
    {
      "id": "a99bdd3b-76e0-4517-8258-c78f009d0653",
      "name": "Set xlsx_filename after success1",
      "type": "n8n-nodes-base.set",
      "position": [
        1936,
        256
      ]
    },
    {
      "id": "c60ea846-191c-43d1-a883-131524e2f152",
      "name": "Merge - Continue workflow1",
      "type": "n8n-nodes-base.merge",
      "position": [
        2128,
        -16
      ]
    },
    {
      "id": "642d6337-d6a4-4079-ba9d-f42b7c69286f",
      "name": "Set Parameters1",
      "type": "n8n-nodes-base.set",
      "position": [
        2272,
        272
      ]
    },
    {
      "id": "52e54e39-139e-4985-a654-fce750204100",
      "name": "Process AI Response1",
      "type": "n8n-nodes-base.code",
      "position": [
        2064,
        544
      ]
    },
    {
      "id": "0cb35fda-f4ee-4428-9bfa-a6630519908e",
      "name": "Price Analysis and Reporting Block1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        1504
      ],
      "parameters": {
        "width": 1920,
        "height": 448,
        "content": "## Block 4: Price Calculation & Reporting\nThis block:\n- Estimates costs using material types, volumes/areas, and online price searches\n- Creates charts: pie for material distribution, bar for top cost"
      }
    },
    {
      "id": "77e86578-5835-4b05-9ed0-0cf4789f9e73",
      "name": "Element Classification Block",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        752
      ],
      "parameters": {
        "width": 1920,
        "height": 320,
        "content": "## Block 2: Element Classification\nThis block:\n- Detects category fields (e.g., Category, IFC Type)\n- Uses AI to classify as building elements (e.g., walls, doors) \nor non-building (e.g., annotations,"
      }
    },
    {
      "id": "a96c6ebe-b70a-444e-bbff-10db7b42be76",
      "name": "Material Analysis Block",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        1088
      ],
      "parameters": {
        "width": 1920,
        "height": 400,
        "content": "## Block 3: Material Analysis\nThis block:\n- Processes building elements in batches\n- Classifies materials by EU/DE/US standards\n- Determines units (m³, m², etc.) and densities\n- Uses AI (Anthropic) fo"
      }
    },
    {
      "id": "20b27e18-a7bd-491d-9972-6a096633b6ed",
      "name": "Conversion Block",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        -272
      ],
      "parameters": {
        "width": 1912,
        "height": 708,
        "content": "## Conversion Block\nThis block:\n- Checks if Excel file exists from Revit project\n- If not, runs converter to extract data\n- If yes, skips to save time\n\nSimply: Converts Revit file to Excel for analysi"
      }
    },
    {
      "id": "3bd50143-1a76-4ae4-8e4a-904375a45201",
      "name": "Data Loading Block1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        464
      ],
      "parameters": {
        "width": 1920,
        "height": 272,
        "content": "## Block 1: Data Loading & Grouping\nThis block:\n- Loads Excel data\n- Cleans headers\n- Uses AI to decide aggregation (sum for quantities, mean for rates, first for texts)\n- Groups data by parameter (e."
      }
    },
    {
      "id": "95340b29-d6b6-4aa4-b850-4166f1ff186e",
      "name": "Important Notes",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        224,
        128
      ],
      "parameters": {
        "width": 336,
        "height": 288,
        "content": "## ⚠️ Important Information\n\n- Pipeline uses AI (OpenAI, Grok, Anthropic) - check credits and limits.\n- Revit converter requires downloaded DDC_Converter_Revit\n- Data is aggregated by groups, volumes "
      }
    },
    {
      "id": "9887f607-85f0-41d5-92d8-9c6e655f6581",
      "name": "Prepare HTML Path",
      "type": "n8n-nodes-base.code",
      "position": [
        1936,
        1568
      ]
    },
    {
      "id": "24be1fea-bdcb-491b-afb8-170431f8f198",
      "name": "Write HTML to Project Folder",
      "type": "n8n-nodes-base.writeBinaryFile",
      "position": [
        2112,
        1568
      ]
    },
    {
      "id": "c4d015d4-b040-4aa7-a4c5-cc22d3ab7eb4",
      "name": "Open HTML in Browser",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        2288,
        1568
      ]
    },
    {
      "id": "01bcb7a4-534b-46ee-9462-b8f1aaf813e8",
      "name": "Prepare Excel Path1",
      "type": "n8n-nodes-base.code",
      "position": [
        2112,
        1744
      ]
    },
    {
      "id": "694efc44-ce97-44d1-a34d-84fce917a0e9",
      "name": "Write Excel to Project Folder1",
      "type": "n8n-nodes-base.writeBinaryFile",
      "position": [
        2288,
        1744
      ]
    },
    {
      "id": "297ac011-ea69-4975-b9e5-e14a1b6730b9",
      "name": "Setup - Define file paths",
      "type": "n8n-nodes-base.set",
      "position": [
        1168,
        -64
      ]
    },
    {
      "id": "a2363cf4-bd62-410c-a52b-e5d2c4760940",
      "name": "Conversion Block1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        -400
      ],
      "parameters": {
        "width": 952,
        "height": 112,
        "content": "# Project Cost Calculation for Revit and IFC with AI (LLM) \nDataDrivenConstruction [GitHub](https://github.com/datadrivenconstruction/cad2data-Revit-IFC-DWG-DGN-pipeline-with-conversion-validation-qto"
      }
    },
    {
      "id": "0af0bac5-4f11-4a99-bc74-0d99827754cb",
      "name": "Setup Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        224,
        -272
      ],
      "parameters": {
        "width": 336,
        "height": 384,
        "content": "## 📝 Setup Instructions\n\n1. In the 'Setup - Define file paths' node, specify:\n   - Path to converter (RvtExporter.exe)\n   - Path to project file (.rvt)\n   - Grouping parameter (group_by, e.g. 'Type Na"
      }
    },
    {
      "id": "b2243495-e0c0-4bd7-8118-701d33d20c6f",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1616,
        1312
      ]
    },
    {
      "id": "2c6de4d3-cf23-4748-aff3-2bdc1f602ae5",
      "name": "xAI Grok Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatXAiGrok",
      "position": [
        1776,
        1312
      ]
    },
    {
      "id": "80f0dd52-efa5-45ce-9812-d75ec19d9fb0",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1104,
        -240
      ],
      "parameters": {
        "width": 224,
        "height": 368,
        "content": "## ⬇️ Only modify the variables here  \n— everything else works automatically"
      }
    },
    {
      "id": "9d8c252c-4dd6-434e-a3c6-18f7a0b1d2e5",
      "name": "On the standard 3D View",
      "type": "n8n-nodes-base.if",
      "position": [
        1184,
        816
      ]
    },
    {
      "id": "549c23ba-0839-4221-9401-fc4b63011211",
      "name": "Non-3D View Elements Output",
      "type": "n8n-nodes-base.set",
      "position": [
        1360,
        912
      ]
    }
  ],
  "connections": {
    "Parse Excel1": {
      "main": [
        [
          {
            "node": "Extract Headers and Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Parameters1": {
      "main": [
        [
          {
            "node": "Read Excel File1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Excel File1": {
      "main": [
        [
          {
            "node": "Parse Excel1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent Enhanced": {
      "main": [
        [
          {
            "node": "Parse Enhanced Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to Binary": {
      "main": [
        [
          {
            "node": "Prepare HTML Path",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Excel File": {
      "main": [
        [
          {
            "node": "Enhance Excel Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare HTML Path": {
      "main": [
        [
          {
            "node": "Write HTML to Project Folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Accumulate Results": {
      "main": [
        [
          {
            "node": "Check If All Batches Done",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If - File exists?1": {
      "main": [
        [
          {
            "node": "Info - Skip conversion1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract - Run converter1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Excel Data": {
      "main": [
        [
          {
            "node": "Create Excel File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean Empty Values1": {
      "main": [
        [
          {
            "node": "Prepare Enhanced Prompts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Collect All Results": {
      "main": [
        [
          {
            "node": "Calculate Project Totals1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Excel Path1": {
      "main": [
        [
          {
            "node": "Write Excel to Project Folder1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process in Batches1": {
      "main": [
        [
          {
            "node": "Clean Empty Values1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enhance Excel Output": {
      "main": [
        [
          {
            "node": "Prepare Excel Path1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate HTML Report": {
      "main": [
        [
          {
            "node": "Convert to Binary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Building Element1": {
      "main": [
        [
          {
            "node": "Process in Batches1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Non-Building Elements Output1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process AI Response1": {
      "main": [
        [
          {
            "node": "Group Data with AI Rules1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent Enhanced",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Find Category Fields1": {
      "main": [
        [
          {
            "node": "AI Classify Categories1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Analyze All Headers": {
      "main": [
        [
          {
            "node": "Process AI Response1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Classify Categories1": {
      "main": [
        [
          {
            "node": "Apply Classification to Groups1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Info - Skip conversion1": {
      "main": [
        [
          {
            "node": "Merge - Continue workflow1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On the standard 3D View": {
      "main": [
        [
          {
            "node": "Find Category Fields1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Non-3D View Elements Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Enhanced Response": {
      "main": [
        [
          {
            "node": "Accumulate Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create - Excel filename1": {
      "main": [
        [
          {
            "node": "Check - Does Excel file exist?1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract - Run converter1": {
      "main": [
        [
          {
            "node": "Check - Did extraction succeed?1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Headers and Data": {
      "main": [
        [
          {
            "node": "AI Analyze All Headers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Enhanced Prompts": {
      "main": [
        [
          {
            "node": "AI Agent Enhanced",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Project Totals1": {
      "main": [
        [
          {
            "node": "Prepare Excel Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Generate HTML Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If All Batches Done": {
      "main": [
        [
          {
            "node": "Collect All Results",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Process in Batches1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Group Data with AI Rules1": {
      "main": [
        [
          {
            "node": "On the standard 3D View",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Setup - Define file paths": {
      "main": [
        [
          {
            "node": "Create - Excel filename1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge - Continue workflow1": {
      "main": [
        [
          {
            "node": "Set Parameters1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write HTML to Project Folder": {
      "main": [
        [
          {
            "node": "Open HTML in Browser",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Error - Show what went wrong1": {
      "main": [
        [
          {
            "node": "Merge - Continue workflow1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Apply Classification to Groups1": {
      "main": [
        [
          {
            "node": "Is Building Element1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check - Does Excel file exist?1": {
      "main": [
        [
          {
            "node": "If - File exists?1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check - Did extraction succeed?1": {
      "main": [
        [
          {
            "node": "Error - Show what went wrong1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set xlsx_filename after success1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set xlsx_filename after success1": {
      "main": [
        [
          {
            "node": "Merge - Continue workflow1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Setup - Define file paths",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}