{"product_id":"n8n-invoice-automation-js-google-sheets-pdf-drive-email","title":"n8n Invoice Automation: JS + Google Sheets PDF, Drive \u0026 Email","description":"\u003ch3\u003eTurn form submissions into branded PDF invoices—automatically\u003c\/h3\u003e\n\u003cp\u003eThis n8n invoice automation workflow takes each new order form submission, generates a unique invoice\/order ID, creates a PDF invoice, stores it in your cloud, emails it to the customer, and logs all invoice data in Google Sheets—end to end.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eWebhook Trigger:\u003c\/strong\u003e Starts when an order form is submitted, capturing customer and order details.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGenerate a unique Order ID:\u003c\/strong\u003e A \u003cstrong\u003eFunction\/Code\u003c\/strong\u003e step creates a random alphanumeric ID (example: \u003cem\u003eINV-X92B7D\u003c\/em\u003e).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDuplicate prevention with Google Sheets:\u003c\/strong\u003e The workflow checks your invoice log sheet for the generated ID. If a duplicate is found, it regenerates the ID and loops until the ID is unique.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePrepare invoice data:\u003c\/strong\u003e A \u003cstrong\u003eSet\u003c\/strong\u003e step formats customer info, order items, date, and the unique order ID for your invoice template.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eConvert HTML to PDF:\u003c\/strong\u003e An \u003cstrong\u003eHTTP Request\u003c\/strong\u003e node sends the invoice HTML to a RapidAPI HTML-to-PDF service and receives the PDF.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eUpload to Drive (or Dropbox):\u003c\/strong\u003e The PDF is saved to \u003cstrong\u003eGoogle Drive or Dropbox\u003c\/strong\u003e with a clear filename like \u003cem\u003eInvoice-INV-X92B7D.pdf\u003c\/em\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eEmail the invoice:\u003c\/strong\u003e An \u003cstrong\u003eEmail Send\u003c\/strong\u003e node attaches the PDF and includes the order ID in the email subject\/body.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLog the invoice:\u003c\/strong\u003e The workflow appends customer info, order ID, total, and the PDF link to your Google Sheet for tracking.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eSmall SaaS or service businesses that receive orders via web forms and need automatic invoice PDFs.\u003c\/li\u003e\n  \u003cli\u003eTeams that want reliable invoice tracking with unique IDs and a Google Sheets audit log.\u003c\/li\u003e\n  \u003cli\u003eOperations workflows that require sending invoices immediately after checkout without manual work.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n nodes:\u003c\/strong\u003e Webhook, Code\/Function, IF, Set, HTTP Request, Email Send, and a PDF upload step for Google Drive or Dropbox (plus supporting nodes like Sticky Notes for clarity).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eData store:\u003c\/strong\u003e Google Sheets invoice log (duplicate ID checks + invoice logging).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePDF generation:\u003c\/strong\u003e RapidAPI HTML-to-PDF via HTTP Request.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45785776193715,"sku":"N8N-4105","price":10.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/i2BQaToPgH6CkJsI_6Kwa_s7fjHkVS.png?v=1786180724","url":"https:\/\/buyflowscripts.com\/products\/n8n-invoice-automation-js-google-sheets-pdf-drive-email","provider":"N8N Commerce","version":"1.0","type":"link"}