n8n-cost-estimation
Build n8n pipeline for automated cost estimation from Revit/IFC using DDC CWICR database and LLM classification.
What this skill does
# Automated Cost Estimation Pipeline
## Business Case
### Problem Statement
Traditional cost estimation requires:
- Manual work item lookup in price databases
- Time-consuming element classification
- Expert knowledge of pricing standards
- Repetitive data entry
### Solution
Free open-source n8n pipeline that converts CAD (Revit 2015-2026) files into full cost and time estimates using AI (LLM) and vector database with 55,000+ work items.
### Business Value
| Traditional Role | Automated Alternative |
|-----------------|----------------------|
| BIM Manager manually exports data | Pipeline auto-classifies elements |
| Junior Estimator searches databases | Vector search finds matches in ms |
| Senior Estimator maps assemblies | LLM identifies quantity parameters |
| Foreman calculates labor hours | DDC CWICR contains documented norms |
| Project Manager aggregates costs | Pipeline outputs phased breakdown |
**Processing speed**: 3-10 seconds per element group
## Technical Implementation
### Pipeline Architecture
```
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Revit/IFC │───>│ CAD2DATA │───>│ Structured │
│ File │ │ Converter │ │ Excel/CSV │
└─────────────┘ └─────────────┘ └─────────────┘
│
▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Cost Report │<───│ Price Match │<───│ LLM Class. │
│ HTML/Excel │ │ DDC CWICR │ │ + QTO │
└─────────────┘ └─────────────┘ └─────────────┘
```
### n8n Pipeline Steps
#### 1. File Conversion Node
```javascript
// Execute CAD converter
const filePath = $input.first().json.file_path;
const outputDir = filePath.replace(/\.[^.]+$/, '');
const command = `RvtExporter.exe "${filePath}" complete bbox`;
// Returns: { xlsx_path, dae_path }
```
#### 2. Load Elements
```javascript
// Read converted Excel into n8n
const xlsx = $node["Read Binary Files"].json;
const elements = xlsx.sheets["Elements"];
// Group by category for processing
const grouped = elements.reduce((acc, el) => {
const cat = el.Category;
if (!acc[cat]) acc[cat] = [];
acc[cat].push(el);
return acc;
}, {});
return Object.entries(grouped).map(([category, items]) => ({
json: {category, items, count: items.length}
}));
```
#### 3. LLM Classification
```javascript
// Prompt for Claude/GPT classification
const prompt = `
You are a construction estimator. Given these BIM elements:
Category: ${$input.first().json.category}
Sample elements: ${JSON.stringify($input.first().json.items.slice(0,5))}
1. Identify the construction work type
2. List relevant quantity parameters (Volume, Area, Length, Count)
3. Suggest standard work items from construction norms
Return as JSON:
{
"work_type": "...",
"quantity_params": ["Volume", "Area"],
"suggested_items": ["Concrete foundation", "Formwork"]
}
`;
```
#### 4. Vector Search in CWICR
```javascript
// Search DDC CWICR database for matching work items
const qdrantClient = require('@qdrant/js-client-rest');
const searchResults = await qdrantClient.search('ddc_cwicr_en', {
vector: await getEmbedding($input.first().json.work_description),
limit: 10,
score_threshold: 0.7
});
return searchResults.map(r => ({
json: {
work_code: r.payload.work_item_code,
description: r.payload.description,
unit: r.payload.unit,
unit_price: r.payload.unit_price,
similarity: r.score
}
}));
```
#### 5. Calculate Costs
```javascript
// Match quantities to prices
const elements = $node["Load Elements"].json;
const prices = $node["Vector Search"].json;
let totalCost = 0;
const breakdown = [];
for (const el of elements.items) {
const matchedPrice = prices.find(p => p.similarity > 0.8);
if (matchedPrice) {
const quantity = el.Volume || el.Area || 1;
const cost = quantity * matchedPrice.unit_price;
totalCost += cost;
breakdown.push({
element: el.Name,
quantity: quantity,
unit: matchedPrice.unit,
unit_price: matchedPrice.unit_price,
total: cost
});
}
}
return [{json: {totalCost, breakdown}}];
```
#### 6. Generate Report
```javascript
// Create HTML report
const data = $input.first().json;
const html = `
<!DOCTYPE html>
<html>
<head>
<title>Cost Estimate Report</title>
<style>
body { font-family: Arial, sans-serif; margin: 20px; }
table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }
th { background-color: #4CAF50; color: white; }
.total { font-size: 1.5em; font-weight: bold; }
</style>
</head>
<body>
<h1>Cost Estimate Report</h1>
<p class="total">Total: $${data.totalCost.toLocaleString()}</p>
<table>
<tr><th>Element</th><th>Quantity</th><th>Unit</th><th>Price</th><th>Total</th></tr>
${data.breakdown.map(row => `
<tr>
<td>${row.element}</td>
<td>${row.quantity.toFixed(2)}</td>
<td>${row.unit}</td>
<td>$${row.unit_price.toFixed(2)}</td>
<td>$${row.total.toFixed(2)}</td>
</tr>
`).join('')}
</table>
</body>
</html>
`;
return [{json: {html, filename: 'estimate_report.html'}}];
```
## Real-World Results
Example project (rac_basic_sample.rvt):
- Processing time: ~30 minutes with ChatGPT
- Elements analyzed: 500+
- Automatic classification: 95% accuracy
- Manual review needed: 5% edge cases
## Key Insight from Community
> "My subjective take: professionals who ignore workflow automation and AI-agents today have roughly 5 years before the construction industry moves past them. The tools are free and open. The data is open. The only question is who learns to use them first."
## Prerequisites
- n8n (local or hosted)
- DDC CAD converters
- DDC CWICR database
- OpenAI/Anthropic API key
- Qdrant vector database
## Resources
- **GitHub**: cad2data Pipeline repository
- **Database**: OpenConstructionEstimate-DDC-CWICR
- **Community**: n8n Workflows for Construction (Telegram)
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.