AutomationFlowsAI & RAG › Google Sheets → AI Sales Proposal in Docs & Gmail

Google Sheets → AI Sales Proposal in Docs & Gmail

Original n8n title: Create and Send AI Sales Proposals Using Gemini, Google Docs & Gmail

ByAvkash Kakdiya @itechnotion on n8n.io

This workflow automatically generates and sends personalized sales proposals when a new row is added to Google Sheets. It uses AI to create proposal content, updates contact details in HubSpot, and generates a formatted document. The document is converted into a PDF and emailed…

Event trigger★★★★☆ complexityAI-powered13 nodesGoogle GeminiHubSpotGoogle DriveGoogle DocsGmailGoogle Sheets Trigger
AI & RAG Trigger: Event Nodes: 13 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #14312 — we link there as the canonical source.

This workflow follows the Gmail → Google Docs recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "a775b2d8-00fd-4136-b948-dcad03b719fe",
      "name": "Message a model",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        13328,
        4272
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-2.5-flash",
          "cachedResultName": "models/gemini-2.5-flash"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=\"You are a world-class Sales Consultant. Write a professional, persuasive sales proposal based on these details:\n\nClient: {{ $json['Client Name'] }}\n\nCompany: {{ $json['Company Name'] }}\n\nGoals: {{ $json['Project Goals'] }}\n\nStructure your response with two headers:\n\nEXECUTIVE SUMMARY\n(Write a 2-paragraph summary here)\n\nPROPOSED SOLUTION\n(Write 3 bullet points of how we solve their specific goals)\n\nTone: Confident, professional, and helpful.\""
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "91ee46c5-9e8f-47f3-8425-88cbe1d7b777",
      "name": "Create or update a contact",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        13904,
        4272
      ],
      "parameters": {
        "email": "={{ $('Loop Over Items').item.json['Client Email'] }}",
        "options": {},
        "authentication": "appToken",
        "additionalFields": {
          "firstName": "={{ $('Loop Over Items').item.json['Client Name'] }}",
          "companyName": "={{ $('Loop Over Items').item.json['Company Name'] }}"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "49538d25-7891-4016-b209-88500e02042b",
      "name": "Copy file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        14128,
        4272
      ],
      "parameters": {
        "name": "=Proposal - {{ $('Loop Over Items').item.json['Company Name'] }}",
        "fileId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_DRIVE_FILE_ID",
          "cachedResultUrl": "https://docs.google.com/document/d/YOUR_GOOGLE_DRIVE_FILE_ID/edit?usp=drivesdk",
          "cachedResultName": "Master Proposal Template"
        },
        "options": {},
        "operation": "copy"
      },
      "typeVersion": 3
    },
    {
      "id": "32163cef-cd7b-4892-908f-d789557728ca",
      "name": "Update a document",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        14352,
        4272
      ],
      "parameters": {
        "simple": false,
        "actionsUi": {
          "actionFields": [
            {
              "text": "{{CompanyName}}",
              "action": "replaceAll",
              "matchCase": true,
              "replaceText": "={{ $('Loop Over Items').item.json['Company Name'] }}"
            },
            {
              "text": "{{ClientName}}",
              "action": "replaceAll",
              "matchCase": true,
              "replaceText": "={{ $('Loop Over Items').item.json['Client Name'] }}"
            },
            {
              "text": "{{AI_Summary}}",
              "action": "replaceAll",
              "matchCase": true,
              "replaceText": "={{ $('Code in JavaScript2').item.json.AI_Summary }}"
            },
            {
              "text": "{{Budget}}",
              "action": "replaceAll",
              "matchCase": true,
              "replaceText": "={{ $('Loop Over Items').item.json['Budget Range'] }}"
            },
            {
              "text": "{{Date}}",
              "action": "replaceAll",
              "matchCase": true,
              "replaceText": "={{ $('Loop Over Items').item.json.Timestamp }}"
            },
            {
              "text": "{{AI_Solution}}",
              "action": "replaceAll",
              "matchCase": true,
              "replaceText": "={{ $('Code in JavaScript2').item.json.AI_Solution }}"
            }
          ]
        },
        "operation": "update",
        "documentURL": "={{ $json.id }}"
      },
      "typeVersion": 2
    },
    {
      "id": "01ce8811-eda1-4e23-a164-52b1f270db10",
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        14576,
        4272
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.documentId }}"
        },
        "options": {
          "googleFileConversion": {
            "conversion": {
              "docsToFormat": "application/pdf"
            }
          }
        },
        "operation": "download"
      },
      "typeVersion": 3
    },
    {
      "id": "5f9cd328-150e-42aa-a3f2-e79f142b3245",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        14800,
        4352
      ],
      "parameters": {
        "sendTo": "={{ $('Loop Over Items').item.json['Client Email'] }}",
        "message": "=<!DOCTYPE html> <html> <head> <style>   body { font-family: Arial, sans-serif; line-height: 1.6; color: #333333; }   .container { padding: 20px; border: 1px solid #eeeeee; border-radius: 5px; }   .header { color: #2c3e50; font-size: 18px; font-weight: bold; }   .highlight { color: #2980b9; font-weight: bold; }   .footer { margin-top: 30px; font-size: 12px; color: #777777; border-top: 1px solid #eeeeee; padding-top: 10px; } </style> </head> <body>   <div class=\"container\">     <p>Hi <span class=\"highlight\"><{{ $('Loop Over Items').item.json['Client Name'] }}/span>,</p>      <p>Thank you for reaching out to <strong>iTechNotion</strong>. It was a pleasure learning about your goals for <span class=\"highlight\">{{ $('Loop Over Items').item.json['Company Name'] }}</span>.</p>      <p>Based on our discussion regarding your <strong>{{ $('Loop Over Items').item.json['Project Goals'] }}</strong>, I have prepared a custom proposal for your review. You can find the detailed breakdown in the attached PDF.</p>      <p><strong>What's included in the attachment:</strong></p>     <ul>       <li>A comprehensive Executive Summary</li>       <li>Our tailored Proposed Solution</li>       <li>Investment and Timeline details</li>     </ul>      <p>Please let me know if you have any questions or if you would like to schedule a brief call to discuss the next steps.</p>      <p>Best regards,</p>     <p><strong>Krish</strong><br>     Sales Strategy | iTechNotion</p>      <div class=\"footer\">       This is an automated delivery of your requested proposal. If you did not request this, please ignore this email.     </div>   </div> </body> </html>",
        "options": {
          "attachmentsUi": {
            "attachmentsBinary": [
              {}
            ]
          }
        },
        "subject": "=Proposal for {{ $('Loop Over Items').item.json['Company Name'] }}"
      },
      "typeVersion": 2.2
    },
    {
      "id": "aa256e93-8af3-4b47-90a6-731d3438e0af",
      "name": "Google Sheets Trigger",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        12880,
        4352
      ],
      "parameters": {
        "event": "rowAdded",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 397587448,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEETS_DOCUMENT_ID/edit#gid=397587448",
          "cachedResultName": "Form Responses 1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_SHEETS_DOCUMENT_ID",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEETS_DOCUMENT_ID/edit?usp=drivesdk",
          "cachedResultName": "Proposal Intake Form  (Responses)"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e1f030c5-c8f0-442f-bdb8-221bc1d5f3fe",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        13104,
        4352
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "cd05a023-5af6-45aa-a70e-2fe03192b8b2",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        11440,
        3728
      ],
      "parameters": {
        "width": 1392,
        "height": 1424,
        "content": "# AI Proposal Automation Overview\n\nThis workflow automates the full sales proposal process from lead capture to delivery. It uses AI to generate tailored proposals, updates CRM records, creates documents, and sends them to clients automatically.\n\n---\n\n### How it works\n\n1. A Google Sheets trigger detects new form submissions.\n2. Gemini AI generates a personalized proposal.\n3. A Code node cleans and structures the content.\n4. HubSpot creates or updates the contact.\n5. Google Docs creates a proposal from a template and converts it to PDF.\n6. Gmail sends the final proposal to the client.\n\n---\n\n### Setup steps\n\n1. Connect Google Sheets, Drive, Docs, and Gmail accounts.\n2. Add your proposal template with placeholders like {{AI_Summary}} and {{AI_Solution}}.\n3. Configure HubSpot with a Private App Token.\n4. Ensure your sheet includes required fields (Client Name, Email, Goals, etc.).\n\n---\n\n### Customization tips\n\n- Modify the AI prompt to change tone or industry focus.\n- Adjust email content and branding.\n- Expand placeholders for pricing, timelines, or services."
      },
      "typeVersion": 1
    },
    {
      "id": "573af401-8e9a-4fbf-8dfc-b9175649b9a3",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        12864,
        3728
      ],
      "parameters": {
        "color": 7,
        "width": 912,
        "height": 1424,
        "content": "## AI Processing & CRM\n\nGenerates proposal content and syncs lead data to HubSpot."
      },
      "typeVersion": 1
    },
    {
      "id": "8dc084a5-b842-462b-927a-85be259fafa4",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        13792,
        3728
      ],
      "parameters": {
        "color": 7,
        "width": 912,
        "height": 1424,
        "content": "## Document Generation\n\nCreates proposal, replaces placeholders, and exports PDF."
      },
      "typeVersion": 1
    },
    {
      "id": "bafd6368-b405-4114-a95a-848020fbeac5",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        14720,
        3728
      ],
      "parameters": {
        "color": 7,
        "width": 384,
        "height": 1424,
        "content": "## Delivery & Loop\n\nSends proposal via email and handles multiple submissions."
      },
      "typeVersion": 1
    },
    {
      "id": "f7e3185f-b4e3-41c3-9b3c-4e83759df231",
      "name": "Code in JavaScript2",
      "type": "n8n-nodes-base.code",
      "position": [
        13680,
        4272
      ],
      "parameters": {
        "jsCode": "// Get the text from the previous node\nconst fullText = $input.first().json.content.parts[0].text;\n\n// Split using the Header \"## PROPOSED SOLUTION\"\nconst parts = fullText.split(\"## PROPOSED SOLUTION\");\n\nlet summary = parts[0];\n\n// 1. Remove \"## EXECUTIVE SUMMARY\" header if it exists\nif (summary.includes(\"## EXECUTIVE SUMMARY\")) {\n  summary = summary.split(\"## EXECUTIVE SUMMARY\")[1];\n}\n\n// 2. Remove \"Dear [Name],\" intro\nsummary = summary.replace(/Dear .*?,/, \"\").trim();\n\n// 3. CLEANUP FUNCTION: This removes #, *, and extra dashes\nconst cleanText = (text) => {\n  return text\n    .replace(/[#*]/g, '')       // Removes all # and *\n    .replace(/---/g, '')        // Removes horizontal lines/dashes\n    .replace(/\\n\\s*\\n/g, '\\n\\n') // Fixes double spacing\n    .trim();\n};\n\nreturn {\n  AI_Summary: cleanText(summary),\n  AI_Solution: parts[1] ? cleanText(parts[1]) : \"No solution generated.\"\n};"
      },
      "typeVersion": 2
    }
  ],
  "connections": {
    "Copy file": {
      "main": [
        [
          {
            "node": "Update a document",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Message a model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message a model": {
      "main": [
        [
          {
            "node": "Code in JavaScript2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update a document": {
      "main": [
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript2": {
      "main": [
        [
          {
            "node": "Create or update a contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets Trigger": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create or update a contact": {
      "main": [
        [
          {
            "node": "Copy file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow automatically generates and sends personalized sales proposals when a new row is added to Google Sheets. It uses AI to create proposal content, updates contact details in HubSpot, and generates a formatted document. The document is converted into a PDF and emailed…

Source: https://n8n.io/workflows/14312/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

09_Storage_GoogleDrives_meeting_note. Uses googleDrive, googleDocs, googleSheets, gmail. Event-driven trigger; 9 nodes.

Google Drive, Google Docs, Google Sheets +3
AI & RAG

This workflow serves as a complete "AI Receptionist" for mortgage brokers or high-ticket service providers. It automates the messy process of qualifying leads, getting internal approval, and collectin

Google Gemini, Gmail, Google Drive +3
AI & RAG

Streamlit Logibot. Uses notion, ollamaChatModel, lmChatOllama, googleDrive. Event-driven trigger; 29 nodes.

Notion, Ollama Chat Model, Ollama Chat +5
AI & RAG

An n8n-based automation that generates client proposals from a form, lets you review everything in one place, and sends the proposal only when you approve it.

Form Trigger, Google Sheets Trigger, OpenAI +4
AI & RAG

Transform your WhatsApp messages into an organized journal with AI-powered transcription and media management.

WhatsApp, HTTP Request, Google Docs +3