{
  "name": "Secure API endpoint with bearer token authentication and field validation",
  "nodes": [
    {
      "id": "4f42007b-3813-410f-a608-5af89459b14f",
      "name": "Check Authorization Header",
      "type": "n8n-nodes-base.if",
      "position": [
        -20,
        20
      ]
    },
    {
      "id": "86d6157e-593d-4370-a480-1a9417300555",
      "name": "401 Unauthorized",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        340,
        280
      ]
    },
    {
      "id": "0831093a-adef-41dc-8ac0-2e1998fc22ad",
      "name": "200 OK",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1140,
        20
      ]
    },
    {
      "id": "b4f42651-c7f6-43a3-a695-7d5197b45642",
      "name": "Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -300,
        20
      ]
    },
    {
      "id": "f1539109-8585-4cf2-9b9b-f3012544ac6c",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -580,
        20
      ]
    },
    {
      "id": "bcf1183c-9a3d-41eb-89f7-1666d3a6c5fc",
      "name": "Has required fields?",
      "type": "n8n-nodes-base.code",
      "position": [
        220,
        20
      ]
    },
    {
      "id": "81b125f1-faa0-4998-8624-431746052a84",
      "name": "Check Valid Request",
      "type": "n8n-nodes-base.if",
      "position": [
        440,
        20
      ]
    },
    {
      "id": "906c671d-e2a6-4a9e-b7df-d7b9142ffeb4",
      "name": "400 Bad Request",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        780,
        280
      ]
    },
    {
      "id": "ce657170-34e4-4b40-ba22-bb4638fa98c6",
      "name": "Create Response",
      "type": "n8n-nodes-base.set",
      "position": [
        920,
        20
      ]
    },
    {
      "id": "0a6b9f12-9b60-458e-85de-014a66063e50",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -440,
        -280
      ],
      "parameters": {
        "width": 360,
        "height": 460,
        "content": "### 🛠️ Config Node Setup\n\n*This node defines the configuration for the secure webhook.*\n\n- `config.bearerToken`: The expected Bearer YOUR_TOKEN_HERE for authentication.\n\n- `config.requiredFields`: Set"
      }
    },
    {
      "id": "bba24ba5-3c8d-40f7-99e0-44115b1025e0",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -440,
        200
      ],
      "parameters": {
        "width": 1740,
        "height": 240,
        "content": "### 🚫 Error Handling Nodes\n\n*These nodes return standardized JSON error responses:*\n\n- 🔒 `401 Unauthorized`:\nTriggered when the request is missing a valid Bearer YOUR_TOKEN_HERE\n\n- 📭 `400 Bad Request`"
      }
    },
    {
      "id": "f451c9be-4cfb-4628-8aa7-66b66ad86bab",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        840,
        -280
      ],
      "parameters": {
        "width": 460,
        "height": 460,
        "content": "### ✅ Set & 200 Response Nodes\n\n- 🧱 `Create Response`\nBuilds the JSON response from the incoming request.\nUse this to extract, transform, or forward specific values (e.g., message, sender, etc.).\n\n- 📬"
      }
    },
    {
      "id": "8d4e8406-c3fe-4e8a-bfa8-18407fe5e67a",
      "name": "Add workflow nodes here",
      "type": "n8n-nodes-base.noOp",
      "position": [
        680,
        20
      ]
    },
    {
      "id": "f3f461a6-dc48-42cd-ac75-d045795006d0",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -280
      ],
      "parameters": {
        "width": 440,
        "height": 460,
        "content": "### 🔍 Required Fields Validator\n\n*This Code node checks if all fields defined in config.requiredFields are present in the incoming request body.*\n\n- Reads the body from the Webhook node.\n\n- Loops thro"
      }
    },
    {
      "id": "2766dae8-8def-462f-a53c-0f51606eea0a",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1220,
        -340
      ],
      "parameters": {
        "width": 760,
        "height": 780,
        "content": "## 🔐 Secure Webhook – Summary\n\n*This workflow protects a public webhook with **authentication** and **payload validation**.*\n\n\n---\n\n#### 🧩 Why use it?\n- ✅ Ensure only trusted clients can call your wor"
      }
    },
    {
      "id": "70c8f060-587a-4524-ab32-7362cc0c4cf9",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1220,
        -600
      ],
      "parameters": {
        "width": 760,
        "height": 240,
        "content": "## Support My Work! ❤️\n\n**👋 Hello! I'm Audun / xqus** \n🔗 My work: [xqus.com](https://xqus.com)\n\nIf my n8n workflows saved you time or sparked ideas, [consider sending a little support](https://donate."
      }
    }
  ],
  "connections": {
    "200 OK": {
      "main": [
        []
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configuration": {
      "main": [
        [
          {
            "node": "Check Authorization Header",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Response": {
      "main": [
        [
          {
            "node": "200 OK",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Valid Request": {
      "main": [
        [
          {
            "node": "Add workflow nodes here",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "400 Bad Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has required fields?": {
      "main": [
        [
          {
            "node": "Check Valid Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add workflow nodes here": {
      "main": [
        [
          {
            "node": "Create Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Authorization Header": {
      "main": [
        [
          {
            "node": "Has required fields?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "401 Unauthorized",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}