Skip to main content

Generate marketing reports from Google Sheets with GPT-4 insights and PDF.co

Workflow preview

Workflow preview
100%
Generate marketing reports from Google Sheets with GPT-4 insights and PDF.co preview
Open on n8n.io

Important notice

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

1. Workflow Overview

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 . ️...

Best for

  • Document Extraction automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.stickynote, n8n-nodes-base.googlesheets, n8n-nodes-base.summarize, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.merge

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Generate marketing reports from Google Sheets with GPT-4 insights and PDF.co
Workflow name
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
  • 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
  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)?


📄 HTML Template (for PDF.co)

> Paste this into a new HTML Template on PDF.co and reference its Template ID in your workflow.

<!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 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>
&lt;/body&gt;
&lt;/html&gt;

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 - When clicking ‘Execute workflow’

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

Block 2 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 3 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 4 - Sticky Note53

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

Block 5 - Sticky Note1

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

Block 6 - Get Marketing Data

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

Block 7 - Sum Spend by Channel

Type / Role
n8n-nodes-base.summarize - summarize
Config choices
Version 1.1

Block 8 - Sum Spend

Type / Role
n8n-nodes-base.summarize - summarize
Config choices
Version 1.1

Block 9 - Write Summary

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 10 - Combine All

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 11 - Convert to PDF Upload

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

Block 12 - Create PDF

Type / Role
n8n-nodes-pdfco.PDFco Api - PDFco Api
Config choices
Version 1

Block 13 - Covert to 1 row

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

Block 14 - Sticky Note59

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

Block 15 - Sticky Note60

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

3. Summary Table

Workflow Generate marketing reports from Google Sheets with GPT-4 insights and PDF.co
Complexity advanced
Nodes 15
Categories Document Extraction, Multimodal AI
Author Robert Breen
Published 26 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7861/7861.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 Generate marketing reports from Google Sheets with GPT-4 insights and PDF.co do?

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 . ️...

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 Document Extraction, Multimodal AI use case.