DEV Community

Viet Automation
Viet Automation

Posted on

Email Scanners Are Clicking Your One-Click Approve Links (n8n, 2026)

Why do my one-click approval links break (or approve by themselves)?

Short answer: because something other than the person is opening the link. Many corporate mail filters follow URLs in incoming email to check them before the recipient sees the message. If your "Approve" link does the approval on a plain GET request, the scanner can trigger it, or consume a single-use token so the real click fails. The fix is to never let a GET request change anything: the link opens a confirmation page, and only a button click (a POST) approves or rejects.

This came up in r/n8n on 19 November 2026. The poster built one-click approve/reject links with tokens and listed what caught them out: mail scanners pre-fetching links and burning single-use tokens, approvers double-clicking, and a browser left spinning when the token lookup found nothing. (thread)

The four failure modes

Symptom What is really happening
"This link is no longer valid" on the first real click A scanner (or link preview) already opened the GET link and used the token
Something got approved nobody remembers approving The GET link did the approval, and an automated fetch triggered it
Browser spins until timeout The lookup returned zero items, so the nodes after it never ran and Respond to Webhook was never reached
Batch approval produces three copies of the first item Expressions inside a loop used $('Node').first() instead of $('Node').item

1. Split the link into GET (look) and POST (act)

  • GET /approve?token=... only looks up the request and renders a small page: what is being approved, by whom it was requested, and two buttons.
  • POST /approve (from the button) checks the token again and performs the action.

A scanner that pre-fetches the link just loads a harmless page. Nothing is consumed. Several replies in the thread landed on exactly this split.

2. Give the token a state instead of deleting it

Keep the approval row and move it through pending → approved/rejected → executed (plus expired). Then a second click or a retry can be answered honestly:

  • pending → do the action, record who and when
  • approved / executed → show "Already approved by Dana at 14:02", not a generic error
  • expired → show "This link has expired, ask for a new one"

One commenter added that the job after approval can also retry on timeout, so the decision write needs a unique key (request id + action) and a repeat should update the same row, not create a second job.

3. Make every lookup answer, even when it finds nothing

In n8n, a node that outputs zero items stops that branch. If your Postgres/Sheets lookup finds no row, everything after it, including Respond to Webhook, silently does not run. Options:

  • Turn on Always Output Data on the lookup node, then use a guard step that classifies the result as not_found, already_processed or ok and always responds. (The poster notes n8n documents not to use this setting on IF nodes.)
  • Or respond to the webhook first with a short page ("Got it, processing"), then let the slow work (PDFs, emails) run after the response.

Rule of thumb: every webhook path must end in a response, including the error and empty paths.

4. Inside loops, reference the current item

$('Lookup').first() always returns item zero. Inside a loop or when processing several items, use $('Lookup').item so each iteration uses its own row. Test with at least three items, not one.

5. Log every hit

Store the time, user agent and token state for each request. When someone asks "why did this approve twice?", you can tell a scanner, a double-click and a retry apart. Keep personal data out of logs where you do not need it.

Checklist

  • [ ] GET never changes state; only POST approves/rejects
  • [ ] Token has states (pending, approved, rejected, executed, expired), not delete-on-use
  • [ ] Repeat clicks show who approved and when
  • [ ] Action after approval keyed by request id + action, retries update the same row
  • [ ] Empty lookup still reaches a response (Always Output Data + guard, or respond first)
  • [ ] Loop expressions use .item, tested with 3+ items
  • [ ] Every hit logged with time, user agent and token state

Bottom line

A link in an email is not a click by a human. Treat GET as "show me", POST as "do it", and make every path answer the browser. Your approvers stop seeing spinners and your scanners stop approving invoices.

If you would rather build this kind of approval flow visually without hosting webhooks yourself, Make can do the same GET-confirm / POST-act split with its webhook and webhook-response modules.


Source: r/n8n thread collected 20 November 2026 (Asia/Saigon). Check your own mail provider and n8n version for exact behaviour.


Disclosure: Some links are affiliate links — I may earn a commission at no extra cost to you.

Top comments (1)

Collapse
 
litebyteinsights profile image
LiteByte Insights •

The GET/POST split is the right fix. One thing that can bring the problem back afterwards: some scanners open the page in a sandbox with JavaScript running, so a confirmation page that auto-submits the form on load (or has a "continue if not redirected" script) gets approved by the scanner again. Keep it a plain form button that a person has to press.

Two smaller things worth adding. Log the user agent and IP on the GET as well as the POST, because when someone says "I never clicked that" it is the quickest way to tell a scanner from a person. And show the expiry on the confirmation page itself ("this link works until Friday 17:00"), which saves a lot of "is this still valid?" emails.