Skip to content

Dedupe Webhook Retries in n8n: update_id, Remove Duplicates

How to dedupe webhook retries in n8n: why the same alert can arrive twice, and three ways to drop repeats on update_id with Remove Duplicates, a data table check or workflow static data.

By AyeWatch Team4 min read

Short answer: To dedupe webhook retries in n8n, pick a field that stays the same on every retry and drop items you have already seen. AyeWatch sends the same update_id on each retry, so a Remove Duplicates node set to Remove Items Processed in Previous Executions, deduping on update_id, stops most repeats.

Where the duplicates come from

AyeWatch retries a delivery that times out or gets a non-2xx answer, with exponential backoff, up to 10 attempts, and sends the same update_id every time. The common way to get a duplicate in n8n is a slow reply: the Webhook node is set to respond When Last Node Finishes, a Google Sheets call takes more than 10 seconds, AyeWatch counts the delivery as failed and sends it again, and the first run still finishes. Now there are two rows.

Two more sources: re-running a failed execution by hand, and replays of a captured request. Delivery order is not guaranteed either, so a retry can arrive after newer alerts. The fix for all of them is the same: remember which update_id values you have handled. Webhook idempotency covers the idea outside n8n; this post is the n8n version, and it assumes the Webhook node from the n8n webhook setup guide.

Option 1: the Remove Duplicates node

Put it right after the signature check (see the HMAC recipe):

  • Operation: Remove Items Processed in Previous Executions
  • Keep Items Where: Value Is New
  • Value to Dedupe On: {{ $json.update_id }}
  • Options: Scope Node (the default), History Size 10,000 (the default)

Three things to know. It records a value as soon as the item passes through, before later nodes run, so if a later node fails, the retry of that alert is dropped as a duplicate and the alert is lost. It records test runs too, so an alert you replayed while building the workflow will be dropped when it arrives for real; the Clear Deduplication History operation empties the history. And do not use Value Is Higher than Any Previous Value: update_id values can arrive out of order, and an older alert would be dropped.

Option 2: check first, record last, with a data table

This version only remembers an update_id after the work succeeded.

  1. Create an n8n data table seen_updates with one number column, update_id.
  2. After the signature check, add a Data Table node: Resource Row, Operation If Row Does Not Exist, table seen_updates, condition update_id Equals {{ $json.update_id }}. Items that match a stored row stop here.
  3. Add your real steps: Sheets, Slack, whatever the workflow does.
  4. End with a Data Table node: Row, Insert, update_id {{ $('Check signature').item.json.update_id }}. The reference reaches back to the Check signature node because the Slack or Sheets output no longer carries update_id.

If Sheets fails, nothing is inserted and the next retry goes through. Data tables also work in test runs, so delete the rows your tests created. The gap: two deliveries of the same alert arriving at the same moment can both pass the check. With backoff between retries that is rare, and the worst case is one duplicate row.

Option 3: workflow static data in a Code node

// Code node "Seen before?". Mode: Run Once for All Items.
// Static data is saved only for a published workflow started by its trigger,
// and only when the whole execution succeeds. Test runs do not save it.
const data = $getWorkflowStaticData('global');
const seen = data.seenUpdateIds || [];
const out = [];
for (const item of $input.all()) {
  const id = item.json.update_id;
  if (seen.includes(id)) continue;
  seen.push(id);
  out.push(item);
}
data.seenUpdateIds = seen.slice(-500);
return out;

n8n saves static data only when the execution succeeds, which gives you the record-after-success behaviour of option 2 in one node. The catches come from n8n's own docs: the feature is marked experimental, nothing is saved during test runs, it may be unreliable when executions run very often, and the data should stay small, hence the last-500 trim.

Make retries rarer in the first place

Reply fast. With the Webhook node's Respond set to Immediately, n8n answers before any other node runs, so slow Sheets calls cannot cause a timeout. If you need to answer only after a check, use a Respond to Webhook node early in the workflow and keep the slow work after it. The delivery rules are in the webhook docs.

Replying immediately has a cost: a node that fails later will not trigger a retry, because AyeWatch already got its 2xx. Set an error workflow in the workflow settings so a failed run reaches you.

What dedupe on update_id won't catch. Two monitors can each alert on the same post, with two different update_id values. If that matters, add a second dedupe on the source link, as the YouTube recipe in this series does with video IDs.

Remove DuplicatesData table checkStatic data Code node
Records the update_idWhen the item passes the nodeIn the last node, after the workWhen the execution succeeds
Alert survives a failed later stepNoYesYes
Test runsRecordedRecorded in the tableNot saved
Two simultaneous deliveriesHandled by the nodeBoth can passBoth can pass
SetupOne nodeTwo nodes and a tableOne Code node

Start a monitor in under a minute

Describe a topic or paste a URL. Cancel before the trial ends and you pay nothing.

Try it free for 7 days

The bottom line

Use Remove Duplicates if losing the odd alert to a failed step is acceptable, and the data table pattern if it is not. Whichever you pick, reply to the webhook quickly so most retries never happen.

FAQ

How do I stop duplicate webhook runs in n8n?

Dedupe on a field that stays the same across retries. For AyeWatch that is update_id. The Remove Duplicates node with Remove Items Processed in Previous Executions handles it in one node.

Why does my n8n webhook receive the same event twice?

Usually because the sender retried after a timeout or error. AyeWatch waits 10 seconds for a 2xx; a slower reply counts as failed and is sent again while your first run continues.

Does the Remove Duplicates node remember test runs?

Yes. It records values as items pass through it, test executions included. Use the Clear Deduplication History operation to reset it.

Should I dedupe with Value Is Higher than Any Previous Value?

Not for AyeWatch. Deliveries are not guaranteed to arrive in order, so an older update_id could be dropped by mistake. Use Value Is New.

How do I dedupe only after the workflow succeeds?

Check an n8n data table for the update_id at the start with If Row Does Not Exist, and insert the update_id in the last node. A failed run inserts nothing, so the retry passes.

dedupe webhook retries in n8nn8n remove duplicatesn8n webhook idempotencyn8n data table dedupewebhook retries update_id

Related articles