A chargeback email sits in a shared inbox until the evidence window is almost gone, and whoever picks it up rebuilds the same case from scratch. This workflow catches dispute mail as it arrives, scores the evidence you already hold, writes the case file with a fight or refund call, puts the deadline on the calendar two days early, and keeps a ledger the whole team can read.
Last updated: November 2026.
Quick Overview
A Gmail trigger watches the inbox for unread dispute mail. The workflow pulls the order number and the disputed amount out of the email, sets a seven day evidence deadline, and looks the order up in Google Sheets. It then scores the evidence already on file, from tracking and delivery scans to address and policy checks. A language model writes the case brief, the action to take, the pack to paste into the dispute form, and a reply draft for the customer. The case lands in a dispute ledger, a calendar event lands two days before the deadline, and weak cases get their own alert.
How it works
- The Gmail trigger polls for unread mail whose subject mentions dispute or chargeback.
- The email is normalized: an order reference from an ORD code or an order number phrase, the disputed amount, a reason code, and a seven day evidence deadline.
- An email without a usable order number or amount is emailed to ops and no case file is built.
- The Orders tab is read and the order is matched with punctuation and casing ignored.
- Evidence is scored on six checks: order record, tracking, delivery scan, shipping address, billing match, and policy acknowledgment. The score is the share passed, and every failed check is named.
- The model returns a dispute summary, a recommended action of fight, refund, partial refund, or write off, the reason, a paste-ready evidence pack, the missing items, a win likelihood, and a customer reply.
- When the model returns an action or likelihood outside the allowed list, the workflow falls back to the evidence score, so a case is never left without a recommendation.
- The case is appended to the Dispute Ledger with the reason code, deadline, score, missing evidence, recommendation, and an open status.
- A 30 minute Google Calendar event is created two days before the deadline with the dispute id, the plan, and what is still missing.
- A weak case, or one with three days or less left, sends a decision alert before the full pack goes to ops.
- Every day at 08:00 the ledger is swept for open cases due within three days and one email lists them in deadline order with the plan and the gaps.
- Every Monday at 09:00 a digest covers the cases opened this week, the open value, the win rate on decided cases, and the reason codes that keep repeating.
Setup
- Create a spreadsheet with an Orders tab and a Dispute Ledger tab, using the headers from the read and append nodes.
- Fill the Orders tab with order date, total, payment method, both addresses, carrier, tracking, delivery timestamp, and the refund policy flag.
- Connect the Gmail account used by the trigger and the five sending nodes.
- Connect the Google Sheets account used by the four Sheets nodes and pick the target calendar.
- Add the OpenAI-compatible credential used by the Evidence Pack Agent model node, which is set to a DeepSeek model.
- Replace the ops address placeholder in the five ops emails with the inbox that handles disputes.
- Narrow the trigger subject filter to the wording your processor uses, so unrelated mail is ignored.
Quick Answers
What happens when the dispute email is vague?
If no order number or amount can be read from the email, ops gets one notice with what was found and the case stays out of the ledger until it is opened by hand.
How is the evidence deadline set?
The deadline is seven days after the email arrived, and the calendar event sits two days before it so the pack is filed with margin.
What does the evidence score mean?
It is the share of six checks that passed: order record, tracking, delivery scan, shipping address, billing match, and policy acknowledgment. Anything that failed is named.
Does the workflow file the dispute with the processor?
No. It writes the pack and emails it to ops, who paste it into the processor dispute form. The customer reply is drafted but not sent automatically.
Additional info
Built with n8n. Need an assessment on your business? Feel free to reach out at https://khmuhtadin.com/consultation/