Generate invoices, save to Drive and send email to customer with JS + G Sheets
This workflow automates invoice generation from form submissions, ensuring unique order IDs, creating PDF invoices, storing files, emailing customers, and logging invoice data β all seamlessly integrated. --- πΉ Workflow Overview 1. Trigger (Webhook) Starts when an order form is submitted, capturing customer and order details. 2. Generate Random Order ID A Function node creates a unique alphanumeric invoice ID (e.g., INV-X92B7D). 3. Check for Duplicate Order ID Goog
At a glance
Generate invoices, save to Drive and send email to customer with JS + G Sheets is a ready-made n8n workflow you import as a workflow JSON file β no build required. It connects code, emailSend, googleDrive, googleSheets. It's free to download. Follow the 5-step import below to go live in minutes.
- Platform
- n8n
- Connects
- code, emailSend, googleDrive, googleSheets, httpRequest, if
- Modules
- 11
- Price
- Free
- Version
- v1.0

About this workflow
This workflow automates invoice generation from form submissions, ensuring unique order IDs, creating PDF invoices, storing files, emailing customers, and logging invoice data β all seamlessly integrated. --- πΉ Workflow Overview 1. Trigger (Webhook) Starts when an order form is submitted, capturing customer and order details. 2. Generate Random Order ID A Function node creates a unique alphanumeric invoice ID (e.g., INV-X92B7D). 3. Check for Duplicate Order ID Google Sheets looks up the generated order ID in your invoice log sheet to prevent duplicates. 4. Conditional Check (IF Node) If the ID already exists β regenerates a new ID (loops back) If unique β proceeds to invoice creation 5. Prepare Invoice Data A Set node formats customer info, date, order items, and the unique order ID to fit your invoice template. 6. Convert HTML to PDF HTTP Request node sends your invoice HTML to the RapidAPI HTML-to-PDF service and receives the PDF file. 7. Upload PDF to Cloud Storage Save the PDF in Google Drive or Dropbox with a clear file name like Invoice-INV-X92B7D.pdf. 8. Send Invoice Email to Customer Email node attaches the PDF and includes the order ID in the email subject/body. 9. Log Invoice Details Append invoice data (customer info, order ID, total, PDF link) to your Google Sheet for tracking. --- βοΈ Node Details & Setup 1. Webhook Trigger Configure to receive form submissions (order details like name, email, items, total). 2. Function: Generate Random Order ID Sample JS code generates unique IDs prefixed by INV-. 3. Google Sheets: Lookup Row Set up connection to your invoice log sheet. Search for existing order ID to avoid duplicates. 4. IF Node: Check Order ID Existence Condition: If order ID found β loop to regenerate. Else β continue workflow. 5. Set Node: Prepare Invoice HTML Define variables like customer name, date, items, and order ID. This data populates your HTML invoice template. 6. HTTP Request: Convert HTML to PDF API URL to get your key Send invoice HTML in the request body. Receive PDF file blob or download URL. 7. Google Drive (or Dropbox) Upload Upload the PDF file. Use file name format: Invoice-{{$json["orderid"]}}.pdf 8. Email Node Recipient: customer email from the form data. Attach generated PDF. Include order ID in email subject or body for reference. 9. Google Sheets: Append Row Log invoice metadata to keep records updated. --- π Google Sheets Template You can make a copy of the invoice log template here This sheet includes columns for order\id, customer name, email, total, and invoice PDF link. Customize it as needed. --- π Additional Notes Customize the invoice HTML template inside the Set node to match your branding. Ensure API credentials for RapidAPI, Google Drive/Dropbox, and email are properly set up in your n8n credentials. You can expand this workflow by adding payment processing or SMS notifications. --- Need help or want a custom workflow? Reach out via email at joseph@uppfy.com.
How to import this n8n workflow
- 1
Download the workflow JSON file after purchase.
- 2
Open n8n β click the menu β Import from File.
- 3
Select the downloaded JSON and import.
- 4
Set up credentials for each node that requires them.
- 5
Click Execute Workflow to test, then activate.
Setup guide
Setup guide included
Purchase to unlock the full step-by-step guide
Related N8n workflows
AI-powered Telegram task assistant with Notion integration
AI resume screening with GPT-4o & error handling | Google Sheets & Drive flow
Auto generate & post LinkedIn content for Amazon sellers with GPT-4o & Apify
Telegram AI bot-to-human handoff for sales calls
Centralized n8n error management system with automated email alerts via Gmail
Sync GitHub workflows to n8n after pull request merges
Audit competitor SEO content with Decodo, Gemini, and Google Sheets
Extract pay slip data with Line Chatbot and Gemini to Google Sheets
Reviews
No reviews yet
Be the first to buy and share your experience.
Leave a review
Sign in to share your experience with this workflow.
Create a free account to purchase workflows.
- JSON blueprint β instant download
- Setup guide PDF included
- 5 downloads Β· valid 30 days
- Works with n8n
Need help setting this up?
Book a 3-hour live setup session with an Agility consultant.
- Configure live on Google Meet / Zoom
- Free follow-up if workflow has defects
- Platform expert assigned to you