Quick overview
This workflow collects a job’s estimate (PDF or typed list) via an n8n form, uses OpenAI to extract materials, matches them to a Google Sheets catalog, and coordinates review, supplier confirmation, and crew delivery checks through Gmail and a shared order status page.
How it works
- Receives a material-order request from an n8n Form (or runs a daily 7am check, or serves the order status web page and button actions via webhooks).
- Loads Suppliers, Catalog, and Orders data from Google Sheets to determine the supplier, catalog matches, and the order record to work with.
- If an estimate PDF is attached, extracts text from the PDF and combines it with any typed materials text.
- Sends the estimate text and catalog item names to OpenAI (GPT-4.1-mini) to return a structured list of materials with quantities, units, and optional catalog matches.
- Builds an order by matching AI lines to the catalog, applying waste percentages and pack-size rounding, saves the order to the Orders sheet, and emails the owner a review link in Gmail.
- Serves an order page that lets the owner send or cancel, lets the supplier confirm delivery date and shortages, and lets the crew mark what arrived, while updating the order in Google Sheets and emailing updates via Gmail.
- Every morning, checks for unconfirmed sent orders to send a one-time supplier reminder and emails the crew a delivery-check link the day before delivery.
Setup
- Add credentials for Google Sheets, Gmail, and OpenAI (for the LangChain OpenAI chat model node).
- Run the “Create my spreadsheet” path once to generate the Suppliers, Catalog, and Orders tabs, then paste the resulting spreadsheet ID into the workflow settings.
- In “Your settings”, fill in owner_email, optional crew_email, your n8n_url (used to build the order page links), default_supplier_id, and confirm_nudge_hours/timezone as needed.
- In the Google Sheets spreadsheet, add your real supplier order desk emails in the Suppliers tab and maintain your item catalog (item name, unit, pack_size, waste_pct, supplier_id, optional sku/price) in the Catalog tab.
- Publish and share the n8n Form URL for submitting orders, and ensure the “material-order” and “material-order-action” webhook paths are reachable from email links.