{"product_id":"n8n-webhook-idempotency-guard-with-data-table-ledger","title":"n8n Webhook Idempotency Guard with Data Table Ledger","description":"\u003ch3\u003eStop duplicate webhook side effects with an n8n idempotency guard backed by a Data Table ledger\u003c\/h3\u003e\n\u003cp\u003eThis n8n automation prevents repeated webhook deliveries from triggering payments, notifications, database writes, or other one-time actions more than once—by storing scoped idempotency keys in an n8n Data Table.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReceives requests via a Webhook node\u003c\/strong\u003e that include an \u003ccode\u003eidempotency_key\u003c\/code\u003e, optional \u003ccode\u003escope\u003c\/code\u003e, and a payload.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eBuilds a collision-resistant ledger key\u003c\/strong\u003e by combining \u003ccode\u003escope\u003c\/code\u003e and \u003ccode\u003eidempotency_key\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eChecks the ledger in an n8n Data Table\u003c\/strong\u003e for an existing unexpired record to decide whether this delivery is a duplicate.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRecords the decision\u003c\/strong\u003e: creates a new ledger entry, refreshes an expired record, or increments counters for duplicates.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAudits duplicates\u003c\/strong\u003e by increasing \u003ccode\u003eduplicate_count\u003c\/code\u003e and updating \u003ccode\u003elast_seen_at\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReturns a JSON response\u003c\/strong\u003e containing \u003ccode\u003eallow_processing\u003c\/code\u003e, the decision\/action, and ledger metadata so downstream steps continue \u003cem\u003eonly when\u003c\/em\u003e \u003ccode\u003eallow_processing\u003c\/code\u003e is \u003ccode\u003etrue\u003c\/code\u003e.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eProtect a payment-triggering flow from repeated webhook retries by only allowing the first delivery per \u003ccode\u003eidempotency_key\u003c\/code\u003e (and optional \u003ccode\u003escope\u003c\/code\u003e).\u003c\/li\u003e\n  \u003cli\u003eEnsure notification workflows don’t spam users when upstream systems resend the same event.\u003c\/li\u003e\n  \u003cli\u003eAvoid duplicate database writes by gating side effects behind \u003ccode\u003eallow_processing\u003c\/code\u003e.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eData Table ledger\u003c\/strong\u003e named \u003ccode\u003ewebhook_idempotency\u003c\/code\u003e with columns: \u003ccode\u003eledger_key\u003c\/code\u003e, \u003ccode\u003escope\u003c\/code\u003e, \u003ccode\u003eidempotency_key\u003c\/code\u003e, \u003ccode\u003estatus\u003c\/code\u003e, \u003ccode\u003efirst_seen_at\u003c\/code\u003e, \u003ccode\u003elast_seen_at\u003c\/code\u003e, \u003ccode\u003eexpires_at\u003c\/code\u003e, \u003ccode\u003eduplicate_count\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003eConfigured TTL hours, default scope, and maximum key length in the guard configuration step.\u003c\/li\u003e\n  \u003cli\u003eNodes used: \u003cstrong\u003eWebhook\u003c\/strong\u003e, \u003cstrong\u003eData Table\u003c\/strong\u003e, \u003cstrong\u003eCode\u003c\/strong\u003e, \u003cstrong\u003eSwitch\u003c\/strong\u003e, and a \u003cstrong\u003eSticky Note\u003c\/strong\u003e for guidance.\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003e\u003cstrong\u003eSetup tip:\u003c\/strong\u003e copy the production webhook URL for \u003ccode\u003e\/webhook\/idempotency-guard\u003c\/code\u003e and send POST requests with \u003ccode\u003eidempotency_key\u003c\/code\u003e (optionally \u003ccode\u003escope\u003c\/code\u003e and \u003ccode\u003epayload\u003c\/code\u003e).\u003c\/p\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45931083432115,"sku":"N8N-18958","price":9.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/BmR1xGeFwcxsUMsR9pR3q_UfvdRWJc.png?v=1788254177","url":"https:\/\/buyflowscripts.com\/products\/n8n-webhook-idempotency-guard-with-data-table-ledger","provider":"N8N Commerce","version":"1.0","type":"link"}