n8nflow.net logo

Automate Payment Receipts: Email, Archive, and Track with Stripe and Google Workspace

by Rahul Joshiโ€ขUpdated: Last update 4 days agoโ€ขSource: n8n.io
Loading workflow viewer...

Getting Started

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