Learn › n8n Business Automations: Real Workflows That Scale › Payment and Invoice Notifications

Payment and Invoice Notifications

Intermediate 🕐 12 min Lesson 6 of 12
What you'll learn
  • Configure a Stripe webhook endpoint to send events to an n8n Webhook Trigger
  • Route different payment event types to separate handling branches using a Switch node
  • Append successful payment data to Google Sheets to build an automated revenue log
  • Build a failed payment recovery email using a Basic LLM Chain for personalisation

Why Payment Events Need Automation

Every payment platform — Stripe, Paddle, LemonSqueezy — fires webhook events for every payment lifecycle moment: successful charge, failed payment, subscription renewal, cancellation, dispute. Manually monitoring these is error-prone. Automation handles notifications, record updates, and follow-up actions the moment each event fires — without anyone checking a dashboard.

Setting Up the Stripe Webhook

In your Stripe Dashboard, go to Developers → Webhooks → Add Endpoint. Paste your n8n Webhook Trigger URL and select the events to listen for:

  • payment_intent.succeeded — a one-time payment completed successfully.
  • invoice.paid — a subscription renewal or invoice paid.
  • invoice.payment_failed — a charge attempt failed.
  • customer.subscription.deleted — a subscription was cancelled.
  • charge.dispute.created — a chargeback was filed.

Stripe signs webhook payloads with a secret — verify this signature in n8n (the Stripe Trigger node handles this automatically if you use it instead of a raw Webhook node).

The Workflow Architecture

  1. Webhook Trigger (or Stripe Trigger node) — receives the event payload.
  2. Switch node — routes on $json.type to handle each event type differently.
  3. Payment succeeded branch: Slack node (post to #payments with amount, customer, plan) + Google Sheets node (append a revenue row with date, amount, customer email, product).
  4. Payment failed branch: Gmail node (send a failed payment email to the customer with a link to update their card) + Slack node (alert #ops).
  5. Subscription cancelled branch: HubSpot or Airtable node (update contact status to churned) + Slack node (alert #retention).
  6. Dispute created branch: Slack node (urgent alert to #finance with dispute details and deadline).

Revenue Tracking in Google Sheets

The Google Sheets append step builds a running revenue log automatically. Each successful payment event adds a row with timestamp, amount, currency, customer email, product name, and Stripe payment ID. This sheet becomes the source of truth for weekly revenue reports — pipe it into the Slack report command from lesson 5 for an instant revenue dashboard.

Failed Payment Recovery Sequence

When a payment fails, the customer needs a prompt, helpful email — not a generic "your payment failed" message. Use a Basic LLM Chain to personalise the email: include the customer's name, the amount that failed, and specific instructions for updating their card. A personalised recovery email typically has a higher success rate than a generic template. Set up a second attempt notification 3 days later using a Wait node if no successful payment has been recorded.

Key takeaways
  • Use the Stripe Trigger node rather than raw Webhook to get automatic signature verification
  • A Switch node on the event type field routes each payment event to the correct handling logic
  • Every successful payment appended to Google Sheets becomes an automated revenue log with no manual work
  • Personalised failed payment recovery emails outperform generic templates — use LLM Chain for the copy