Read the full guide et download the JSON here
Handling invoices manually after every successful Stripe payment is a tedious bottleneck. While Stripe handles payment processing and basic receipts, businesses often need standardized, itemized PDF invoices for accounting and client archiving.
If you want to eliminate manual invoice creation entirely, this open-source n8n workflow automates the entire pipeline: from catching successful Stripe payments and formatting zero-decimal currencies to generating PDF invoices, archiving them to Amazon S3, emailing clients via Gmail, and logging transactions into a Google Sheets ledger.
🛠️ The Architecture & Tech Stack
This end-to-end automation orchestrates multiple platforms without relying on expensive, paid SaaS invoicing tools:
- Trigger: Stripe Webhook (payment_intent.succeeded)
- Core Logic & Transformation: n8n Workflow Engine (with custom JavaScript data processing)
- PDF Generation: PDFops Community Node
- File Storage: Amazon S3 Bucket
- Communication & Notification: Gmail (for client delivery) & Slack (for debugging/alerting)
- Accounting Ledger: Google Sheets
⚙️ How the Workflow Operates (Step-by-Step)
- Stripe Event Catching: The workflow listens for successful payment intents, ignoring zero-value or invalid test events.
- Customer Lookup: It queries the Stripe API to fetch clean client details (name and email).
- Currency & Tax Handling: It normalizes monetary amounts—accounting for standard decimal currencies (like USD, where amounts are stored in cents) and zero-decimal currencies (like JPY). If a tax rate is defined, it reverses the math to calculate net, tax, and total breakdown values accurately.
- PDF Rendering: The normalized payload is sent to the PDFops community node to build a clean invoice document.
- Storage & Archiving: The resulting PDF binary is automatically uploaded to an Amazon S3 bucket for long-term secure retention.
- Logging & Notification: A new entry is appended to a Google Sheets transaction tracker, the PDF is emailed directly to the customer via Gmail, and any API or missing-email failures are instantly posted to a dedicated Slack channel.
⚠️ Key Trade-Offs & Production Considerations
Before deploying this to production, keep these operational details in mind:
- Duplicate Protection: The workflow triggers on all incoming successful payments. Ensure your Stripe event filters or accounting logic prevent duplicate runs if you already use Stripe's native invoice system.
- Error Handling: While failures during data shaping or PDF generation post alerts to Slack, ensure your S3 and Gmail nodes include fallback handling to prevent silent pipeline drop-offs.
- Legal Compliance: Simple auto-generated PDFs may require adjustments (such as sequential numbering, tax ID numbers, and physical business addresses) to fully comply with local tax laws.
🚀 Get the Workflow JSON
You can download the full workflow structure and JSON setup guide directly from the original publication:
👉 Read the full guide and get the workflow JSON on LeenLabs
Have you built custom billing pipelines with n8n? Let’s discuss your architecture choices or improvements in the comments below!

Top comments (1)
Nice clean pipeline. One thing worth adding before the PDF step: Stripe can deliver the same payment_intent.succeeded event more than once (retries on slow responses or timeouts), so it helps to check the ledger sheet for the payment_intent ID first and skip if it's already there. Naming the S3 key after the payment_intent ID also means a rerun overwrites the same file instead of creating a second invoice, and the client doesn't get two emails.