Generate Marketing Reports from Google Sheets with GPT-4 Insights and PDF.co

This workflow pulls **marketing data from Google Sheets**, aggregates spend by channel, generates an **AI-written summary**, and outputs a formatted **PDF report** using a custom HTML template on **PDF.co**. --- ## Setup Instructions ### 1. Prepare Your Google Sheet - Copy this template into your Google Drive: [Sample Marketing Data](https://docs.google.com/spreadsheets/d/1UDWt0-Z9fHqwnSNfU3vvhSoYCFG6EG3E-ZewJC_CLq4/edit?gid=365710158#gid=365710158) - Add or update your marketing spend data in rows 2-100. #### Connect Google Sheets in n8n 1. Go to **n8n → Credentials → New → Google Sheets (OAuth2)** 2. Log in with your Google account and grant access 3. Select the **Spreadsheet ID** and **Worksheet** in the workflow --- ### 2. Set Up PDF.co for PDF Reports 1. Create a free account at [PDF.co](https://pdf.co/) 2. In **PDF.co Dashboard → HTML to PDF Templates**, create a new **Mustache template** - Paste the HTML provided at the bottom of this description - Save, and note your **Template ID** 3. In **n8n → Credentials → New → PDF.co API**, paste your **API Key** and save 4. In the workflow, select your **PDF.co credential** in the `Create PDF` node 5. Replace the `templateId` with your Template ID --- ## How It Works - **Google Sheets Node**: Pulls marketing spend data - **Summarize Nodes**: Aggregate total spend and spend per channel - **OpenAI Node**: Writes a daily summary of marketing performance - **Code Node**: Converts aggregated data into the correct shape for the PDF template - **PDF.co Node**: Generates a final, formatted **PDF report** --- ## Contact Need help customizing this (e.g., filtering by campaign, sending reports by email, or formatting your PDF)? - ✉ **robert@ynteractive.com** - 🔗 **[Robert Breen](https://www.linkedin.com/in/robert-breen-29429625/)** - 🌐 **[ynteractive.com](https://ynteractive.com)** --- ## ➤ HTML Template (for PDF.co) > Paste this into a new **HTML Template** on [PDF.co](https://pdf.co/) and reference its Template ID in your workflow. ```html <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Invoice {{invoiceNumber}}</title> <style> body { font-family: Arial, Helvetica, sans-serif; margin: 36px; color: #222; } .header { display: flex; justify-content: space-between; align-items: center; } .brand { max-height: 56px; } h1 { margin: 12px 0 4px; font-size: 22px; } .meta { font-size: 12px; color: #555; } .two-col { display: flex; gap: 24px; margin-top: 16px; } .box { flex: 1; border: 1px solid #ddd; padding: 12px; border-radius: 6px; } .label { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: .02em; } table { width: 100%; border-collapse: collapse; margin-top: 16px; } th, td { border-bottom: 1px solid #eee; padding: 10px 8px; font-size: 13px; } th { background: #fafafa; text-align: left; } tfoot td { border-top: 2px solid #ddd; font-size: 13px; } .right { text-align: right; } .totals td { padding: 6px 8px; } .grand { font-weight: 700; font-size: 14px; } .notes { margin-top: 18px; font-size: 12px; color: #444; } </style> </head> <body> <div> <div> <h1>Invoice {{invoiceNumber}}</h1> <div>Date: {{invoiceDate}} &nbsp; | &nbsp; Due: {{dueDate}}</div> </div> {{#company.logoUrl}} <img src="{{company.logoUrl}}" alt="Logo" /> {{/company.logoUrl}} </div> <div> <div> <div>From</div> <div><strong>{{company.name}}</strong></div> <div>{{company.address}}</div> <div>{{company.phone}}</div> <div>{{company.email}}</div> </div> <div> <div>Bill to</div> <div><strong>{{billTo.name}}</strong></div> <div>{{billTo.address}}</div> <div>{{billTo.email}}</div> </div> </div> <table> <thead> <tr> <th>#</th> <th>Description</th> <th>Qty</th> <th>Unit Price</th> <th>Line Total</th> </tr> </thead> <tbody> {{#items}} <tr> <td>{{line}}</td> <td>{{description}}</td> <td>{{qty}}</td> <td>{{unitPriceFmt}}</td> <td>{{lineTotalFmt}}</td> </tr> {{/items}} </tbody> <tfoot> <tr> <td colspan="4">Subtotal</td> <td>{{subtotalFmt}}</td> </tr> <tr> <td colspan="4">Tax ({{taxRatePct}})</td> <td>{{taxAmountFmt}}</td> </tr> <tr> <td colspan="4">Discount</td> <td>-{{discountFmt}}</td> </tr> <tr> <td colspan="4">Total</td> <td>{{totalFmt}}</td> </tr> </tfoot> </table> <div> <strong>Notes:</strong> {{notes}}<br /> <strong>Terms:</strong> {{terms}} </div> </body> </html> ```

n8n
Generate Marketing Reports from Google Sheets with GPT-4 Insights and PDF.co
$9.99
Last updated September 5, 2026
30-day money-back guarantee
Instant download
Lifetime updates included

New buyers can create an account from the cart to unlock a controlled $10 first-purchase credit on eligible orders of $25+.

Secure checkout powered by Stripe

Support

How to import this workflow into n8n

  1. 1Purchase or download the workflow to get the n8n workflow JSON file.
  2. 2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
  3. 3Open each node marked with a credential warning and connect your own accounts and API keys.
  4. 4Run the workflow once manually to verify the data flow, then toggle it to Active.

Related Marketing workflows

More from Robert Breen

Need this deployed? We'll set it up for you.

Our automation experts deploy this workflow in your stack, connect your accounts, and verify it works — or build a custom solution from scratch.