How to Automate Invoice Processing with n8n: Complete Tutorial 2026
Small business owners spend 8.3 hours per week on invoicing alone. That is 432 hours per year — over 10 full work weeks — spent on creating invoices, sending emails, chasing payments, and filing documents. In this tutorial, you will build a production-ready n8n workflow that automatically generates PDF invoices, emails them to clients, saves copies to Google Drive, and notifies your team on Slack — all in under 30 minutes of setup. No coding required beyond copying and pasting JSON.
1. The Real Cost of Manual Invoicing
Before we build anything, let us understand the pain. Here is what a typical small business owner does every time a payment comes in:
- Log into Stripe/PayPal/bank account
- Copy customer name, email, amount, and date
- Open a Word or Google Docs invoice template
- Fill in the details manually
- Export as PDF
- Open email client
- Attach PDF, write subject line, personalize message
- Send email
- Upload PDF to Google Drive or Dropbox for records
- Message the team on Slack or WhatsApp about the new sale
Time per invoice: 12–18 minutes. At 50 invoices per month, that is 10–15 hours of soul-crushing repetition. Over a year, you are donating 120–180 hours to a machine that could do it in seconds.
The solution is not hiring a VA (expensive, still manual) or buying expensive invoicing software (limited flexibility). The solution is n8n — an open-source automation platform that connects your payment processor, email, cloud storage, and team chat into one seamless workflow.
2. What We Will Build: Workflow Overview
Here is the complete workflow we are building today:
| Step | Action | Tool/Node | Time Saved |
|---|---|---|---|
| 1 | Detect new payment | Stripe Trigger (Webhook) | 2 min/invoice |
| 2 | Fetch customer and payment details | Stripe node | 3 min/invoice |
| 3 | Generate branded PDF invoice | HTML node + APITemplate | 4 min/invoice |
| 4 | Email invoice to customer | Send Email (SMTP/Gmail) | 3 min/invoice |
| 5 | Save PDF to Google Drive | Google Drive node | 2 min/invoice |
| 6 | Notify team on Slack | Slack node | 1 min/invoice |
Total time saved per invoice: 15 minutes. At 50 invoices per month, that is 12.5 hours reclaimed — time you can spend on sales, product development, or actually living your life.
3. Prerequisites and Setup
3.1 n8n Instance
You need a running n8n instance. Choose one:
| Option | Cost | Setup Time | Best For |
|---|---|---|---|
| n8n Cloud (Starter) | $24/mo | 2 minutes | Non-technical users, quick start |
| Self-hosted (Docker) | ~$5/mo VPS | 20 minutes | Technical users, full control |
| Self-hosted (Local) | $0 | 10 minutes | Testing, development only |
Recommendation: If this is your first n8n workflow, start with n8n Cloud Starter. It takes 2 minutes to sign up and you get a managed instance with SSL, backups, and support. Once you are comfortable, migrate to self-hosted to save money.
Start n8n Cloud Free Trial3.2 Required Accounts and Credentials
- Stripe — Test mode is fine for this tutorial. You need your API secret key (starts with
sk_test_orsk_live_). - Google Account — For Gmail (sending emails) and Google Drive (file storage).
- Slack Workspace — For team notifications. You need to create an incoming webhook.
- PDF Generation Service — We recommend APITemplate.io (free tier: 50 PDFs/month) or PDFMonkey (free tier: 100 PDFs/month). Both have n8n integrations.
3.3 Security Warning
4. Step 1: Create the n8n Workflow Trigger
Create a New Workflow
Log into your n8n instance and click Add Workflow (top right). Name it Invoice Automation — Stripe to PDF.
Add the Stripe Trigger Node
Click the + button to add a node. Search for Stripe Trigger and select it. Configure:
- Event:
charge.succeeded(fires when a payment is successfully captured) - Credential: Select or create your Stripe API credential
- Mode:
Testfor development,Livefor production
charge.succeeded and not invoice.payment_succeeded?
charge.succeeded fires on every successful payment, including one-time purchases and subscription renewals.
invoice.payment_succeeded only fires for Stripe Billing invoices. If you use Stripe Checkout or custom payment flows, stick with charge.succeeded.
Test the Trigger
Click Execute Node (top right of the node). Then, in your Stripe Dashboard, go to Developers → Webhooks and send a test event. Alternatively, create a test payment in Stripe Checkout. You should see the webhook payload appear in n8n’s output panel.
Expected output structure:
5. Step 2: Fetch Payment Data from Stripe
Add a Stripe Node to Enrich Data
The webhook gives us basic data, but we need the customer’s full details for a professional invoice. Add a Stripe node (not the trigger) and configure:
- Resource:
Customer - Operation:
Get - Customer ID:
{{ $json.customer }}(this references the customer ID from the trigger)
Connect the Stripe Trigger node to this Stripe Get Customer node. Now, when a payment comes in, n8n will automatically fetch the full customer profile.
Add a Set Node to Prepare Invoice Data
Add a Set node to structure the data we need for the invoice. This makes the workflow cleaner and ensures consistent formatting.
{{ Date.now() }} expression to generate unique invoice numbers. For sequential numbering, store a counter in a Google Sheet or n8n data store and increment it each time.
6. Step 3: Generate the PDF Invoice
This is the most visually important step. We will use APITemplate.io to generate a professional PDF invoice from an HTML template.
6.1 Create Your Invoice Template on APITemplate.io
- Sign up at APITemplate.io (free tier: 50 PDFs/month)
- Go to Manage Templates → New Template
- Choose HTML to PDF
- Paste the invoice HTML below
- Save and note your Template ID
6.2 Add the HTTP Request Node to Generate PDF
Configure the HTTP Request Node
Add an HTTP Request node and configure:
- Method:
POST - URL:
https://api.apitemplate.io/v2/create - Authentication: Header Auth
- Header Name:
X-API-KEY - Header Value: Your APITemplate API key (stored in Credentials)
JSON Body:
download_url field containing a temporary link to the generated PDF (valid for 24 hours). We will use this URL in the next steps.
Alternative: If you prefer not to use a third-party service, you can use n8n’s built-in HTML node to render HTML, then send it to a self-hosted PDF service like Gotenberg or WeasyPrint. This eliminates per-PDF costs but requires more setup.
7. Step 4: Send Invoice via Email
Add the Send Email Node
Add a Send Email node (or Gmail node if you use Google Workspace). Configure:
Option A: SMTP (Generic Email)
- To:
{{ $json.customer_email }} - Subject:
Invoice {{ $json.invoice_number }} from {{ $json.company_name }} - Text: A plain-text fallback message
- HTML: A branded HTML email body
- Attachments: URL:
{{ $json.download_url }}, Name:Invoice-{{ $json.invoice_number }}.pdf
Option B: Gmail Node (Recommended for Google Workspace)
- To:
{{ $json.customer_email }} - Subject:
Your Invoice {{ $json.invoice_number }} — {{ $json.company_name }} - Message: HTML body (see template below)
- Attachments: Binary data from HTTP Request (use the Move Binary Data node if needed)
Email HTML Template:
8. Step 5: Save to Google Drive
Add the Google Drive Node
Add a Google Drive node and configure:
- Operation:
Upload - Credential: Your Google OAuth2 credential (create in n8n Credentials if needed)
- Parent Folder: The ID of your "Invoices" folder in Google Drive
- File Name:
Invoice-{{ $json.invoice_number }}-{{ $json.customer_name }}.pdf - Binary Property:
data(the PDF binary from the HTTP Request node)
To get your Google Drive folder ID:
- Open Google Drive in your browser
- Navigate to your "Invoices" folder (create one if needed)
- Look at the URL:
https://drive.google.com/drive/folders/FOLDER_ID_HERE - Copy the long string after
/folders/
Invoices/2026/05/ and use the Expression {{ new Date().toISOString().slice(0,7) }} to dynamically sort invoices by year and month. This keeps your Drive organized as you scale.
9. Step 6: Slack Team Notification
Add the Slack Node
Add a Slack node and configure:
- Operation:
Post - Credential: Your Slack OAuth2 credential
- Channel:
#salesor#invoices(or a DM to yourself) - Text: Use the message template below
Slack Message Template:
chat:write bot scope, install the app to your workspace, and copy the Bot User OAuth Token into n8n Credentials. Invite the bot to your target channel with /invite @YourBotName.
10. Complete Workflow JSON (Copy-Paste Ready)
If you prefer to import the entire workflow rather than building node by node, copy the JSON below. In n8n, click Workflow → Import from File → Paste JSON.
YOUR_TEMPLATE_ID_HERE and Your Company Name. Never share workflow exports containing real API keys.
Note: The full workflow JSON above is abbreviated for readability. The complete production-ready JSON with all 6 nodes (Trigger, Get Customer, Set Data, HTTP Request PDF, Send Email, Google Drive, Slack) is available in the downloadable template pack below.
11. Testing and Troubleshooting
11.1 Test with Stripe Test Mode
Never test with live payments. In Stripe Dashboard:
- Toggle to Test mode (top right switch)
- Go to Developers → Webhooks
- Find your n8n webhook endpoint
- Click Send test event → Select
charge.succeeded
In n8n, click Execute Workflow and watch each node turn green. If a node turns red, click it to see the error message.
11.2 Common Errors and Fixes
| Error | Cause | Fix |
|---|---|---|
401 Unauthorized (Stripe) |
Wrong API key or test/live mismatch | Verify credential mode matches trigger mode |
404 Not Found (APITemplate) |
Wrong Template ID | Copy Template ID from APITemplate dashboard |
| PDF not attached to email | Binary data not passed correctly | Use "Move Binary Data" node before email |
| Slack message not sent | Bot not invited to channel | Type /invite @YourBot in target channel |
| Google Drive upload fails | OAuth consent not granted | Re-authenticate credential, enable Drive API |
11.3 Enable Error Handling
Add an Error Trigger node to catch workflow failures and notify you:
- Add an Error Trigger node (search "Error" in the node panel)
- Connect it to a Slack or Email node
- Configure the message:
Workflow failed: {{ $json.error.message }}
This ensures you know immediately if an invoice fails to generate, so you can fix it before the customer notices.
12. Advanced Variations
Once you have the basic workflow running, consider these upgrades:
12.1 Multi-Currency Support
Use the HTTP Request node to call the ExchangeRate-API (free tier: 1,500 requests/month) and convert all amounts to your accounting currency before generating the PDF.
12.2 Conditional Logic
Add an IF node to handle different invoice types:
- If amount > $500 → Send via Gmail + CC accounting team
- If amount < $50 → Skip PDF generation, send simple receipt email only
- If customer is in EU → Add VAT number field and reverse charge note
12.3 Scheduled Invoice Generation
Instead of triggering on each payment, use a Cron node to run daily at 9 AM. Fetch all payments from the last 24 hours using the Stripe List Charges operation, then batch-generate all invoices at once. This is useful if you prefer to review invoices before sending.
12.4 Integration with Accounting Software
Add nodes for QuickBooks, Xero, or Wave to automatically create accounting records alongside the invoice. This eliminates double data entry and keeps your books accurate in real-time.
12.5 Customer Portal
Store invoice metadata in an Airtable or Google Sheet database. Build a simple customer portal (using Softr or Bubble) where clients can log in and download all their past invoices. This reduces support emails by 40%.
13. Time Saved and ROI
Let us talk numbers. Here is the ROI of this automation for a typical small business:
| Metric | Before Automation | After Automation | Savings |
|---|---|---|---|
| Time per invoice | 15 minutes | 0 minutes (fully automated) | 15 min/invoice |
| Monthly time (50 invoices) | 12.5 hours | 0 hours | 12.5 hours |
| Annual time | 150 hours | 0 hours | 150 hours |
| Cost at $50/hour owner rate | $7,500/year | $60/year (n8n self-hosted VPS) | $7,440/year |
| Error rate | 5–8% (wrong amounts, missed emails) | <0.1% (automated validation) | 99% reduction |
| Payment speed | 2–3 days (delayed invoicing) | Instant (payment → invoice in 30s) | 2–3 days faster |
Get the Complete Invoice Automation Pack
This tutorial covers the basics. The Complete Invoice Automation Pack includes:
- Full production-ready n8n workflow JSON (all 6 nodes connected)
- 5 professional PDF invoice templates (minimal, modern, corporate, creative, legal)
- Email templates for 3 languages (English, French, Spanish)
- Error handling node configuration
- Google Drive folder structure setup guide
- Slack bot setup walkthrough with screenshots
- Advanced variations: multi-currency, conditional logic, batch processing
- Video walkthrough (15 minutes)
$97 Value FREE
Join 1,800+ business owners who automated their invoicing. No spam, unsubscribe anytime.
Download Free Invoice Pack — No Credit Card14. Final Thoughts: Start Automating Today
You now have a complete, production-ready invoice automation workflow built with n8n. Let us recap what you accomplished:
- Connected Stripe payments to automatic invoice generation
- Created professional PDF invoices with your branding
- Automated email delivery to customers
- Organized invoice archives in Google Drive
- Notified your team in real-time on Slack
- Set up error handling to catch failures
The best part? This is just the beginning. n8n can automate your entire business operations stack: lead capture, CRM updates, social media posting, customer support triage, reporting, and more. Each workflow you build compounds the time savings.
Your next steps:
- Download the Complete Invoice Automation Pack for the full workflow JSON and templates
- Read our guide on n8n vs Zapier vs Make to choose the right platform for your other automations
- Subscribe to the Biomog Weekly newsletter for new workflow tutorials every week
Start n8n Free Get the Free Templates