Skip to main content

Prevent duplicate webhook executions with AARI idempotency gate

Workflow preview

Workflow preview
100%
Prevent duplicate webhook executions with AARI idempotency gate preview
Open on n8n.io

1. Workflow Overview

Who this template is for This template is for anyone running n8n workflows that receive webhooks and perform side effects such as payments, emails, database inserts, or API calls. Webhook providers...

Best for

  • Engineering automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.webhook, n8n-nodes-base.httprequest, n8n-nodes-base.if, n8n-nodes-base.set

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Nesho Neshev.

Original n8n.io source

1.1 Workflow description

Title
Prevent duplicate webhook executions with AARI idempotency gate
Workflow name
Prevent duplicate webhook executions with AARI idempotency gate

Who this template is for

This template is for anyone running n8n workflows that receive webhooks and perform side effects such as payments, emails, database inserts, or API calls.

Webhook providers commonly use at-least-once delivery. If a webhook request times out or fails, the provider retries the same event. From n8n’s perspective this appears as a new trigger, which can cause the workflow to execute twice.

How it works

This workflow adds an idempotency check before any side effect runs.

When the first event arrives, the workflow records its idempotency key and proceeds normally. If the same event arrives again within 24 hours, the gate returns a BLOCK decision and the workflow stops before any side effects execute.

The webhook responds immediately with a 200 OK response., so providers do not retry due to workflow execution time. The idempotency gate then decides whether the workflow should proceed or stop.

This prevents duplicate executions such as:

  • duplicate payments
  • duplicate confirmation emails
  • duplicate database rows
  • duplicate external API calls

How to set it up

Setup usually takes about 2 minutes.

  1. Create a free AARI API key at api.getaari.com/n8n
  2. In n8n go to Credentials → New → Header Auth
  3. Set the header name to X-API-Key
  4. Paste your API key as the value
  5. Select this credential in the AARI idempotency gate node
  6. Replace the placeholder action node with your real workflow action (Stripe, Gmail, Postgres, etc.)

Detailed instructions are included in the sticky notes inside the workflow.

Requirements

  • n8n version 1.0 or later
  • AARI API key (free tier available)

Customization

You may need to adjust the idempotency_key depending on your webhook payload.

Examples:

  • Stripe webhook events: {{ $json.id }}
  • Shopify order events: {{ $json.order_id }}
  • Generic events: combine stable fields such as {{ $json.type }}:{{ $json.created }} (for example event type + creation time)

The key should uniquely identify the event so duplicates can be detected reliably.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - What this does

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Setup

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Test

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Incoming webhook event

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 5 - AARI idempotency gate

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.1

Block 6 - Duplicate detected?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 7 - ⛔ Stop duplicate execution

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.3

Block 8 - ✅ Run your action here

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.3

Block 9 - 📋 Report SUCCESS

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.1

3. Summary Table

Workflow Prevent duplicate webhook executions with AARI idempotency gate
Complexity intermediate
Nodes 9
Categories Engineering
Author Nesho Neshev
Published 04 Mar 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/13863/13863.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Prevent duplicate webhook executions with AARI idempotency gate do?

Who this template is for This template is for anyone running n8n workflows that receive webhooks and perform side effects such as payments, emails, database inserts, or API calls. Webhook providers...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering use case.