{
  "name": "Prevent duplicate webhook executions with AARI idempotency gate",
  "nodes": [
    {
      "id": "sticky-explain",
      "name": "What this does",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        80
      ],
      "parameters": {
        "width": 380,
        "height": 500,
        "content": "## Prevent duplicate webhook executions\n\nMany webhook providers use at-least-once delivery.\nIf a webhook times out or fails, the same event may be sent again.\nFrom n8n's perspective it looks like a ne"
      }
    },
    {
      "id": "sticky-setup",
      "name": "Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        620
      ],
      "parameters": {
        "width": 380,
        "height": 340,
        "content": "## Setup (2 minutes)\n\n**1. Get a free AARI API key:**\nhttps://api.getaari.com/n8n\n\n**2. Create n8n credential:**\nCredentials → New → Header Auth\nHeader name: `X-API-Key`\nValue: your AARI key\n\nSelect i"
      }
    },
    {
      "id": "sticky-test",
      "name": "Test",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        1000
      ],
      "parameters": {
        "width": 380,
        "height": 160,
        "content": "## Test it\n\nSend the same webhook payload twice.\n\nFirst call → `decision: ALLOW`\nSecond call → `decision: BLOCK`\n\nThe duplicate is caught before any action runs."
      }
    },
    {
      "id": "webhook-node",
      "name": "Incoming webhook event",
      "type": "n8n-nodes-base.webhook",
      "position": [
        240,
        300
      ]
    },
    {
      "id": "aari-gate-node",
      "name": "AARI idempotency gate",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        480,
        300
      ]
    },
    {
      "id": "if-block-node",
      "name": "Duplicate detected?",
      "type": "n8n-nodes-base.if",
      "position": [
        720,
        300
      ]
    },
    {
      "id": "blocked-node",
      "name": "⛔ Stop duplicate execution",
      "type": "n8n-nodes-base.set",
      "position": [
        960,
        160
      ]
    },
    {
      "id": "allowed-node",
      "name": "✅ Run your action here",
      "type": "n8n-nodes-base.set",
      "position": [
        960,
        440
      ]
    },
    {
      "id": "complete-node",
      "name": "📋 Report SUCCESS",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1200,
        440
      ]
    }
  ],
  "connections": {
    "Duplicate detected?": {
      "main": [
        [
          {
            "node": "⛔ Stop duplicate execution",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "✅ Run your action here",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AARI idempotency gate": {
      "main": [
        [
          {
            "node": "Duplicate detected?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Incoming webhook event": {
      "main": [
        [
          {
            "node": "AARI idempotency gate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "✅ Run your action here": {
      "main": [
        [
          {
            "node": "📋 Report SUCCESS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}