{
  "name": "Generate PDF documents from HTML with PDF Generator API, Gmail and Supabase",
  "nodes": [
    {
      "id": "4ac094e9-0394-48e0-bd5c-28d96eb46070",
      "name": "Email Is Valid?",
      "type": "n8n-nodes-base.if",
      "position": [
        -1024,
        208
      ]
    },
    {
      "id": "cfc188dc-929c-484a-a568-5478d68e6e5f",
      "name": "Verify Client Email",
      "type": "n8n-nodes-base.hunter",
      "position": [
        -1216,
        208
      ]
    },
    {
      "id": "ec1b958f-2c27-438f-8dcf-422225d5f265",
      "name": "Respond – Invalid Email",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -800,
        432
      ]
    },
    {
      "id": "b062010d-eb82-42a4-a058-b4081ff2847c",
      "name": "Populate HTML Template",
      "type": "n8n-nodes-base.code",
      "position": [
        -544,
        192
      ]
    },
    {
      "id": "f3c33a39-c44d-4f6a-b71c-e443a5106e8e",
      "name": "Convert HTML to PDF",
      "type": "@pdfgeneratorapi/n8n-nodes-pdf-generator-api.pdfGeneratorApi",
      "position": [
        -304,
        192
      ]
    },
    {
      "id": "e9bc752d-8f5f-47d2-8328-f33329e53653",
      "name": "Send PDF to Client Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -32,
        320
      ]
    },
    {
      "id": "7b5761b2-30db-4d09-aaf3-0408dfe04518",
      "name": "Record Document Transaction",
      "type": "n8n-nodes-base.postgres",
      "position": [
        256,
        48
      ]
    },
    {
      "id": "c45a8c6f-a923-4def-8706-8dc0605a460a",
      "name": "Upload PDF to Supabase Storage",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -32,
        48
      ]
    },
    {
      "id": "61cbe3d7-08e3-4791-9b42-d32646960b75",
      "name": "Load HTML Template",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -768,
        192
      ]
    },
    {
      "id": "54e77c74-c3dd-46ba-aaa0-a56c89868a19",
      "name": "Receive Document Request (Webhook)",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1472,
        384
      ]
    },
    {
      "id": "f2a780d1-bfbf-4d23-b717-018e828fb326",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1568,
        -576
      ],
      "parameters": {
        "width": 688,
        "height": 624,
        "content": "## Automate document creation from HTML using PDF Generator API, Gmail & Supabase\n\nThis workflow automates the creation, validation, and delivery of PDF documents generated from HTML templates using *"
      }
    },
    {
      "id": "603ed4b5-f72c-4bc7-bda3-9c551b5dbddf",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1568,
        112
      ],
      "parameters": {
        "width": 272,
        "height": 464,
        "content": "## 1. Webhook input\n\nThis pinned data simulates a test JSON payload from the webhook. \n\nIt includes sample information such as the document type, client details, request metadata, and dynamic data use"
      }
    },
    {
      "id": "cd77297d-bada-4e5e-9199-80671f473f15",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1264,
        112
      ],
      "parameters": {
        "width": 384,
        "height": 256,
        "content": "## 2. Validation – Email verification"
      }
    },
    {
      "id": "bb1bb4fb-7ae0-4776-b9dc-a8c8d729d404",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1040,
        400
      ],
      "parameters": {
        "width": 432,
        "height": 176,
        "content": "\n\n\n\n## 2.1. Invalid email"
      }
    },
    {
      "id": "cfc93c59-5485-448e-a6e9-1d0c0c01a915",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -848,
        112
      ],
      "parameters": {
        "width": 720,
        "height": 256,
        "content": "## 3. Generate PDF document"
      }
    },
    {
      "id": "40946d85-302f-4fdb-9d47-66f89cbee246",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        -32
      ],
      "parameters": {
        "width": 272,
        "height": 256,
        "content": "## 5. Record transaction"
      }
    },
    {
      "id": "50715f88-c0f3-4723-bb80-f19a7d6a5579",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        -32
      ],
      "parameters": {
        "width": null,
        "height": 512,
        "content": "## 4. Email & storage"
      }
    }
  ],
  "connections": {
    "Email Is Valid?": {
      "main": [
        [
          {
            "node": "Load HTML Template",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Respond – Invalid Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load HTML Template": {
      "main": [
        [
          {
            "node": "Populate HTML Template",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert HTML to PDF": {
      "main": [
        [
          {
            "node": "Upload PDF to Supabase Storage",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send PDF to Client Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Verify Client Email": {
      "main": [
        [
          {
            "node": "Email Is Valid?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Populate HTML Template": {
      "main": [
        [
          {
            "node": "Convert HTML to PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send PDF to Client Email": {
      "main": [
        []
      ]
    },
    "Upload PDF to Supabase Storage": {
      "main": [
        [
          {
            "node": "Record Document Transaction",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Document Request (Webhook)": {
      "main": [
        [
          {
            "node": "Verify Client Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}