Skip to product information

Detect Duplicate Payment Charges: Gmail + Gemini + n8n

Detect Duplicate Payment Charges: Gmail + Gemini + n8n

 (200+Reviews)
Regular price £4.99
Regular price £4.99 Sale price
SAVE Sold out
⬇
Instant Digital Download
∞
Unlimited Downloads
★
Lifetime Access in Your Account
🔥
128+ Sold
Popular with n8n builders
⚡
23 people viewing
High interest right now
✅
9 added today
Fast-moving digital product
Detect Duplicate Payment Charges: Gmail + Gemini + n8n

Detect Duplicate Payment Charges: Gmail + Gemini + n8n

Regular price £4.99
Regular price £4.99 Sale price
SAVE Sold out

Catch duplicate payment charges automatically—using Gmail, Google Gemini, n8n, Google Sheets, and Slack

This n8n workflow monitors your Gmail for receipt emails, extracts transaction details with Google Gemini, checks Google Sheets for potential double charges within a 48-hour window, and sends a Slack alert when something looks like a duplicate.

What this workflow does

  • Monitors Gmail every minute for new messages matching your search query (e.g., “receipt”).
  • Fetches and cleans the email by pulling the full Gmail message, extracting a clean body from MIME parts, and capturing metadata such as sender, subject, thread ID, and received timestamp.
  • Uses Google Gemini to extract structured fields (merchant, amount, currency, transaction date/time, reference, and type) by sending the email content to Gemini and parsing the JSON response.
  • Validates and normalizes that the email represents a successful charge with the required fields, then standardizes merchant, amount, currency, and timestamps into consistent formats.
  • Detects possible duplicates by generating a deterministic transaction ID, pulling recent transactions from Google Sheets, and flagging a duplicate when merchant, amount, and currency match within 48 hours.
  • Logs results and notifies you by appending the transaction to Google Sheets and posting a Slack alert when a potential double charge is detected.
  • Marks the Gmail message as processed by labeling it after completion.

Use cases

  • Detecting card/billing issues when the same merchant charges multiple times for the same amount.
  • Keeping SaaS finance operations clean by automatically tracking receipt-based transactions.
  • Reducing manual review time when reconciling payment receipts across multiple email senders.

Technical details

  • Gmail trigger (polls every minute; uses an email search query and a “processed” label ID).
  • Google Gemini (PaLM) API for transaction extraction and JSON parsing.
  • Google Sheets for storing recent transactions and recording duplicate checks.
  • Slack for alerts on potential duplicate charges.
  • Logic implemented with n8n nodes such as if, set, and code (plus sticky note for workflow clarity).
View full details