Quick Overview
This workflow collects a construction Scope of Work PDF via an n8n form, uses Azure OpenAI to extract BOQ-style line items, prices them using a Google Sheets unit-rate database, generates a formatted Google Docs bid report, logs the estimate to Google Sheets, and emails the result via Gmail.
How it works
- Receives project details and a Scope of Work PDF through an n8n form submission.
- Extracts text from the uploaded PDF and sends it to Azure OpenAI (GPT-4o-mini) to return structured JSON line items.
- Cleans and parses the AI response into individual BOQ items enriched with project name, client name, and estimator email.
- Looks up matching unit rates in a Google Sheets UnitRates sheet using keyword matching and applies category-based fallback rates when no match is found.
- Calculates total cost per line item, aggregates all items, and builds a bid summary with category totals and grand totals including 18% GST.
- Creates a Google Docs report, writes the full bid content into the document, and appends the generated estimate text to a Google Sheets BidLog sheet.
- Emails the estimator via Gmail with key totals and a link to the Google Docs report.
Setup
- Add credentials for Azure OpenAI, Google Sheets OAuth2, Google Docs OAuth2, Gmail OAuth2, and Slack OAuth2 (for error alerts).
- Create or update a Google Sheets file with a UnitRates sheet containing columns like “Description Keyword”, “Unit Rate (₹)”, and “Source / Project Ref”, and ensure a BidLog sheet exists for appended logs.
- Replace the placeholder Google Sheets document ID and the Google Drive folder ID in the Google Sheets and Google Docs nodes.
- Activate the workflow and share the generated n8n form URL with estimators so they can upload SOW PDFs and receive emailed estimates.