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