Skip to main content

Automated request-to-quote with OpenAI, Google Sheets & CraftMyPDF

Workflow preview

Workflow preview
100%
Automated request-to-quote with OpenAI, Google Sheets & CraftMyPDF preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

What this workflow does Turns a simple form submission into a polished, priced PDF quote—automatically. Captures lead details via Form: Request a Quote. Loads your Google Sheets catalog (SKUs, p...

Best for

  • CRM automation workflows
  • Multimodal AI automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.formtrigger, n8n-nodes-base.googlesheets, @n8n/n8n-nodes-langchain.openai, n8n-nodes-base.code, n8n-nodes-craftmypdf.craftmypdf, n8n-nodes-base.httprequest, n8n-nodes-base.emailsend, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Cong Nguyen.

Original n8n.io source

1.1 Workflow description

Title
Automated request-to-quote with OpenAI, Google Sheets & CraftMyPDF
Workflow name
Automated request-to-quote with OpenAI, Google Sheets & CraftMyPDF

📄 What this workflow does

  • Turns a simple form submission into a polished, priced PDF quote—automatically.
  • Captures lead details via Form: Request a Quote.
  • Loads your Google Sheets catalog (SKUs, price, stock, min qty, etc.).
  • Uses OpenAI to select SKUs and build a strict JSON quote (respects in_stock and min_qty, optional discount ≤10%).
  • Maps data in a Code node to compute line totals, discount, VAT, and a unique invoice_number; validates/falls back due_date.
  • Renders a branded PDF via CraftMyPDF, fetches the file link, and emails the customer the quote.

👤 Who is this for

  • SMBs and sales teams needing instant quotes from website forms.
  • Ops teams managing catalogs in Sheets who want LLM-assisted SKU selection.
  • Agencies/shops that must generate consistent, branded PDFs and email them automatically.

✅ Requirements

  • A self-hosted n8n instance.
  • Google Sheets catalog with (recommended) columns: sku, name, uom, unit_price, currency, in_stock (TRUE/FALSE), min_qty, lead_time_days, notes.
  • Connected credentials: Google Sheets OAuth2, OpenAI (or compatible), CraftMyPDF, SMTP.
  • A CraftMyPDF template whose fields match the Code node output (invoice_number, items[], gross_total, etc.). CraftMyPDF provides a drag-and-drop editor and PDF Generation API that work well with n8n.

⚙️ How to set up

  • Import the workflow JSON into n8n.
  • In Google Sheets: Products, set real documentId/sheetName (IDs) and connect OAuth.
  • In LLM node, keep or change model (default gpt-4.1-mini), and keep the “JSON-only” system prompt.
  • In Create a PDF, set your CraftMyPDF templateId.
  • In Email: Send Quote, set fromEmail and SMTP credentials.
  • Submit a test form; verify LLM JSON → PDF render → email delivery.
  • (Optional) Adjust defaults in the Code node: vat_pct (default 10), payment_terms, currency fallback, and valid_days.

🧩 CraftMyPDF template — quick guide (UI)

  • Create & open a template: Log in → Manage Templates → New Template (choose blank or a starter) → Edit to open the editor. The editor has four core tabs: Designer, Preview, Data, Settings.
  • Paste sample JSON: Go to the Data tab and paste a sample that mirrors what n8n will send (e.g., includes invoice_number, client, items[]). This JSON powers the editor’s auto-complete and live preview.
  • Bind fields fast: In Designer, use Data Fields to drag pre-bound text/image components that auto-insert expressions from your JSON—much quicker than manual binding.
  • Add line items: For repeating rows like items[], use Simple Table (set Data Source to {{data.items}}, then in each column use {{row.field}}, e.g., {{row.description}}, {{row.quantity}}, {{row.unit_price}}, {{row.total}}).
  • Use expressions: Anywhere you need dynamic text, enter {{ data.<field> }}—for example {{data.invoice_number}}, {{data.client}}, {{data.gross_total}}. Preview the result and/or generate a real PDF from the Preview tab.
  • Finish & integrate: Save the template, note its Template ID, and use it in the n8n CraftMyPDF node. You can return to the editor anytime to tweak layout/styles; the next workflow run will use the updated design. The editor and API are built for reusable templates.

🔁 How it works

  • Trigger → Form submission captures: Full Name, Email, Company, Requirements, Budget Min/Max, Need By, Notes.
  • Catalog Load → Sheets node returns rows; passed to the LLM as JSON.
  • LLM Quote → Model selects SKUs/qty, pricing, discount (≤10%), terms, and returns VALID JSON only.
  • Code Mapping → Parses JSON (strips code fences if present), computes discounts/VAT/totals, assigns invoice_number (Q-YYYYMMDD-ABCDE), and validates due_date (falls back to today + valid_days).
  • PDF Render → CraftMyPDF generates the branded quote and returns a file URL.
  • Delivery → HTTP node fetches the file; SMTP node emails the customer with dynamic subject and totals.

💡 About Margin AI

Margin AI is your AI Service Companion. We help organizations design intelligent, human-centric automation — from content pipelines and branding workflows to customer insights and sales enablement. Our tailored AI solutions scale marketing, operations, and creative processes with ease.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Form: Request a Quote

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.2

Block 2 - Google Sheets: Products

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 3 - LLM: Select & Quote (JSON only)

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 4 - Code: Map for CraftMyPDF

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 5 - Create a PDF

Type / Role
n8n-nodes-craftmypdf.craftMyPdf - craftMyPdf
Config choices
Version 1

Block 6 - Get PDF file

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 7 - Email: Send Quote

Type / Role
n8n-nodes-base.emailSend - emailSend
Config choices
Version 2.1

Block 8 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Automated request-to-quote with OpenAI, Google Sheets & CraftMyPDF
Complexity intermediate
Nodes 9
Categories CRM, Multimodal AI
Author Cong Nguyen
Published 04 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8239/8239.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automated request-to-quote with OpenAI, Google Sheets & CraftMyPDF do?

What this workflow does Turns a simple form submission into a polished, priced PDF quote—automatically. Captures lead details via Form: Request a Quote. Loads your Google Sheets catalog (SKUs, p...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your CRM, Multimodal AI use case.