This workflow corresponds to n8n.io template #10769 — we link there as the canonical source.
This workflow follows the Agent → Gmail 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 →
{
"id": "JMjW8tQyV557sV14",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Personalised Offer Generator",
"tags": [],
"nodes": [
{
"id": "5abbd6a4-3073-4fc2-87ea-cb967a1d9379",
"name": "Google Gemini Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
1008,
176
],
"parameters": {
"options": {},
"modelName": "models/gemini-flash-latest"
},
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "19127e3c-7af6-46a1-ae12-892edad5415a",
"name": "Convert HTML content to PDF",
"type": "@pdfgeneratorapi/n8n-nodes-pdf-generator-api.pdfGeneratorApi",
"position": [
1440,
0
],
"parameters": {
"resource": "conversion",
"htmlContent": "={{ $json.output }}",
"conversionOptions": {
"conversionOutput": "file"
}
},
"credentials": {
"pdfGeneratorApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "d4e6ad89-3812-45fe-91be-68f07c0a74e9",
"name": "Send the proposal to the customer",
"type": "n8n-nodes-base.gmail",
"position": [
1824,
0
],
"parameters": {
"sendTo": "user@example.com",
"message": "={{ $('Prepare Agent Inputs').item.json.email_body }}",
"options": {
"attachmentsUi": {
"attachmentsBinary": [
{
"property": "={{ $('Convert HTML content to PDF').item.json.filename }}"
}
]
}
},
"subject": "={{ $('Prepare Agent Inputs').item.json.subject }}"
},
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "6db0ccb4-0271-40ac-8408-290a176d8af2",
"name": "Webhook simulator",
"type": "n8n-nodes-base.webhook",
"position": [
96,
16
],
"parameters": {
"path": "aa4cac78-aee6-4d43-99d2-c586f01118df",
"options": {}
},
"typeVersion": 2.1
},
{
"id": "744748c6-e872-404d-95ed-8f0fb9ece3cd",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-80,
-128
],
"parameters": {
"color": 3,
"width": 352,
"height": 304,
"content": "## Example DATA\n\nSimulates incoming data (like a new Excel row) using pinned webhook data."
},
"typeVersion": 1
},
{
"id": "140512e0-424f-4497-9bd9-bbb29b40a9eb",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
1296,
-176
],
"parameters": {
"color": 4,
"width": 400,
"height": 416,
"content": "## Document Creation\n\nThe HTML is converted into a high-quality PDF via the PDFGeneratorAPI.com"
},
"typeVersion": 1
},
{
"id": "46c57849-0262-456b-a7c6-8797285106e8",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1712,
-144
],
"parameters": {
"color": 7,
"width": 576,
"height": 336,
"content": "## Delivery & Tracking\n\nThe PDF is emailed to the client via Gmail, and the transaction is logged into a Google Sheet for your records."
},
"typeVersion": 1
},
{
"id": "e5fd38c2-ecab-4735-8dd0-7cf90a765efb",
"name": "Respond to Webhook",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
464,
288
],
"parameters": {
"options": {
"responseCode": 400
},
"respondWith": "json",
"responseBody": "={\n \"status\": \"error\",\n \"message\": \"Invalid or disposable email address. Please use a valid email to register.\",\n \"email_verified\": false,\n \"email_provided\": \"{{ $json.email }}\"\n}"
},
"typeVersion": 1.5
},
{
"id": "f8fcb649-9a9a-465e-b816-fcf400f5eaee",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
288,
-144
],
"parameters": {
"color": 7,
"width": 544,
"height": 576,
"content": "## Email Verification with Error handling\n\nUses the Hunter API to verify the validity of the provided email address."
},
"typeVersion": 1
},
{
"id": "1dc15e23-fe42-4686-8c3e-c12cef31b933",
"name": "Append row in sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
2096,
0
],
"parameters": {
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": ""
},
"documentId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.7
},
{
"id": "fbe11a5e-2050-4163-9003-6311f82e8089",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
848,
-144
],
"parameters": {
"color": 7,
"width": 432,
"height": 496,
"content": "## AI Generation\n\nGoogle Gemini processes the lead data to draft a custom business proposal in HTML format."
},
"typeVersion": 1
},
{
"id": "32314c7d-9ac3-4abc-9e2a-1e871cb0ba2e",
"name": "Is Email Valid?",
"type": "n8n-nodes-base.if",
"position": [
592,
16
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 3,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "709911e3-1f9d-4a96-b72f-7338ab83aeae",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "valid"
}
]
}
},
"typeVersion": 2.3
},
{
"id": "60fa2cef-9d41-4b44-adbc-5744c1bb5322",
"name": "Generate Proposal Content",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1040,
0
],
"parameters": {
"text": "=USER\n\nYour task is to generate raw HTML code for a one-page business offer.\n\nCRITICAL RULES:\n\nHTML ONLY: Your entire output must be only the HTML code, starting with <!DOCTYPE html>. Do NOT include ```html, ```, or any other text or explanation.\n\nSTYLED: Use inline CSS or a <style> tag to make the offer professional and formatted for a single A4 page.\n\nOFFER DETAILS:\n\nFROM: Our company, www.pdfgeneratorapi.com (document generation and document automations).\n\nTO: {{ $('Webhook simulator').item.json.customer_name }}\n\nPROPOSAL: A \"Custom Business Insights Package.\" Include a brief intro, a bulleted list of services, a simple pricing table, and a clear call to action (e.g., \"Schedule a call\").\n\nRECIPIENT LOGO: You MUST include the recipient's logo. Use this exact HTML <img> tag, which dynamically pulls the logo using the {{ $('Webhook simulator').item.json.customer_name }} variable: <img src=\"https://logo.clearbit.com/{{ $('Webhook simulator').item.json.website }}\" alt=\"{{ $('Webhook simulator').item.json.website }} Logo\" style=\"max-width: 180px; height: auto; margin-bottom: 20px;\"> ",
"options": {},
"promptType": "define"
},
"typeVersion": 2.2
},
{
"id": "0ebd71ef-d701-40db-8db0-3761e03d1337",
"name": "Prepare Agent Inputs",
"type": "n8n-nodes-base.set",
"position": [
896,
0
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "d0d4034a-8a0a-4e98-938c-f4422c14b10f",
"name": "email_body",
"type": "string",
"value": "={{ $json.customer_name }}!\n\nHi {{ $json.customer_name }},\n\nAs one of our most valued customers, we wanted to send a special thank you your way. We've put together an exclusive offer we think you'll love.\n\nTo redeem your offer, simply use the code below at checkout:[Promo Code]\n\nThis offer is valid until [Expiry Date], so don't miss out! [CTA Button Text] (e.g., Shop Now) [Link to Shop]\n\nThanks again for being part of the [Your Company Name] family.\n\nBest regards,\nThe [Your Company Name] Team"
},
{
"id": "3d92f5b2-9911-4d93-8428-0260d41fb3b7",
"name": "subject",
"type": "string",
"value": "Here's Your Personalised Offer"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "c87a88dc-f047-457e-ab2f-928721c59521",
"name": "Verify Email Address",
"type": "n8n-nodes-base.hunter",
"position": [
336,
16
],
"parameters": {
"email": "={{ $json.customer_email }}",
"operation": "emailVerifier"
},
"credentials": {
"hunterApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "955aa323-1ac0-483d-901e-6a38f9caa3e9",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-608,
-912
],
"parameters": {
"width": 736,
"height": 672,
"content": "## Generate PDF Business Proposals with AI\nThis workflow automates the entire sales proposal process, from initial lead capture to final delivery and logging. By combining the power of Google Gemini with automated PDF generation, you can ensure every lead receives a professional, personalized proposal in seconds.\n\n## How it works\n\n1. Data Capture: The workflow starts with a Webhook (simulated) containing lead details.\n\n2. Verification: It uses the Hunter API to ensure the email is valid before proceeding.\n\n3. AI Generation: Google Gemini processes the lead data to draft a custom business proposal in HTML format.\n\n4. Document Creation: The HTML is converted into a high-quality PDF via the PDF Generator API.\n\n5. Delivery & Tracking: The PDF is emailed to the client via Gmail, and the transaction is logged into a Google Sheet for your records.\n\n## Setup steps\n\n- API Keys: You will need API keys for Hunter.io, Google Gemini (AI), and PDFGeneratorAPI.com\n\n- Credentials: Connect your Gmail account and select a target Google Sheet.\n\n- Customization: Adjust the \"System Prompt\" in the AI Agent to match your specific business tone and services."
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "68ac1893-d57e-4afe-b365-368d77886444",
"connections": {
"Is Email Valid?": {
"main": [
[
{
"node": "Prepare Agent Inputs",
"type": "main",
"index": 0
}
],
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
]
]
},
"Webhook simulator": {
"main": [
[
{
"node": "Verify Email Address",
"type": "main",
"index": 0
}
]
]
},
"Prepare Agent Inputs": {
"main": [
[
{
"node": "Generate Proposal Content",
"type": "main",
"index": 0
}
]
]
},
"Verify Email Address": {
"main": [
[
{
"node": "Is Email Valid?",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "Generate Proposal Content",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Generate Proposal Content": {
"main": [
[
{
"node": "Convert HTML content to PDF",
"type": "main",
"index": 0
}
]
]
},
"Convert HTML content to PDF": {
"main": [
[
{
"node": "Send the proposal to the customer",
"type": "main",
"index": 0
}
]
]
},
"Send the proposal to the customer": {
"main": [
[
{
"node": "Append row in sheet",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
gmailOAuth2googlePalmApigoogleSheetsOAuth2ApihunterApipdfGeneratorApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This advanced n8n workflow automates the transition from "Raw Lead" to "Sent Proposal." By integrating Email Verification, Large Language Models (LLMs), and Document Automation, it eliminates manual data entry and ensures that every proposal sent is personalized, professional,…
Source: https://n8n.io/workflows/10769/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
leads. Uses supabase, gmail, formTrigger, httpRequest. Webhook trigger; 62 nodes.
This workflow contains community nodes that are only compatible with the self-hosted version of n8n.
📺 Watch the Video Demo
This automated n8n workflow detects and manages fraudulent booking transactions through comprehensive AI-powered analysis and multi-layered security checks. The system processes incoming travel bookin
⏺ 🚀 How it works