Description
This workflow automates the process of retrieving Stripe invoices, validating API responses, generating payment receipts, sending them via email, storing PDFs in Google Drive, and appending details to a Google Sheet ledger. It also includes an error logging system to capture and record workflow issues, ensuring financial operations are both automated and reliable.
What This Template Does (Step-by-Step)
- ๐ Manual Trigger โ Start the workflow manually by clicking Execute workflow.
- ๐ Fetch Invoices โ Authenticates with Stripe and retrieves the 5 most recent invoices (includes customer info, amounts, statuses, and invoice URLs).
- โ
Check API Response โ Ensures the Stripe API response contains a valid data[] array. If not, errors are logged.
- ๐ Expand List โ Splits Stripeโs bundled invoice list into individual invoice records for independent processing.
- ๐ณ IF (Paid?) โ Routes invoices based on payment status; only paid invoices move forward.
- ๐ง IF (Already Receipted?) โ Skips invoices where a receipt has already been generated (receipt_sent = true).
- ๐ Download File โ Downloads the hosted invoice PDF from Stripe for use in emails and archiving.
- โ๏ธ Send Receipt Email โ Emails the customer a payment receipt with the PDF attached, using invoice details (number, amount, customer name).
- โ๏ธ Upload Invoice PDF โ Uploads the invoice PDF to a specific Google Drive folder, named by invoice number.
- ๐ Append to Ledger โ Updates a Google Sheet with invoice metadata (date, invoice number, Drive file ID, link, size).
- โ ๏ธ Error Logging โ Logs workflow issues (failed API calls, missing data, etc.) into a dedicated error tracking sheet.
Prerequisites
- Stripe API key (with invoice read permissions)
- Google Drive (destination folder for invoices)
- Google Sheets with:
- Receipts Ledger Sheet
- Error Logging Sheet
- Gmail OAuth2 account for sending receipts
Key Benefits
โ
Automates customer receipt delivery with attached PDFs
โ
Builds a permanent ledger in Google Sheets for finance
โ
Archives invoices in Google Drive for easy retrieval
โ
Prevents duplicates by checking receipt_sent metadata
โ
Includes error logging for smooth monitoring and debugging
Perfect For
- Finance/accounting teams needing automated receipt handling
- SaaS businesses managing recurring Stripe invoices
- Operations teams requiring error-proof automation
- Any business needing audit-ready receipts + logs