See llms.txt for all machine-readable content.

Back to Templates

Classify industrial waste and route vendors with Gemini and Google Sheets

Quick overview

Youtube Video: https://youtube.com/shorts/MhutEWjbG8o

This workflow receives industrial waste disposal requests via webhook, logs them to Google Sheets, classifies the waste and documentation needs with Google Gemini using rules from a sheet, matches eligible approved vendors, notifies Slack when human review is required, and returns a structured recommendation response.

How it works

  1. Receives a POST webhook request containing waste details, quantity, physical state, and location.
  2. Validates required fields and immediately returns a 400 JSON error response if any are missing.
  3. Normalizes the request data (adds request ID/timestamps and defaults) and appends the submission to a Google Sheets “Waste_Requests” log.
  4. Fetches regulatory rules from Google Sheets, then uses Google Gemini to classify the waste stream, hazards, required documents, and matching rule references.
  5. Loads approved vendors from Google Sheets, filters them by approval status, accepted category tag, service region, and unexpired license, then uses Google Gemini to draft up to three vendor options and next steps.
  6. Determines whether human approval is required based on hazard flags, confidence, unknown classification, or missing documents and sends a Slack notification when review is needed.
  7. Updates the Google Sheets request log with the classification and vendor options, then responds to the webhook with the classification, recommendation, documentation checklist, and approval status.

Setup

  1. Create a Google Sheets spreadsheet with tabs named “Waste_Requests”, “Regulatory_Rules”, and “Approved_Vendors”, and ensure the columns referenced by the workflow exist.
  2. Add Google Sheets Service Account credentials in n8n and replace "YOUR_GOOGLE_SHEET_ID" with your spreadsheet ID in all Google Sheets nodes.
  3. Add Google Gemini (Google PaLM) API credentials for the two Gemini chat model nodes.
  4. Add Slack credentials, choose the target channel for reviewer alerts, and adjust the channel ID if you don’t want to post to #general.
  5. Copy the webhook URL from n8n and configure the source system to send POST requests with the required fields (wasteDescription, industry, estimatedQuantity, physicalState, location.state).