Quick overview
This workflow listens for successful Stripe payments, fetches the associated Stripe customer, generates a branded VAT-inclusive receipt PDF with PDFMint, emails it via Gmail, and archives the PDF in Google Drive, while routing missing customer data, missing email, or delivery/rendering failures to an actionable error output.
How it works
- Triggers when a Stripe
payment_intent.succeeded event is received.
- Retrieves the Stripe Customer linked to the Payment Intent and stops for review if no customer is attached.
- Applies receipt branding details (seller name, address, VAT rate, locale, and footer note) and builds a receipt data model and HTML using the Stripe payment amount and description.
- Checks whether the customer record contains an email address and routes missing-email cases to an error path.
- Sends the receipt HTML to PDFMint to render an A4 PDF and validates that a PDF binary is returned.
- Emails the PDF receipt to the customer using Gmail and uploads the same PDF to Google Drive for archiving, routing any delivery or upload errors to the error path.
Setup
- Connect Stripe credentials for both the Stripe trigger and the Stripe customer lookup.
- Add PDFMint API credentials and ensure the PDFMint community node is available in your n8n instance.
- Add Gmail OAuth2 credentials for sending email and Google Drive OAuth2 credentials for uploading files.
- Update the seller identity, VAT percentage, locale, and footer text in the branding step to match your business.
- Choose the target Google Drive folder (or keep the root of “My Drive”) where receipts should be archived.