Auto-send PDF invoices with Stripe payment triggers and Gmail
π° Auto-Send PDF Invoice When Stripe Payment is Received
This workflow automatically generates a PDF invoice every time a successful payment is received in Stripe, then emails the invoice to the customer via Gmail. Perfect for freelancers, SaaS businesses, and service providers who want to automate billing without manual effort.
βοΈ How It Works
-
Stripe Payment Webhook
- Listens for successful payment events (
payment_intent.succeeded). - Triggers the workflow whenever a new payment is made.
- Listens for successful payment events (
-
Normalize Payment Data
- A Code node extracts and formats details like:
- Payment ID
- Amount & currency
- Customer name & email
- Payment date
- Description
- Generates a unique invoice number.
- A Code node extracts and formats details like:
-
Generate Invoice HTML
- A Code node builds a professional invoice template in HTML.
- Data is dynamically inserted (amount, customer info, invoice number).
- Output prepared for PDF generation.
-
Send Invoice Email
- The Gmail node sends an email to the customer.
- Invoice is attached as a PDF file.
- Includes a confirmation message with payment details.
π οΈ Setup Steps
1. Stripe Webhook
- In your Stripe Dashboard:
- Navigate to Developers β Webhooks
- Add a new endpoint with your Webhook URL from the n8n Webhook node.
- Select event:
payment_intent.succeeded
2. Gmail Setup
- In n8n, connect your Gmail OAuth2 credentials.
- Emails will be sent directly from your Gmail account.
3. Customize Invoice
- Open the Generate Invoice HTML node.
- Replace
"Your Company Name"with your actual business name. - Adjust invoice branding, colors, and layout as needed.
π§ Example Email Sent
Subject: Invoice INV-123456789 - Payment Confirmation
Body:
Dear John Doe,
Thank you for your payment! Please find your invoice attached.
Payment Details:
Amount: USD 99.00
Payment ID: pi_3JXXXXXXXX
Date: 2025-08-29
Best regards,
Your Company Name
(Attached: invoice_INV-123456789.pdf)
β‘ With this workflow, every Stripe payment automatically creates and delivers a polished PDF invoice β no manual work required.
n8n Workflow: Basic Webhook Trigger with Code and Gmail Actions
This n8n workflow demonstrates a fundamental automation pattern: triggering an action via a webhook, processing data with custom code, and then sending an email using Gmail. It serves as a starting point for more complex integrations where custom logic and email notifications are required.
What it does
This workflow performs the following steps:
- Listens for a Webhook: The workflow is initiated by an incoming HTTP request to a defined webhook URL.
- Executes Custom Code: After receiving the webhook, a Code node is used to execute custom JavaScript logic. This node is currently empty in the provided JSON, but it's where you would add any data manipulation, validation, or transformation required for your specific use case.
- Sends an Email via Gmail: Finally, the workflow uses the Gmail node to send an email. The specifics of the email (recipient, subject, body, attachments) would be configured within this node.
Prerequisites/Requirements
To use this workflow, you will need:
- n8n Instance: A running instance of n8n (self-hosted or cloud).
- Gmail Account: An active Gmail account configured as a credential in n8n to allow the workflow to send emails.
- Basic JavaScript Knowledge (Optional): If you plan to add custom logic to the "Code" node, familiarity with JavaScript will be beneficial.
Setup/Usage
- Import the Workflow:
- Copy the provided JSON code.
- In your n8n instance, click "New" in the workflows section.
- Click the three dots menu (...) and select "Import from JSON".
- Paste the JSON code and click "Import".
- Configure Credentials:
- Locate the "Gmail" node.
- Click on the "Credential" field and select your existing Gmail credential or create a new one if you haven't already. Follow the n8n documentation for setting up Google OAuth credentials.
- Activate the Webhook:
- Locate the "Webhook" node.
- After saving the workflow, activate it by toggling the "Active" switch in the top right corner of the n8n editor.
- Once active, the webhook node will display a URL. This is the endpoint you will send HTTP requests to trigger the workflow.
- Customize the Code Node (Optional):
- Click on the "Code" node.
- Add your desired JavaScript code to process the data received from the webhook.
- Customize the Gmail Node:
- Click on the "Gmail" node.
- Configure the email details such as "To", "Subject", "Body", and any attachments based on your requirements. You can use expressions to dynamically insert data from previous nodes (e.g., from the webhook or code node).
- Test the Workflow:
- Send an HTTP request (e.g., using Postman, curl, or another application) to the webhook URL obtained in step 3.
- Observe the execution in n8n to ensure it runs as expected and the email is sent.
This workflow provides a flexible foundation for building automations that respond to external events, apply custom logic, and communicate via email.
Related Templates
AI-powered code review with linting, red-marked corrections in Google Sheets & Slack
Advanced Code Review Automation (AI + Lint + Slack) Whoβs it for For software engineers, QA teams, and tech leads who want to automate intelligent code reviews with both AI-driven suggestions and rule-based linting β all managed in Google Sheets with instant Slack summaries. How it works This workflow performs a two-layer review system: Lint Check: Runs a lightweight static analysis to find common issues (e.g., use of var, console.log, unbalanced braces). AI Review: Sends valid code to Gemini AI, which provides human-like review feedback with severity classification (Critical, Major, Minor) and visual highlights (red/orange tags). Formatter: Combines lint and AI results, calculating an overall score (0β10). Aggregator: Summarizes results for quick comparison. Google Sheets Writer: Appends results to your review log. Slack Notification: Posts a concise summary (e.g., number of issues and average score) to your teamβs channel. How to set up Connect Google Sheets and Slack credentials in n8n. Replace placeholders (<YOURSPREADSHEETID>, <YOURSHEETGIDORNAME>, <YOURSLACKCHANNEL_ID>). Adjust the AI review prompt or lint rules as needed. Activate the workflow β reviews will start automatically whenever new code is added to the sheet. Requirements Google Sheets and Slack integrations enabled A configured AI node (Gemini, OpenAI, or compatible) Proper permissions to write to your target Google Sheet How to customize Add more linting rules (naming conventions, spacing, forbidden APIs) Extend the AI prompt for project-specific guidelines Customize the Slack message formatting Export analytics to a dashboard (e.g., Notion or Data Studio) Why itβs valuable This workflow brings realistic, team-oriented AI-assisted code review to n8n β combining the speed of automated linting with the nuance of human-style feedback. It saves time, improves code quality, and keeps your teamβs review history transparent and centralized.
Generate Weather-Based Date Itineraries with Google Places, OpenRouter AI, and Slack
π§© What this template does This workflow builds a 120-minute local date course around your starting point by querying Google Places for nearby spots, selecting the top candidates, fetching real-time weather data, letting an AI generate a matching emoji, and drafting a friendly itinerary summary with an LLM in both English and Japanese. It then posts the full bilingual plan with a walking route link and weather emoji to Slack. π₯ Who itβs for Makers and teams who want a plug-and-play bilingual local itinerary generator with weather awareness β no custom code required. βοΈ How it works Trigger β Manual (or schedule/webhook). Discovery β Google Places nearby search within a configurable radius. Selection β Rank by rating and pick the top 3. Weather β Fetch current weather (via OpenWeatherMap). Emoji β Use an AI model to match the weather with an emoji π€οΈ. Planning β An LLM writes the itinerary in Markdown (JP + EN). Route β Compose a Google Maps walking route URL. Share β Post the bilingual itinerary, route link, and weather emoji to Slack. π§° Requirements n8n (Cloud or self-hosted) Google Maps Platform (Places API) OpenWeatherMap API key Slack Bot (chat:write) LLM provider (e.g., OpenRouter or DeepL for translation) π Setup (quick) Open Set β Fields: Config and fill in coords/radius/time limit. Connect Credentials for Google, OpenWeatherMap, Slack, and your LLM. Test the workflow and confirm the bilingual plan + weather emoji appear in Slack. π Customize Adjust ranking filters (type, min rating). Modify translation settings (target language or tone). Change output layout (side-by-side vs separated). Tune emoji logic or travel mode. Add error handling, retries, or logging for production use.
AI-powered document search with Oracle and ONNX embeddings for recruiting
How it works Create a user for doing Hybrid Search. Clear Existing Data, if present. Add Documents into the table. Create a hybrid index. Run Semantic search on the Documents table for "prioritize teamwork and leadership experience". Run Hybrid search for the text input in the Chat interface on the Documents table. Setup Steps Download the ONNX model allMiniLML12v2augmented.zip Extract the ZIP file on the database server into a directory, for example /opt/oracle/onnx. After extraction, the folder contents should look like: bash bash-4.4$ pwd /opt/oracle/onnx bash-4.4$ ls allMiniLML12_v2.onnx Connect as SYSDBA and create the DBA user sql -- Create DBA user CREATE USER app_admin IDENTIFIED BY "StrongPassword123" DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp QUOTA UNLIMITED ON users; -- Grant privileges GRANT DBA TO app_admin; GRANT CREATE TABLESPACE, ALTER TABLESPACE, DROP TABLESPACE TO app_admin; Create n8n Oracle DB credentials hybridsearchuser β for hybrid search operations dbadocuser β for DBA setup (user and tablespace creation) Run the workflow Click the manual Trigger It displays Pure semantic search results. Enter search text in Chat interface It displays results for vector and keyword search. Note The workflow currently creates the hybrid search user, docuser with the password visible in plain text inside the n8n Execute SQL node. For better security, consider performing the user creation manually outside n8n. Oracle 23ai or 26ai Database has to be used. Reference Hybrid Search End-End Example