GPT-4の洞察とPDF.coを使用してGoogle Sheetsからマーケティングレポートを生成

中級

これはDocument Extraction, Multimodal AI分野の自動化ワークフローで、15個のノードを含みます。主にCode, Merge, Aggregate, Summarize, PDFco Apiなどのノードを使用。 GPT-4の洞察とPDF.coを使用してGoogle Sheetsからマーケティングレポートを生成する

前提条件
  • Google Sheets API認証情報
  • OpenAI API Key
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "meta": {
    "instanceId": "ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "ab1b7d2d-7eac-45eb-9e0a-36f14c56df14",
      "name": "ワークフロー実行時",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        1728,
        288
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "2015e3a3-026b-46af-adfc-1fcff0031e66",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2720,
        608
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "4l6TDfLZVFS24g3X",
          "name": "OpenAi account 4"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "3bce7fdc-3fe1-451f-9e3f-ed37563a8fb5",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        3072,
        576
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"summary\": \"summary\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "93cb6107-c70b-4a48-95e4-1ddda24d87e1",
      "name": "付箋53",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1632,
        -272
      ],
      "parameters": {
        "color": 7,
        "width": 2144,
        "height": 1056,
        "content": "# 📊 Marketing Spend Report → Google Sheets + PDF\n\nThis 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**.  \n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "00aba054-1dab-429e-beb4-2c18e21c7e3a",
      "name": "付箋1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1184,
        -272
      ],
      "parameters": {
        "width": 400,
        "height": 1056,
        "content": "\n## ⚙️ Setup Instructions\n\n### 1️⃣ Prepare Your Google Sheet  \n- 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)  \n- Add or update your marketing spend data in rows 2–100.  \n\n#### Connect Google Sheets in n8n  \n1. Go to **n8n → Credentials → New → Google Sheets (OAuth2)**  \n2. Log in with your Google account and grant access  \n3. Select the **Spreadsheet ID** and **Worksheet** in the workflow  \n\n---\n\n### 2️⃣ Set Up PDF.co for PDF Reports  \n1. Create a free account at [PDF.co](https://pdf.co/)  \n2. In **PDF.co Dashboard → HTML to PDF Templates**, create a new **Mustache template**  \n   - Paste the HTML provided at the bottom of this description  \n   - Save, and note your **Template ID**  \n3. In **n8n → Credentials → New → PDF.co API**, paste your **API Key** and save  \n4. In the workflow, select your **PDF.co credential** in the `Create PDF` node  \n5. Replace the `templateId` with your Template ID  \n\n\n\n## 📬 Contact  \nNeed help customizing this (e.g., filtering by campaign, sending reports by email, or formatting your PDF)?  \n\n- 📧 **robert@ynteractive.com**  \n- 🔗 **[Robert Breen](https://www.linkedin.com/in/robert-breen-29429625/)**  \n- 🌐 **[ynteractive.com](https://ynteractive.com)**  \n\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "2d0dba31-964f-4b8c-94e4-215b5448f2b4",
      "name": "マーケティングデータ取得",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1952,
        464
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 365710158,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1UDWt0-Z9fHqwnSNfU3vvhSoYCFG6EG3E-ZewJC_CLq4/edit#gid=365710158",
          "cachedResultName": "Data"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1UDWt0-Z9fHqwnSNfU3vvhSoYCFG6EG3E-ZewJC_CLq4",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1UDWt0-Z9fHqwnSNfU3vvhSoYCFG6EG3E-ZewJC_CLq4/edit?usp=drivesdk",
          "cachedResultName": "Sample Marketing Data - n8n"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "HlBW2puZbuCCq8jJ",
          "name": "Google Sheets account 3"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "385bdda8-e751-4c71-8ddc-ff1b93eb5698",
      "name": "チャネル別支出合計",
      "type": "n8n-nodes-base.summarize",
      "position": [
        2256,
        288
      ],
      "parameters": {
        "options": {},
        "fieldsToSplitBy": "Channel",
        "fieldsToSummarize": {
          "values": [
            {
              "field": "Spend ($)",
              "aggregation": "sum"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "433d72c6-032c-43b9-9c34-36191d3181b5",
      "name": "支出合計",
      "type": "n8n-nodes-base.summarize",
      "position": [
        2256,
        128
      ],
      "parameters": {
        "options": {},
        "fieldsToSummarize": {
          "values": [
            {
              "field": "Spend ($)",
              "aggregation": "sum"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "dbcd16cf-f023-467b-bc92-d70c9110cf1b",
      "name": "サマリー作成",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2832,
        304
      ],
      "parameters": {
        "text": "={{ $json.data }}",
        "options": {
          "systemMessage": "You are writing a daily update message about the marketing data. The data is provided. Output a 4 sentance summary. \n\nOutput like this. \n\n{\n\t\"summary\": \"summary\"\n}"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "4d2c9c31-7fc8-4a4b-a6ca-3b36777ff96b",
      "name": "すべて結合",
      "type": "n8n-nodes-base.merge",
      "position": [
        3136,
        48
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition",
        "numberInputs": 3
      },
      "typeVersion": 3.2
    },
    {
      "id": "d6a77a5d-c9c4-4496-8a8e-520425b54400",
      "name": "PDF変換・アップロード",
      "type": "n8n-nodes-base.code",
      "position": [
        3504,
        -160
      ],
      "parameters": {
        "jsCode": "// n8n Code node (JavaScript)\n// Input: ONE item whose .json is the array you posted\n// Output: ONE item in correct n8n shape: [{ json: <object for HTML/Mustache> }]\n\nconst fmtUSD = (n) => Number(n || 0).toLocaleString('en-US', { style: 'currency', currency: 'USD' });\n\nconst items = $input.all();\nif (!items.length) {\n  return [{ json: { error: 'No input data' } }];\n}\n\n// Handle your exact incoming shape (array with one object)\nlet root = items[0].json;\nif (Array.isArray(root)) root = root[0] || {};\n\nconst totalSpendRaw = Number(root[\"sum_Spend_($)\"] || 0);\nconst channelsRaw = Array.isArray(root.data) ? root.data : [];\nconst summary = (typeof root.output?.summary === 'string') ? root.output.summary : '';\n\n// Build channels list for the HTML template\nconst channels = channelsRaw.map(r => ({\n  channel: r.Channel || 'Unknown',\n  spendFmt: fmtUSD(Number(r[\"sum_Spend_($)\"] || 0)),\n}));\n\n// Final object expected by your HTML/Mustache\nconst out = {\n  generatedDate: new Date().toISOString().slice(0, 10),\n  totalSpendFmt: fmtUSD(totalSpendRaw),\n  channelCount: channels.length,\n  channels,\n  summary,\n};\n\n// ✅ Return in proper n8n format\nreturn [{ json: out }];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "5d147144-87a1-4e6c-a03c-4366896deffe",
      "name": "PDF作成",
      "type": "n8n-nodes-pdfco.PDFco Api",
      "position": [
        3552,
        560
      ],
      "parameters": {
        "operation": "URL/HTML to PDF",
        "templateId": "12011",
        "convertType": "htmlTemplateToPDF",
        "templateData": "={{ JSON.stringify($json) }}\n",
        "advancedOptions": {}
      },
      "credentials": {
        "pdfcoApi": {
          "id": "wGorcCULfsY1va25",
          "name": "PDF.co account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0a330ed9-9b83-4915-a867-432752e0a6fc",
      "name": "1行に変換",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2496,
        224
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "a3ecc29f-ef2f-4325-b477-b4a536dc86d6",
      "name": "付箋59",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3440,
        64
      ],
      "parameters": {
        "color": 3,
        "width": 288,
        "height": 624,
        "content": "### 2️⃣ Connect PDF.co\n1. Create a free account at [PDF.co](https://pdf.co/)  \n2. Copy your **API Key** from the dashboard  \n3. In **n8n → Credentials → New → PDF.co API**  \n   - Paste your API Key → **Save**  \n4. In the **PDF.co node**, select your credential and choose the **HTML Template to PDF** operation  \n\n---\n\n### 3️⃣ Create Your PDF.co HTML Template\n1. In your [PDF.co dashboard](https://app.pdf.co/), go to **Templates → New Template**  \n2. Paste in the HTML from the template section below  \n3. Save the template and copy its **Template ID**  \n4. Replace the `templateId` in the workflow with your new ID  \n\n---\n"
      },
      "typeVersion": 1
    },
    {
      "id": "2fe228de-8f55-4f3f-8856-a2d0216c3dd3",
      "name": "付箋60",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1888,
        32
      ],
      "parameters": {
        "color": 3,
        "width": 224,
        "height": 576,
        "content": "### 1️⃣ Prepare Your Google Sheet  \n- 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)  \n- Add or update your marketing spend data in rows 2–100.  \n\n#### Connect Google Sheets in n8n  \n1. Go to **n8n → Credentials → New → Google Sheets (OAuth2)**  \n2. Log in with your Google account and grant access  \n3. Select the **Spreadsheet ID** and **Worksheet** in the workflow  \n"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "433d72c6-032c-43b9-9c34-36191d3181b5": {
      "main": [
        [
          {
            "node": "4d2c9c31-7fc8-4a4b-a6ca-3b36777ff96b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4d2c9c31-7fc8-4a4b-a6ca-3b36777ff96b": {
      "main": [
        [
          {
            "node": "d6a77a5d-c9c4-4496-8a8e-520425b54400",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "dbcd16cf-f023-467b-bc92-d70c9110cf1b": {
      "main": [
        [
          {
            "node": "4d2c9c31-7fc8-4a4b-a6ca-3b36777ff96b",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "0a330ed9-9b83-4915-a867-432752e0a6fc": {
      "main": [
        [
          {
            "node": "4d2c9c31-7fc8-4a4b-a6ca-3b36777ff96b",
            "type": "main",
            "index": 1
          },
          {
            "node": "dbcd16cf-f023-467b-bc92-d70c9110cf1b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2015e3a3-026b-46af-adfc-1fcff0031e66": {
      "ai_languageModel": [
        [
          {
            "node": "dbcd16cf-f023-467b-bc92-d70c9110cf1b",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "2d0dba31-964f-4b8c-94e4-215b5448f2b4": {
      "main": [
        [
          {
            "node": "433d72c6-032c-43b9-9c34-36191d3181b5",
            "type": "main",
            "index": 0
          },
          {
            "node": "385bdda8-e751-4c71-8ddc-ff1b93eb5698",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "385bdda8-e751-4c71-8ddc-ff1b93eb5698": {
      "main": [
        [
          {
            "node": "0a330ed9-9b83-4915-a867-432752e0a6fc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d6a77a5d-c9c4-4496-8a8e-520425b54400": {
      "main": [
        [
          {
            "node": "5d147144-87a1-4e6c-a03c-4366896deffe",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3bce7fdc-3fe1-451f-9e3f-ed37563a8fb5": {
      "ai_outputParser": [
        [
          {
            "node": "dbcd16cf-f023-467b-bc92-d70c9110cf1b",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "ab1b7d2d-7eac-45eb-9e0a-36f14c56df14": {
      "main": [
        [
          {
            "node": "2d0dba31-964f-4b8c-94e4-215b5448f2b4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

中級 - 文書抽出, マルチモーダルAI

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

関連ワークフロー

Marketing ROIリポートの生成にGoogle Sheets、GPT-4o、Eメールを使用
Google Sheets、GPT-4o、メールを使用してマーケティング活動のROIレポートを生成する
Code
Merge
Aggregate
+
Code
Merge
Aggregate
16 ノードRobert Breen
AI要約
初学者データ分析:GPT-4oを使ってGoogleシートで結合・フィルタリング・サマリー
初心者のデータ分析:GPT-4o を使用して Google スプレッドシートで結合、フィルタリング、集計
If
Set
Code
+
If
Set
Code
21 ノードRobert Breen
文書抽出
ポッドキャストのノート記録器
GPTとGeminiを使用してパフォーマンスデータと結合して、高転化率のMeta広告スクリプトを作成
Set
Code
Merge
+
Set
Code
Merge
24 ノードRobert Breen
文書抽出
AI生成LinkedIn投稿(人間による承認付き)
GPT-4、GoToHuman、Blotatoを使用したAI生成LinkedIn投稿(人間による承認付き)
Code
Merge
Filter
+
Code
Merge
Filter
19 ノードRobert Breen
ソーシャルメディア
アイスのリエンゲージングメールジェネレーター:GPT-4o-mini、OutlookとSheets
冷録客の再参画像メールジェネレータ:GPT-4o-mini、OutlookとSheets
Code
Aggregate
Google Sheets
+
Code
Aggregate
Google Sheets
15 ノードRobert Breen
リードナーチャリング
Apify + GPT-4o-mini を使ってタグ分析から Instagram キャプションを生成
Apify + GPT-4o-mini を使ってタグ分析から Instagram キャプションを生成
Set
Code
Merge
+
Set
Code
Merge
17 ノードRobert Breen
コンテンツ作成
ワークフロー情報
難易度
中級
ノード数15
カテゴリー2
ノードタイプ11
難易度説明

経験者向け、6-15ノードの中程度の複雑さのワークフロー

作成者
Robert Breen

Robert Breen

@rbreen

Professional services consultant with over 10 years of experience solving complex business problems across industries. I specialize in n8n and process automation—designing custom workflows that integrate tools like Google Calendar, Airtable, GPT, and internal systems. Whether you need to automate scheduling, sync data, or streamline operations, I build solutions that save time and drive results.

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34