{
  "name": "Generate PDF invoices with line item support from Airtable using Google Sheets",
  "nodes": [
    {
      "id": "18b67cf7-0177-424a-b834-3dd143d177a8",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        112,
        -384
      ]
    },
    {
      "id": "536218fd-ccb3-465d-9e98-ad4171e464dc",
      "name": "Create a record1",
      "type": "n8n-nodes-base.airtable",
      "position": [
        112,
        48
      ]
    },
    {
      "id": "fc3fc580-c2ae-4eaa-9434-18bab1dd1642",
      "name": "Add Service to DB",
      "type": "n8n-nodes-base.airtable",
      "position": [
        560,
        -384
      ]
    },
    {
      "id": "3e0cc576-d6e4-49ef-ae96-1e72451a0e45",
      "name": "Split Services",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        336,
        -384
      ]
    },
    {
      "id": "e1c5aa9f-2687-493f-b719-8250f73ded7a",
      "name": "Formatting Data",
      "type": "n8n-nodes-base.code",
      "position": [
        784,
        -384
      ]
    },
    {
      "id": "fd0eb607-53b0-4c2c-b4e5-a9a9a9be49fd",
      "name": "Get Previous Invoices",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1008,
        -384
      ]
    },
    {
      "id": "061b0353-3969-4111-b3bc-63deb1be87e1",
      "name": "Generate Invoice #",
      "type": "n8n-nodes-base.code",
      "position": [
        112,
        -176
      ]
    },
    {
      "id": "81ac9e60-1449-4dff-b09a-c8e5e91e1d1c",
      "name": "Copy Invoice Template",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        336,
        -176
      ]
    },
    {
      "id": "b5f35fce-d2c9-461e-a581-8b3250748d99",
      "name": "Add Services to Invoice",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        560,
        -176
      ]
    },
    {
      "id": "7aeabe32-d087-424a-a12e-89162500ea68",
      "name": "Get Client Info",
      "type": "n8n-nodes-base.airtable",
      "position": [
        784,
        -176
      ]
    },
    {
      "id": "4f80ca1f-631e-4cfc-8a12-c433d1b8996c",
      "name": "Add Client Info",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1008,
        -176
      ]
    },
    {
      "id": "c5aa8cf1-76f9-4f3d-8083-58da584563d4",
      "name": "Create a record1 (template)",
      "type": "n8n-nodes-base.airtable",
      "position": [
        112,
        48
      ]
    },
    {
      "id": "687a7047-3202-4992-a20f-f4e268e31f2e",
      "name": "Add Invoice Summary Info",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        336,
        48
      ]
    },
    {
      "id": "26ba7f66-02c0-4160-8766-fde3e9af4ad6",
      "name": "Share file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        560,
        48
      ]
    },
    {
      "id": "d4f2a694-b239-48ed-a1b6-6da33e66c30e",
      "name": "Update record",
      "type": "n8n-nodes-base.airtable",
      "position": [
        784,
        48
      ]
    },
    {
      "id": "c55694e2-5220-4cfd-aceb-36ae2ca08d39",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -912,
        -368
      ],
      "parameters": {
        "width": 928,
        "height": 720,
        "content": "# Automated Invoice Generator (Airtable + Google Sheets)\n\nThis workflow completely automates the invoicing process by turning raw JSON data into a formatted PDF and syncing it with your CRM. It specif"
      }
    },
    {
      "id": "b0179c1c-51af-48b7-b6c7-af62cae8e6f1",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        -400
      ],
      "parameters": {
        "width": 528,
        "height": null,
        "content": "## Process Line Items\nIterates through the incoming list of services, logging each one into the Airtable \"Services\" table and preparing the data for the invoice."
      }
    },
    {
      "id": "2636e5e0-c08b-4501-842d-35a4026c0806",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        -208
      ],
      "parameters": {
        "width": 528,
        "height": null,
        "content": "## Fill Template\nCalculates the new invoice number, duplicates the Google Sheet template, and maps the service rows and client details into the file."
      }
    },
    {
      "id": "1c027410-a3d7-4641-842d-cc25be66df3a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        -16
      ],
      "parameters": {
        "width": 528,
        "height": null,
        "content": "## Finalize & Sync\nCreates the master Invoice record in Airtable, generates a public PDF link from Google Drive, and attaches the final document to the CRM record."
      }
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Split Services",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Share file": {
      "main": [
        [
          {
            "node": "Update record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Services": {
      "main": [
        [
          {
            "node": "Add Service to DB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Client Info": {
      "main": [
        [
          {
            "node": "Create a record1 (template)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Formatting Data": {
      "main": [
        [
          {
            "node": "Get Previous Invoices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Client Info": {
      "main": [
        [
          {
            "node": "Add Client Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Service to DB": {
      "main": [
        [
          {
            "node": "Formatting Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Invoice #": {
      "main": [
        [
          {
            "node": "Copy Invoice Template",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Copy Invoice Template": {
      "main": [
        [
          {
            "node": "Add Services to Invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Previous Invoices": {
      "main": [
        [
          {
            "node": "Generate Invoice #",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Services to Invoice": {
      "main": [
        [
          {
            "node": "Get Client Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Invoice Summary Info": {
      "main": [
        [
          {
            "node": "Share file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a record1 (template)": {
      "main": [
        [
          {
            "node": "Add Invoice Summary Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}