{
  "name": "Automate PDF invoice generation & delivery with Gmail and Google Drive storage",
  "nodes": [
    {
      "id": "3060dd2d-bf5b-404e-8f85-c0bc78a3075e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        -192
      ],
      "parameters": {
        "width": 214,
        "height": 272,
        "content": "✅ **SUCCESS RESPONSE**\n\n- Confirms invoice generated\n- Returns invoice number & total\n- Email delivery confirmation\n- Google Drive storage status\n- Complete operation summary"
      }
    },
    {
      "id": "353da029-1514-40d0-969b-bcd2816bdbcc",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -800,
        112
      ]
    },
    {
      "id": "d3c566ba-582b-4e17-b30d-580c5e617630",
      "name": "Process Invoice Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -576,
        112
      ]
    },
    {
      "id": "659c77de-7c5c-4a49-9525-07b0106460da",
      "name": "Generate HTML Template",
      "type": "n8n-nodes-base.code",
      "position": [
        -352,
        112
      ]
    },
    {
      "id": "7fe430f5-e516-4f3f-9ffd-d82e3a3db05a",
      "name": "Generate PDF",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -112,
        112
      ]
    },
    {
      "id": "9b88a23b-b415-4f2c-b818-a12a6e5c2bf6",
      "name": "Send Email to Customer",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        128,
        48
      ]
    },
    {
      "id": "5279d3ca-eff7-45dc-bcc6-41f85bbe2bb6",
      "name": "Save to Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        128,
        176
      ]
    },
    {
      "id": "629c75bd-88a2-4ea7-a3dc-5450387d6378",
      "name": "Success Response",
      "type": "n8n-nodes-base.code",
      "position": [
        352,
        112
      ]
    },
    {
      "id": "921ff838-cd75-4f5b-9b29-9d96fbcac947",
      "name": "Respond Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        576,
        112
      ]
    },
    {
      "id": "0c4bb277-7fe4-419c-bee0-69dede34a59e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        96,
        320
      ],
      "parameters": {
        "width": 214,
        "height": 224,
        "content": "☁️ **SAVE TO DRIVE**\n\n- Uploads PDF to Google Drive\n- Organized folder structure\n- Automated file naming\n- Backup for accounting records\n- Secure cloud storage"
      }
    },
    {
      "id": "be43dfc4-8068-44db-bbcb-f81dc86d2162",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        32,
        -208
      ],
      "parameters": {
        "width": 214,
        "height": 240,
        "content": "📧 **SENDS TO CUSTOMER**\n\n- Emails PDF invoice to customer\n- Professional email template\n- Includes payment instructions\n- Attachment with generated PDF\n- Confirms delivery status"
      }
    },
    {
      "id": "84e365dd-a54a-4ce0-a273-ae8cbfb9bf93",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        -160
      ],
      "parameters": {
        "width": 214,
        "height": 256,
        "content": "📄 **INVOICE GENERATION**\n\n- Creates professional HTML template\n- Applies company branding & colors\n- Builds itemized table with pricing\n- Adds payment terms and due dates\n- Includes company contact de"
      }
    },
    {
      "id": "3673840a-5ac8-48ec-af6a-c30db464e73d",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        -144
      ],
      "parameters": {
        "width": 214,
        "height": 256,
        "content": "⚙️ **PREPARING INVOICE**\n\n- Extracts customer data from webhook\n- Validates required fields (email, items)\n- Calculates line totals and subtotals\n- Applies tax rates (default 10%)\n- Formats dates and "
      }
    }
  ],
  "connections": {
    "Generate PDF": {
      "main": [
        [
          {
            "node": "Send Email to Customer",
            "type": "main",
            "index": 0
          },
          {
            "node": "Save to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "Process Invoice Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Success Response": {
      "main": [
        [
          {
            "node": "Respond Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Invoice Data": {
      "main": [
        [
          {
            "node": "Generate HTML Template",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save to Google Drive": {
      "main": [
        [
          {
            "node": "Success Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate HTML Template": {
      "main": [
        [
          {
            "node": "Generate PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email to Customer": {
      "main": [
        [
          {
            "node": "Success Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}