{
  "name": "Merge Google Drive PDFs with dynamic cover pages and watermark using Autype",
  "nodes": [
    {
      "id": "4e134e76-8b7d-485e-b68e-26742beae619",
      "name": "Run Workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -560,
        128
      ]
    },
    {
      "id": "8150627a-44f8-40fe-b367-c91cfee2fc6d",
      "name": "List PDFs in Folder",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -320,
        128
      ]
    },
    {
      "id": "4e1a39a2-b607-43e2-a6db-c401a6021ba7",
      "name": "Build Title Pages JSON",
      "type": "n8n-nodes-base.code",
      "position": [
        -80,
        128
      ]
    },
    {
      "id": "8b1072a9-f029-469e-976d-626a004b9cdf",
      "name": "Render Title Pages PDF",
      "type": "n8n-nodes-autype.autype",
      "position": [
        160,
        128
      ]
    },
    {
      "id": "4a104ef5-2c17-43be-8714-1cf82c721247",
      "name": "Prepare Loop Items",
      "type": "n8n-nodes-base.code",
      "position": [
        576,
        128
      ]
    },
    {
      "id": "63b3a4fd-934e-42be-891d-a739754d75fb",
      "name": "Loop Over Documents",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        768,
        128
      ]
    },
    {
      "id": "c681fbb2-c13f-42aa-bad4-49f9fffaf3ab",
      "name": "Download PDF from Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1008,
        224
      ]
    },
    {
      "id": "076f31fa-88ea-415e-90fd-398e7143f5f2",
      "name": "Upload Document to Autype",
      "type": "n8n-nodes-autype.autype",
      "position": [
        1248,
        224
      ]
    },
    {
      "id": "d9274e8c-63a2-458e-b345-36bff5e86805",
      "name": "Extract Title Page",
      "type": "n8n-nodes-autype.autype",
      "position": [
        1488,
        224
      ]
    },
    {
      "id": "200b57c5-9e1b-458d-bc8a-4ba429bcd4eb",
      "name": "Collect Merge Pair",
      "type": "n8n-nodes-base.code",
      "position": [
        1728,
        224
      ]
    },
    {
      "id": "dfc3c022-b648-42d7-8893-cbd6fbfbb76f",
      "name": "Build Final Merge List",
      "type": "n8n-nodes-base.code",
      "position": [
        1008,
        -144
      ]
    },
    {
      "id": "6b33fa02-ec93-425a-a0b5-48eeda174bc6",
      "name": "Merge All PDFs",
      "type": "n8n-nodes-autype.autype",
      "position": [
        1248,
        -144
      ]
    },
    {
      "id": "6f37f228-0540-4677-85bd-18ce47e15fc7",
      "name": "Add Company Watermark",
      "type": "n8n-nodes-autype.autype",
      "position": [
        1456,
        -144
      ]
    },
    {
      "id": "2f181d44-a882-4297-8514-d7d52fdc51e1",
      "name": "Save Final PDF to Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1680,
        -144
      ]
    },
    {
      "id": "4054763c-74c8-4369-a40d-82c6e437a04c",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -976,
        -832
      ],
      "parameters": {
        "width": 560,
        "height": 1128,
        "content": "## Merge All PDFs from Google Drive with Generated Title Pages and Watermark\n### This workflow reads every PDF from a Google Drive folder, generates a title page for each document (showing name, dates"
      }
    },
    {
      "id": "ab4dc91b-9646-4a51-bacf-621e9e69ff9a",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        -48
      ],
      "parameters": {
        "width": 700,
        "height": 348,
        "content": "### 1. List & Generate Title Pages\nSearches the Google Drive folder for all PDFs. A Code node builds the Autype Render JSON with one title page section per document. Autype renders all title pages in "
      }
    },
    {
      "id": "1dadec4d-7472-4c42-b387-2caa94b4dfba",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        976,
        80
      ],
      "parameters": {
        "width": 908,
        "height": 316,
        "content": "### 2. Loop: Download, Upload, Extract Title Page\nFor each document: download from Drive, upload to Autype, extract the matching title page (by page number) from the title pages PDF, and collect both "
      }
    },
    {
      "id": "37e287d7-76c4-4f92-90be-88ce05a7da5e",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        976,
        -240
      ],
      "parameters": {
        "width": 908,
        "height": 268,
        "content": "### 3. Merge, Watermark & Save\nAfter the loop, file IDs are interleaved (title1, doc1, title2, doc2...) and merged into one PDF. A blue company-name watermark is added to every page. The final PDF is "
      }
    },
    {
      "id": "cac87ec3-79ab-4067-ad80-10be4b4ab95b",
      "name": "Upload Title Pages PDF",
      "type": "n8n-nodes-autype.autype",
      "position": [
        368,
        128
      ]
    }
  ],
  "connections": {
    "Run Workflow": {
      "main": [
        [
          {
            "node": "List PDFs in Folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge All PDFs": {
      "main": [
        [
          {
            "node": "Add Company Watermark",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Collect Merge Pair": {
      "main": [
        [
          {
            "node": "Loop Over Documents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Title Page": {
      "main": [
        [
          {
            "node": "Collect Merge Pair",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Loop Items": {
      "main": [
        [
          {
            "node": "Loop Over Documents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List PDFs in Folder": {
      "main": [
        [
          {
            "node": "Build Title Pages JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Documents": {
      "main": [
        [
          {
            "node": "Build Final Merge List",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Download PDF from Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Company Watermark": {
      "main": [
        [
          {
            "node": "Save Final PDF to Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Final Merge List": {
      "main": [
        [
          {
            "node": "Merge All PDFs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Title Pages JSON": {
      "main": [
        [
          {
            "node": "Render Title Pages PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Render Title Pages PDF": {
      "main": [
        [
          {
            "node": "Upload Title Pages PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Title Pages PDF": {
      "main": [
        [
          {
            "node": "Prepare Loop Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download PDF from Drive": {
      "main": [
        [
          {
            "node": "Upload Document to Autype",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Document to Autype": {
      "main": [
        [
          {
            "node": "Extract Title Page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}