Skip to main content

Generate PDF documents from HTML with PDF Generator API, Gmail and Supabase

Workflow preview

Workflow preview
100%
Generate PDF documents from HTML with PDF Generator API, Gmail and Supabase preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Who’s this for This template is designed for teams and developers who need to generate PDF documents automatically from HTML templates. It’s suitable for use cases such as invoices, confirmation...

Best for

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

Tools used

n8n-nodes-base.if, n8n-nodes-base.hunter, n8n-nodes-base.respondtowebhook, n8n-nodes-base.code, @pdfgeneratorapi/n8n-nodes-pdf-generator-api.pdfgeneratorapi, n8n-nodes-base.gmail, n8n-nodes-base.postgres, n8n-nodes-base.httprequest

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Marián Današ.

Original n8n.io source

1.1 Workflow description

Title
Generate PDF documents from HTML with PDF Generator API, Gmail and Supabase
Workflow name
Generate PDF documents from HTML with PDF Generator API, Gmail and Supabase

Who’s this for 💼

This template is designed for teams and developers who need to generate PDF documents automatically from HTML templates. It’s suitable for use cases such as invoices, confirmations, reports, certificates, or any custom document that needs to be created dynamically based on incoming data.

What this workflow does ⚙️

This workflow automates the full lifecycle of document generation, from request validation to delivery and storage. It is triggered by a POST webhook that receives structured JSON data describing the requested document and client information.

Before generating the document, the workflow validates the client’s email address using Hunter Email Verification to prevent invalid or mistyped emails. If the email is valid, the workflow loads the appropriate HTML template from a Postgres database, fills it with the incoming data, and converts it into a PDF using PDF Generator API.

Once the PDF is generated, it is sent to the client via Gmail, uploaded to Supabase Storage, and the transaction is recorded in the database for tracking and auditing purposes.

How it works 🛠️

  1. Receives a document generation request via a POST webhook.
  2. Validates the client’s email address using Hunter.
  3. Generates a PDF document from an HTML template using PDF Generator API.
  4. Sends the PDF via Gmail and uploads it to Supabase Storage.
  5. Stores a document generation record in the database.

How to set up 🖇️

Before activating the workflow, make sure all required services and connections are prepared and available in your n8n environment.

  • Create a POST webhook endpoint that accepts structured JSON input.
  • Add Hunter API credentials for email verification.
  • Add PDF Generator API credentials for HTML to PDF conversion.
  • Prepare a Postgres database with tables for HTML templates and document generation records.
  • Set up Gmail or SMTP credentials for email delivery.
  • Configure Supabase Storage for storing generated PDF files.

Requirements ✅

  • PDF Generator API account
  • Hunter account
  • Postgres database
  • Gmail or SMTP-compatible email provider
  • Supabase project with Storage enabled

How to customize the workflow 🤖

This workflow can be adapted to different document generation scenarios by extending or modifying its existing steps:

  • Add extra validation steps before document generation if required.
  • Extend delivery options by sending the generated PDF to additional services or webhooks.
  • Enhance security by adding document encryption or access control.
  • Add support for additional document types by storing more HTML templates in the database.
  • Modify the database schema or queries to store additional metadata related to generated documents.
  • Adjust the data mapping logic in the Code node to match your input structure.

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 - Email Is Valid?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 2 - Verify Client Email

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

Block 3 - Respond – Invalid Email

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.5

Block 4 - Populate HTML Template

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

Block 5 - Convert HTML to PDF

Type / Role
@pdfgeneratorapi/n8n-nodes-pdf-generator-api.pdfGeneratorApi - pdfGeneratorApi
Config choices
Version 1

Block 6 - Send PDF to Client Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 7 - Record Document Transaction

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 8 - Upload PDF to Supabase Storage

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.3

Block 9 - Load HTML Template

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 10 - Receive Document Request (Webhook)

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

Block 11 - Sticky Note

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

Block 12 - Sticky Note1

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

Block 13 - Sticky Note2

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

Block 14 - Sticky Note4

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

Block 15 - Sticky Note6

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

Block 16 - Sticky Note7

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

Block 17 - Sticky Note8

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

3. Summary Table

Workflow Generate PDF documents from HTML with PDF Generator API, Gmail and Supabase
Complexity advanced
Nodes 17
Categories Document Extraction
Author Marián Današ
Published 07 Jan 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/12554/12554.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 PDF documents from HTML with PDF Generator API, Gmail and Supabase do?

Who’s this for This template is designed for teams and developers who need to generate PDF documents automatically from HTML templates. It’s suitable for use cases such as invoices, confirmation...

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 use case.