⚒️ Secure API endpoint with bearer token authentication and field validation

1,226 views · ⚒️ Engineering

Description

A reusable and production-ready n8n workflow that secures public webhooks using Bearer Token authentication and dynamic request validation.


✨ What It Does


👤 Who It’s For


💡 Why Use It


🛠 Setup Instructions

  1. Configure Values in the Configuration Node

    • Set your secret token:
      config.bearerToken = YOUR_TOKEN
    • Define required request fields by key:
      Example:
      config.requiredFields.message = true;
      config.requiredFields.email = true;
      ✅ Only the keys matter – values can be anything.
  2. Plug in Your Business Logic
    Replace the "Add workflow nodes here" with your own logic.

  3. Customize the Success Response
    Edit the Create Response node to shape your success payload.


🧪 Use Cases


📌 Use this as a base for building secure, API-style workflows in n8n.


👋 Hello! I’m Audun / xqus

If my n8n workflows saved you time or sparked ideas, consider sending a little support my way. It helps me keep building cool stuff — and maybe grab a coffee ☕ along the way!

🔗 Nodes Used

Webhook

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup