Skip to main content

Generate invoice PDFs from Stripe payments using TemplateFox, Gmail and Drive

Workflow preview

Workflow preview
100%
Generate invoice PDFs from Stripe payments using TemplateFox, Gmail and Drive preview
Open on n8n.io

1. Workflow Overview

This workflow automatically generates and delivers professional invoice PDFs whenever a Stripe checkout session completes. It fetches the line items from Stripe, formats them into a clean invoice w...

Best for

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

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.stripetrigger, n8n-nodes-base.httprequest, n8n-nodes-base.code, n8n-nodes-templatefox.templatefox, n8n-nodes-base.gmail, n8n-nodes-base.googledrive

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Vince V.

Original n8n.io source

1.1 Workflow description

Title
Generate invoice PDFs from Stripe payments using TemplateFox, Gmail and Drive
Workflow name
Generate invoice PDFs from Stripe payments using TemplateFox, Gmail and Drive

This workflow automatically generates and delivers professional invoice PDFs whenever a Stripe checkout session completes. It fetches the line items from Stripe, formats them into a clean invoice with your company details, generates a branded PDF via TemplateFox, emails it to the customer, and saves a copy to Google Drive.

Problem Solved

Without this automation, invoicing after a Stripe payment requires:

  • Monitoring your Stripe dashboard for completed checkouts
  • Manually creating an invoice with the correct line items and totals
  • Exporting as PDF and emailing it to the customer
  • Saving the invoice to your file storage for bookkeeping
  • Repeating this for every single payment

This workflow handles all of that automatically for every Stripe checkout, including proper invoice numbering, due dates, and tax calculations.

Who Can Benefit

  • SaaS companies billing customers through Stripe Checkout
  • E-commerce stores sending invoices after purchase
  • Service providers using Stripe for client payments
  • Freelancers who want automatic invoicing after payment
  • Accountants who need invoice PDFs archived in Google Drive

Prerequisites

  • TemplateFox account with an API key (free tier available)
  • Stripe account with API access
  • Gmail account with OAuth2 configured
  • Google Drive account with OAuth2 configured
  • Install the TemplateFox community node from Settings → Community Nodes

Setting Up Your Template

You need a TemplateFox invoice template for this workflow. You can:

  1. Start from an example — Browse invoice templates, pick one you like, and customize it in the visual editor to match your branding
  2. Create from scratch — Design your own invoice template in the TemplateFox editor

Once your template is ready, select it from the dropdown in the TemplateFox node — no need to copy template IDs manually.

Workflow Details

Step 1: Stripe Trigger Fires on every completed checkout session (checkout.session.completed). This captures successful payments with full customer and product details.

Step 2: Get Line Items An HTTP Request node calls the Stripe API to fetch the line items for the checkout session (product names, quantities, amounts). Stripe doesn't include line items in the webhook payload, so this separate call is required.

Step 3: Format Invoice Data A Code node combines the Stripe session data and line items into a clean invoice structure: company details, client info (from Stripe customer), line items with prices, subtotal, tax, total, invoice number (auto-generated from date + session ID), and due date (Net 30).

Step 4: TemplateFox — Generate Invoice Select your invoice template from the dropdown — the node automatically loads your template's fields. Map each field to the matching output from the Code node (e.g. client_company{{ $json.client_company }}). TemplateFox generates a professional invoice PDF using your custom template.

Step 5a: Email Invoice Sends the invoice PDF link to the customer via Gmail with invoice number, amount, and due date.

Step 5b: Save to Google Drive Downloads the PDF and uploads it to a Google Drive folder for bookkeeping. Runs in parallel with the email step.

Customization Guidance

  • Company details: Set your company name, address, logo, bank details, and VAT number directly in the template editor — they never change between invoices, so there's no reason to pass them from n8n.
  • Invoice numbering: Modify the invoiceNumber format in the Code node (default: INV-YYYY-MMDD-XXXXXX).
  • Payment terms: Change the due date calculation (default: Net 30).
  • Drive folder: Set your Google Drive folder ID in the "Save to Google Drive" node.
  • Template: Use any invoice template from your TemplateFox account — select it from the dropdown.
  • Email body: Customize the invoice email text in the "Email Invoice" node.

Note: This template uses the TemplateFox community node. Install it from Settings → Community Nodes.

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

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

Block 2 - Sticky Note1

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

Block 3 - Sticky Note2

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

Block 4 - Sticky Note3

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

Block 5 - Stripe Trigger

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

Block 6 - Get Line Items

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

Block 7 - Format Invoice Data

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

Block 8 - TemplateFox

Type / Role
n8n-nodes-templatefox.templateFox - templateFox
Config choices
Version 1

Block 9 - Email Invoice

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

Block 10 - Download PDF

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

Block 11 - Save to Google Drive

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

3. Summary Table

Workflow Generate invoice PDFs from Stripe payments using TemplateFox, Gmail and Drive
Complexity intermediate
Nodes 11
Categories Invoice Processing
Author Vince V
Published 05 Apr 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/14761/14761.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 invoice PDFs from Stripe payments using TemplateFox, Gmail and Drive do?

This workflow automatically generates and delivers professional invoice PDFs whenever a Stripe checkout session completes. It fetches the line items from Stripe, formats them into a clean invoice w...

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.