The question came from an r/n8n thread: a real estate investment firm wanted deal emails routed from a shared inbox into the right Google Drive folder, with a Notion task opened for the follow-up, and nobody on the team needing automation access to anyone else's personal mailbox. Reasonable setup. The complication showed up immediately — deal mail doesn't arrive once. The same listing update gets forwarded by two or three agents within the hour, and each forward needs to produce zero new tasks, not one each.
The fix proposed in that thread sounds solid: dedupe on the Message-ID header, plus a hash of the attachment for good measure. It's the instinct most people reach for first. It's also wrong more often than it looks.
One shared inbox, several people hitting forward
This pattern shows up anywhere mail needs to land in a shared system no matter who receives it first — deal flow, support tickets, leads from a shared form. The standard move is to have everyone forward the original to one dedicated address an automation watches. That part is genuinely good advice on its own: one forwarding address means the workflow needs OAuth access to a single inbox, not five people's personal Gmail accounts.
The trouble starts once more than one person forwards the same original. Three agents notice the same update and three of them hit forward, because nobody's sure if someone beat them to it. The automation now has three emails to process, and it has to recognize two as copies before it creates three folders and three tasks for what is, to the business, one deal.
Why Message-ID looks like the obvious key, and where it breaks
Every email carries a Message-ID header, and the email standard treats it as permanent. RFC 5322 defines it as a globally unique fingerprint, and RFC 7352 — the IETF spec for detecting duplicate mail deliveries — restates that assumption when it defines its own duplicate-detection test. Look up whether a given Message-ID has shown up before; if it has, you've seen this exact message before. For a single message delivered once, maybe retried by a flaky server, that holds up fine.
Message-ID is built to never repeat for the same message. Forwarding doesn't break that rule. It just means you're no longer looking at the same message.
When someone hits forward, most mail clients build a brand-new outbound message: fresh headers, a fresh Message-ID, the original quoted underneath in the body. Nylas's developer docs describe a forward in exactly those terms — a new message to new recipients, starting fresh rather than reusing the thread's identity. Some clients tuck the original ID into a References or In-Reply-To header on the way out. Plenty don't — there's an open feature request against at least one major desktop client asking for that exact behavior, because today it's missing.
So three agents forward the same listing, and the shared inbox receives three messages with three different Message-IDs. A dedup check keyed on that header finds no match, three times in a row, and by the letter of the spec it's technically correct. These are three different messages. They just happen to be about the same deal.
A key that survives the forward
The fix isn't a different header to trust blindly. It's checking two places in order before giving up.
Look at References and In-Reply-To on the incoming message first. When a client preserves the original ID there, dedupe against that instead of the forward's own Message-ID. When that chain is missing or truncated, fall back to a fingerprint built from what survives a forward unchanged: the subject with "Fwd:," "Re:," and stacked-up whitespace stripped out, the original sender's address pulled from the quoted body, and a hash of the first attachment if one came through. Attachments ride along byte-for-byte even when every header around them gets rewritten, which makes that hash the most reliable piece of the fallback.
Scope the lookup to a rolling window — a week covers deal flow with room to spare — so you're not comparing against a growing pile of old mail forever. And check References first. Reaching for the harder fallback before checking what the email already gave you throws that information away.
The second duplicate problem, and it has nothing to do with forwarding
There's a separate way to get the identical symptom — a second task, a second filed document — that has nothing to do with how many people forwarded anything. n8n's own Gmail Trigger node can re-fetch and reprocess a single message across overlapping polling windows, especially when a burst of mail lands close together. It's a recurring complaint on the n8n community forum, and the usual advice is a Remove Duplicates node right after the trigger, keyed on message ID, to drop anything the workflow has already handled.
That helps, but it doesn't fully close the gap — polling triggers are at-least-once by design, so a repeat can slip through between one execution and the next. The front-door fix (dedup on the way in) and a back-door fix (make the write itself safe to run twice) solve two different problems, and you need both. We covered the second one — the check-mark-act pattern that keeps a write safe even when the front-door dedup misses — in this post on webhook idempotency.
What to actually build
Four pieces, roughly in order of how expensive they are to skip: one shared forwarding address so nobody's personal inbox needs automation access; a dedup check that reads References and In-Reply-To first, with the subject-plus-sender-plus-attachment fingerprint as the fallback, scoped to days rather than forever; a Remove Duplicates step right after the trigger node, since the trigger itself can double-fire independent of anything a person does; and an idempotent write on the Drive and Notion side, so a duplicate that slips past the first three still can't create a second task.
None of this is hard to build on its own. The mistake is building the first piece, confirming it works against a test email sent to yourself, and shipping it. A single test message never forwards itself three times from three different people.
If you're routing shared mail into Drive, Notion, a CRM, or anywhere else and want someone to check the dedup logic before it ships, our automation work covers exactly this kind of build. Or just ask us the dumb version of the question first — better to answer it now than after the fifth duplicate task.
— Cole
Sources
- r/n8n — "How would you build a Gmail → Google Drive → Notion workflow" (the thread this post answers): reddit.com/r/n8n
- RFC 7352 — Sieve Email Filtering: Detecting Duplicate Deliveries, restating the Message-ID uniqueness assumption from RFC 5322: rfc-editor.org
- Nylas developer docs — Forward an email: developer.nylas.com
- n8n Community — "Gmail node getting triggered multiple times for same email": community.n8n.io