{
  "name": "Protect public webhooks with Ainoflow Guard rate limiting",
  "nodes": [
    {
      "id": "a66a93f6-eed6-4565-815a-cf61df76f168",
      "name": "README",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3760,
        5632
      ],
      "parameters": {
        "width": 800,
        "height": 2256,
        "content": "# Webhook Rate Limiter (Guard)\n\nProtect public webhooks from burst traffic, abuse, and overload.\nUses **Ainoflow Guard** for edge-style rate decisions BEFORE expensive workflow logic executes.\n\n## Qui"
      }
    },
    {
      "id": "4ca89072-57e6-493d-850e-726755c271d2",
      "name": "SectionRateLimitCheck",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4608,
        5632
      ],
      "parameters": {
        "width": 1360,
        "height": 652,
        "content": "## 1. Rate Limit Decision\nWebhook → Config → Build Identity → Guard Check → Allow or Deny"
      }
    },
    {
      "id": "f238178d-2eed-4bfe-8650-6b39d0d23389",
      "name": "SectionAllowed",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6000,
        5632
      ],
      "parameters": {
        "width": 640,
        "height": 320,
        "content": "## 2. Allowed → Business Logic\nReplace **BusinessLogic** node with your workflow"
      }
    },
    {
      "id": "ca85a539-3419-4dc7-9f8c-5da7f6003579",
      "name": "SectionDenied",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6000,
        5968
      ],
      "parameters": {
        "width": 640,
        "height": 320,
        "content": "## 3. Denied → 429 Rate Limited\nImmediate rejection with Retry-After header"
      }
    },
    {
      "id": "88e3710e-2bb8-4d9d-9fc9-1a269f4ba01e",
      "name": "StickyWebhook",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4640,
        5760
      ],
      "parameters": {
        "width": 224,
        "height": 416,
        "content": "## Webhook Entry\nPOST requests only.\nUses \"Respond to Webhook\" mode\nso workflow controls response timing."
      }
    },
    {
      "id": "06c7ebe5-6636-4a36-ae7c-287e2d05239e",
      "name": "StickyConfig",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4896,
        5760
      ],
      "parameters": {
        "width": null,
        "height": 416,
        "content": "## Configuration\nEdit values here to change\nrate limits and identity mode.\nNo code changes needed."
      }
    },
    {
      "id": "66f62add-06b6-450e-a690-a40ca09789b8",
      "name": "StickyIdentity",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5168,
        5760
      ],
      "parameters": {
        "width": null,
        "height": 416,
        "content": "## Identity Builder\nExtracts client identity from\nrequest headers.\nFormat: route:identity"
      }
    },
    {
      "id": "63b60baa-6ef5-487c-b575-5d68daa91bb3",
      "name": "StickyGuard",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5440,
        5760
      ],
      "parameters": {
        "width": null,
        "height": 416,
        "content": "## Guard Decision\nPOST to Guard API.\nPolicy auto-creates on first call.\nreturnSuccess=true → always 200.\n\n⚠️ allowPolicyOverwrite=true\nis set for easy testing.\nFor production: set to false\nto avoid hi"
      }
    },
    {
      "id": "cd78a863-63ae-41ee-98b1-c3122dfa62bc",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        4704,
        6016
      ]
    },
    {
      "id": "98d24922-4c1b-4b0d-9203-25cdde4a2edb",
      "name": "Config",
      "type": "n8n-nodes-base.set",
      "position": [
        4960,
        6016
      ]
    },
    {
      "id": "9ff885dd-a783-4813-894b-22a90aa2cf65",
      "name": "BuildIdentity",
      "type": "n8n-nodes-base.code",
      "position": [
        5232,
        6016
      ]
    },
    {
      "id": "c3bc52e5-b7b0-48f5-b353-6952c878cf64",
      "name": "GuardCheck",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        5504,
        6016
      ]
    },
    {
      "id": "b0f570b9-074b-4f6c-a13b-ec22b97349d6",
      "name": "IfAllowed",
      "type": "n8n-nodes-base.if",
      "position": [
        5776,
        6016
      ]
    },
    {
      "id": "b0fbb34c-5329-4d36-b1a8-2c6291989bd1",
      "name": "BusinessLogic",
      "type": "n8n-nodes-base.code",
      "position": [
        6080,
        5760
      ]
    },
    {
      "id": "09b05b88-3695-499d-8401-432390111f48",
      "name": "RespondOk",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        6288,
        5760
      ]
    },
    {
      "id": "abbf7d98-4ba5-436d-9ffc-d27f26a7bc38",
      "name": "BuildDeniedResponse",
      "type": "n8n-nodes-base.set",
      "position": [
        6096,
        6096
      ]
    },
    {
      "id": "40764d73-42fd-4730-ad69-a83a2bc7f65b",
      "name": "RespondRateLimited",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        6288,
        6096
      ]
    }
  ],
  "connections": {
    "Config": {
      "main": [
        [
          {
            "node": "BuildIdentity",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IfAllowed": {
      "main": [
        [
          {
            "node": "BusinessLogic",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "BuildDeniedResponse",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GuardCheck": {
      "main": [
        [
          {
            "node": "IfAllowed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "BuildIdentity": {
      "main": [
        [
          {
            "node": "GuardCheck",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "BusinessLogic": {
      "main": [
        [
          {
            "node": "RespondOk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "BuildDeniedResponse": {
      "main": [
        [
          {
            "node": "RespondRateLimited",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}