Send ranked freight quote PDFs with GPT-4o, Google Sheets, Gmail and PDFShift
Quick overview This workflow receives shipment requests via webhook, pulls carrier rate data from Google Sheets, uses OpenAI GPT-4o to generate a ranked HTML freight quote, converts it to a PDF with PDFShift, and emails the PDF to the customer via Gmail, with Slack alerts on workflow errors.
How it works Receives a POST webhook request containing shipment details like origin, destination, weight, mode, and customer contact information. Reads rate information in parallel from three carrier tabs in a Google Sheets spreadsheet (BlueDart, DTDC, and Delhivery). Combines the carrier results and calculates per-carrier total cost based on the shipment weight. Sends the shipment and carrier data to OpenAI GPT-4o to generate a complete HTML quote page with a ranked comparison table. Converts the generated HTML into an A4 PDF file using the PDFShift API. Emails the PDF quote to the customer using Gmail with a prefilled subject and message. If the workflow fails, posts an error alert message to a Slack channel.
Setup Configure the webhook path in n8n and copy the production webhook URL into the system that submits shipment requests. Add Google Sheets OAuth2 credentials and ensure the referenced spreadsheet and carrier sheet tabs (BlueDart_Rates, DTDC_Rates, Delhivery_Rates) exist and include the expected columns (for example, Rate_Per_Kg and Transit_Days). Add an OpenAI API credential for the GPT-4o step and confirm the prompt/model settings generate HTML in the expected format. Add your PDFShift API key by replacing the X-API-Key header value in the PDFShift request (and switch off sandbox mode if you want live PDFs). Add Gmail OAuth2 credentials and verify the sender mailbox and attachment settings for the outbound quote email. (Optional) Add Slack OAuth2 credentials and set the target channel for error notifications.
Related Templates
AI Email Classifier & Auto-Delete for Gmail (SPAM/OFFER Cleaner)
This workflow is designed for freelancers, solopreneurs, and business owners who receive a high volume of irrelevant mes...
Generate Product Ad Copy & CTAs with GPT-4 for Slack and Airtable
⚡ AI Copywriter Pro: Instant Ad Copy & CTA Generator Transform product details into compelling marketing copy in second...
Generate Food Recipes from Gmail & Form Requests with Ollama & Llama 3.2
This n8n template demonstrates how to create an intelligent food recipe assistant that accepts requests via Gmail and we...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments