Back to templates
Finance & Automation

Airtable Invoice Generator

Generate professional PDF invoices from Airtable records with email delivery and payment tracking.

Airtable
PDF
Invoice
Email
Finance
Automation

About this template

Automate your invoicing workflow with this Airtable-powered invoice generator. When a record is marked as 'Ready to Invoice', this workflow generates a professional PDF invoice using a customizable HTML template, emails it to the client, and updates the Airtable record with the sent status and invoice link. Integrates with payment gateways for tracking and includes automatic reminders for overdue invoices.

Workflow JSON

{
  "name": "Airtable Invoice Generator",
  "nodes": [
    {
      "parameters": {
        "content": "## Template by Harshith Vaddiparthy\n\n\n**Learn to Build AI Automations**\nMaster n8n, AI agents, and no-code automation in my comprehensive course.\n→ harshith.com/vibecode\n\n\n**Content Automation Consulting**\nI help businesses automate video creation, social media, blogs, and newsletters.\n→ harshith.com/meet\n\n\n**Connect with me**\n→ linkedin.com/in/harshith-vaddiparthy",
        "height": 420,
        "width": 400,
        "color": 4
      },
      "id": "promo-sticky",
      "name": "Sticky Note - Credits",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -500,
        -200
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "tableId": "YOUR_AIRTABLE_TABLE_ID",
        "triggerField": "Status",
        "additionalFields": {}
      },
      "id": "airtable-trigger",
      "name": "Watch Airtable",
      "type": "n8n-nodes-base.airtableTrigger",
      "position": [
        0,
        100
      ],
      "credentials": {
        "airtableTokenApi": {
          "id": "YOUR_AIRTABLE_CREDENTIAL_ID",
          "name": "Airtable"
        }
      },
      "typeVersion": 1
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "status-check",
              "leftValue": "={{ $json.fields.Status }}",
              "rightValue": "Ready to Invoice",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        }
      },
      "id": "check-status",
      "name": "Check Status",
      "type": "n8n-nodes-base.if",
      "position": [
        200,
        100
      ],
      "typeVersion": 2.2
    },
    {
      "parameters": {
        "jsCode": "const record = $input.first().json;\nconst fields = record.fields;\n\nconst invoiceNumber = `INV-${Date.now()}`;\nconst date = new Date().toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' });\nconst dueDate = new Date(Date.now() + 30*24*60*60*1000).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' });\n\nconst html = `\n<!DOCTYPE html>\n<html>\n<head>\n  <style>\n    body { font-family: Arial, sans-serif; max-width: 800px; margin: 0 auto; padding: 40px; }\n    .header { display: flex; justify-content: space-between; margin-bottom: 40px; }\n    .invoice-title { font-size: 32px; color: #333; }\n    .invoice-details { text-align: right; color: #666; }\n    .client-info { margin-bottom: 30px; }\n    table { width: 100%; border-collapse: collapse; margin: 20px 0; }\n    th, td { padding: 12px; text-align: left; border-bottom: 1px solid #ddd; }\n    th { background: #f5f5f5; }\n    .total { font-size: 20px; font-weight: bold; text-align: right; margin-top: 20px; }\n  </style>\n</head>\n<body>\n  <div class=\"header\">\n    <div class=\"invoice-title\">INVOICE</div>\n    <div class=\"invoice-details\">\n      <div><strong>${invoiceNumber}</strong></div>\n      <div>Date: ${date}</div>\n      <div>Due: ${dueDate}</div>\n    </div>\n  </div>\n  <div class=\"client-info\">\n    <strong>Bill To:</strong><br>\n    ${fields['Client Name'] || 'Client'}<br>\n    ${fields['Client Email'] || ''}\n  </div>\n  <table>\n    <tr><th>Description</th><th>Amount</th></tr>\n    <tr><td>${fields['Description'] || 'Services'}</td><td>$${fields['Amount'] || '0.00'}</td></tr>\n  </table>\n  <div class=\"total\">Total: $${fields['Amount'] || '0.00'}</div>\n</body>\n</html>\n`;\n\nreturn [{ json: { html, invoiceNumber, clientEmail: fields['Client Email'], recordId: record.id, amount: fields['Amount'] } }];"
      },
      "id": "generate-html",
      "name": "Generate Invoice HTML",
      "type": "n8n-nodes-base.code",
      "position": [
        400,
        100
      ],
      "typeVersion": 2
    },
    {
      "parameters": {
        "url": "https://api.html2pdf.app/v1/generate",
        "method": "POST",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\"html\": \"{{ $json.html.replace(/\"/g, '\\\\\"').replace(/\\n/g, '') }}\", \"apiKey\": \"YOUR_HTML2PDF_API_KEY\"}"
      },
      "id": "generate-pdf",
      "name": "Generate PDF",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        600,
        100
      ],
      "typeVersion": 4.2
    },
    {
      "parameters": {
        "fromEmail": "invoices@yourcompany.com",
        "toEmail": "={{ $('Generate Invoice HTML').item.json.clientEmail }}",
        "subject": "=Invoice {{ $('Generate Invoice HTML').item.json.invoiceNumber }}",
        "emailType": "html",
        "message": "=<p>Please find attached your invoice {{ $('Generate Invoice HTML').item.json.invoiceNumber }} for ${{ $('Generate Invoice HTML').item.json.amount }}.</p><p>Payment is due within 30 days.</p>",
        "options": {
          "attachments": "data"
        }
      },
      "id": "send-email",
      "name": "Send Invoice Email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        800,
        100
      ],
      "credentials": {
        "smtp": {
          "id": "YOUR_SMTP_CREDENTIAL_ID",
          "name": "SMTP"
        }
      },
      "typeVersion": 2.1
    },
    {
      "parameters": {
        "operation": "update",
        "tableId": "YOUR_AIRTABLE_TABLE_ID",
        "id": "={{ $('Generate Invoice HTML').item.json.recordId }}",
        "fields": {
          "Status": "Invoiced",
          "Invoice Number": "={{ $('Generate Invoice HTML').item.json.invoiceNumber }}",
          "Invoice Date": "={{ $now.toISODate() }}"
        }
      },
      "id": "update-airtable",
      "name": "Update Airtable",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1000,
        100
      ],
      "credentials": {
        "airtableTokenApi": {
          "id": "YOUR_AIRTABLE_CREDENTIAL_ID",
          "name": "Airtable"
        }
      },
      "typeVersion": 2.1
    },
    {
      "parameters": {
        "content": "## Airtable Invoice Generator\n\n### Setup:\n1. Create Airtable base with: Client Name, Email, Description, Amount, Status\n2. Set up SMTP credentials for email\n3. Get HTML2PDF API key (or use similar service)\n\n### Flow:\n1. Monitors Airtable for 'Ready to Invoice' records\n2. Generates professional HTML invoice\n3. Converts to PDF\n4. Emails to client\n5. Updates Airtable with invoice details\n\n### Customization:\n- Modify HTML template in Code node\n- Add your company branding\n- Integrate with Stripe for payment links",
        "height": 380,
        "width": 400,
        "color": 7
      },
      "id": "info-sticky",
      "name": "Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -500,
        40
      ],
      "typeVersion": 1
    }
  ],
  "connections": {
    "Watch Airtable": {
      "main": [
        [
          {
            "node": "Check Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Status": {
      "main": [
        [
          {
            "node": "Generate Invoice HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Invoice HTML": {
      "main": [
        [
          {
            "node": "Generate PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate PDF": {
      "main": [
        [
          {
            "node": "Send Invoice Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Invoice Email": {
      "main": [
        [
          {
            "node": "Update Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "instanceId": "template-airtable-invoice"
  }
}

Copy this JSON and import it into n8n via Settings → Import from File/URL → Paste JSON

Free n8n Automation Templates | Production-Ready Workflows | Harshith Vaddiparthy