Skip to main content

Automatic invoice generation and email with Airtable and CustomJS PDF generator

Workflow preview

Workflow preview
100%
Automatic invoice generation and email with Airtable and CustomJS PDF generator preview
Open on n8n.io

Important notice

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

1. Workflow Overview

️ Notice: This workflow uses the CustomJS Invoice Generator node from customjs.space, which requires a self hosted n8n instance and a CustomJS API key. Goog...

Best for

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

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.stickynote, n8n-nodes-base.airtable, n8n-nodes-base.aggregate, n8n-nodes-base.splitinbatches, @custom-js/n8n-nodes-pdf-toolkit.invoicegenerator, n8n-nodes-base.set, n8n-nodes-base.emailsend

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Automatic invoice generation and email with Airtable and CustomJS PDF generator
Workflow name
Automatic invoice generation and email with Airtable and CustomJS PDF generator

> ⚠️ Notice:
> This workflow uses the CustomJS Invoice Generator node from customjs.space, which requires a self-hosted n8n instance and a CustomJS API key.


Google Spreadsheet → Invoice Generation → Email Workflow

This workflow demonstrates how to:

  1. Pull invoices ready to be sent from Airtable.
  2. Retrieve client details and invoice items from Airtable.
  3. Generate a professional invoice PDF using CustomJS Invoice Generator.
  4. Send the completed invoice via email to the client.
  5. Update the invoice status in Airtable automatically.

Public Airtable Example


Workflow Overview

1. Trigger Workflow

  • Node: When clicking ‘Execute workflow’ (Manual Trigger)
  • Starts the workflow when executed manually in n8n.

2. Get Ready Invoices

  • Node: Get Ready Invoices (Airtable)
  • Retrieves all invoices from Airtable where Status = 'Ready'.

3. Loop Over Items

  • Node: Loop Over Items (Split In Batches)
  • Processes each invoice individually.

4. Get Clients

  • Node: Get Clients (Airtable)
  • Fetches client details for the current invoice:
    • Name
    • Address
    • Tax ID

5. Get Invoice Items

  • Node: Get Invoice Items (Airtable)
  • Retrieves all items associated with the invoice and passes them for aggregation.

6. Map Fields

  • Node: Map Fields (Set)
  • Maps the invoice items into a structured format for the invoice generator:
    • Description
    • Quantity / Hours
    • Unit Price
    • Invoice ID

7. Aggregate

  • Node: Aggregate
  • Aggregates all invoice items into a single JSON array for the invoice.

8. Set Company Details

  • Node: Set Company Details (Set)
  • Defines issuer and payment information:
    • Company Name
    • Address
    • Tax ID
    • Email & Phone
    • Bank Details

9. Generate Invoice

  • Node: Generate Invoice (CustomJS Invoice Generator)
  • Generates a PDF invoice using all collected data:
    • Issuer / Company information
    • Recipient / Client information
    • Invoice items
    • Billing information (Invoice number, date, currency, tax, notes)

10. Send Email With Attachment

  • Node: Send Email With Attachment (Email Send)

  • Sends the generated invoice PDF to the client:

    • From: {{ $json.InvoiceEmail }}

    • To: [email protected]

    • Subject: Your Invoice for Last Month

    • Body Text:

      Hello,
      
      Please find attached your invoice for the last month. Thank you very much for your cooperation.
      
      Best regards,
      Henrik
      
  • Uses SMTP credentials for sending emails.

11. Update Record

  • Node: Update record (Airtable)
  • Marks the invoice as Sent in Airtable.

Requirements

  • Self-hosted n8n instance
  • CustomJS API key
  • SMTP credentials
  • Airtable API key and base access

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 - When clicking ‘Execute workflow’

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

Block 2 - Sticky Note

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

Block 3 - Get Ready Invoices

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

Block 4 - Get Clients

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

Block 5 - Sticky Note1

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

Block 6 - Get Invoice Items

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

Block 7 - Aggregate

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

Block 8 - Loop Over Items

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

Block 9 - Sticky Note2

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

Block 10 - Update record

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

Block 11 - Generate Invoice

Type / Role
@custom-js/n8n-nodes-pdf-toolkit.invoiceGenerator - invoiceGenerator
Config choices
Version 1

Block 12 - Sticky Note3

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

Block 13 - Set Company Details

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 14 - Sticky Note4

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

Block 15 - Map Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 16 - Send Email With Attachment

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

Block 17 - Sticky Note5

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

Block 18 - Sticky Note6

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

3. Summary Table

Workflow Automatic invoice generation and email with Airtable and CustomJS PDF generator
Complexity advanced
Nodes 18
Categories Invoice Processing
Author CustomJS
Published 16 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9772/9772.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 Automatic invoice generation and email with Airtable and CustomJS PDF generator do?

️ Notice: This workflow uses the CustomJS Invoice Generator node from customjs.space, which requires a self hosted n8n instance and a CustomJS API key. Goog...

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.