Skip to main content

Generate, encrypt, and send invoices with PDF Generator API & Google Suite

Workflow preview

Workflow preview
100%
Generate, encrypt, and send invoices with PDF Generator API & Google Suite preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Why Creating and sending invoices manually is a major administrative bottleneck. It's not only slow but also prone to human error, such as creating duplicate invoice numbers or sending sensitive fi...

Best for

  • Invoice Processing automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.code, n8n-nodes-base.googlesheets, n8n-nodes-base.if, n8n-nodes-base.stickynote, n8n-nodes-base.webhook, @pdfgeneratorapi/n8n-nodes-pdf-generator-api.pdfgeneratorapi, n8n-nodes-base.googledrive, n8n-nodes-base.gmail

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, encrypt, and send invoices with PDF Generator API & Google Suite
Workflow name
Generate, encrypt, and send invoices with PDF Generator API & Google Suite

Why

Creating and sending invoices manually is a major administrative bottleneck. It's not only slow but also prone to human error, such as creating duplicate invoice numbers or sending sensitive financial data in an unsecured format. This workflow solves these problems by creating a robust, end-to-end automation. It ensures every invoice has a unique ID, is professionally generated, is password-protected, and is delivered to your customer automatically.

What

This workflow provides a complete, secure solution for automated invoicing. It is designed to be triggered by a Webhook (e.g., from your e-commerce store, CRM, or billing platform) that provides customer and order details.

The workflow then executes the following steps:

  1. Generate & Verify ID: It first generates a new invoice ID. It then performs a critical check by reading your master Google Sheet to ensure this ID is unique, preventing duplicate invoices.
  2. Generate PDF: Once the ID is verified, it passes the data to the PDF Generator API. This service dynamically populates your custom invoice template. (PDF Generator API makes it incredibly easy to build and manage your document templates via their web-based editor).
  3. Encrypt Document: For enhanced security, the workflow uses a PDF Generator API operation to encrypt the newly generated invoice with a password, protecting your client's sensitive data.
  4. Store & Deliver: Finally, it uploads the secure PDF to a specified Google Drive folder for your records and then automatically sends it to the customer as an attachment using Gmail.

How

  1. Prerequisites: You will need active accounts for:
    • PDF Generator API (for both generation and encryption)
    • Google Suite (for Sheets, Drive, and Gmail)
  2. PDF Generator API Setup:
    • Log in to your PDF Generator API account and use their template builder to create your invoice design.
    • Note your Template ID, API Key, and API Secret.
    • In the n8n PDFGeneratorAPI node (Generate a PDF document), create new credentials using your Key and Secret. In the node's parameters, select your Template ID from the list.
  3. Google Sheets Setup:
    • Create a Google Sheet to act as your master list of invoices.
    • In the Check If ID Already Exists node, authenticate your Google Sheets account. Set the Spreadsheet ID and Sheet Name. In the "Columns to Return" field, enter the name of the column where you store your invoice IDs.
  4. Security & Delivery Setup:
    • Encrypt Node: In the Encrypt PDF document node, authenticate your PDF Generator API credentials (the same ones from Step 2). You can set a static password, or for better security, use an expression to set a dynamic password from the webhook data (e.g., the customer's postal code or order ID).
    • Google Drive Node: Authenticate the Upload file node and specify the Drive and Folder ID where invoices should be stored.
    • Gmail Node: Authenticate the Send a message + file node. Use an expression to map the customer's email from the trigger data into the "To" field.
  5. Test & Activate:
    • The Webhook node has pinned test data. You can click "Test workflow" to run the entire process with this sample data.
    • Once you confirm the file is generated, encrypted, and sent, connect your live app (e.g., Shopify, Stripe, etc.) to the production Webhook URL.
    • Activate the workflow.

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 - Generate Invoice ID

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

Block 2 - Check if ID Already Exists

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

Block 3 - If Does not Exist

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

Block 4 - Sticky Note

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 - Sticky Note2

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

Block 7 - Sticky Note3

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

Block 8 - Webhook

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

Block 9 - Generate a PDF document

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

Block 10 - Sticky Note4

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

Block 11 - Upload file

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 12 - Send a message + file

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

Block 13 - Encrypt PDF document

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

3. Summary Table

Workflow Generate, encrypt, and send invoices with PDF Generator API & Google Suite
Complexity intermediate
Nodes 13
Categories Invoice Processing
Author Marián Današ
Published 31 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/10387/10387.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, encrypt, and send invoices with PDF Generator API & Google Suite do?

Why Creating and sending invoices manually is a major administrative bottleneck. It's not only slow but also prone to human error, such as creating duplicate invoice numbers or sending sensitive fi...

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