A reusable and production-ready n8n workflow that secures public webhooks using Bearer Token authentication and dynamic request validation.
Verifies Bearer Token
Compares the Authorization header with a configured secret token.
Validates Required Fields
Checks that all expected fields are present in the incoming request body.
Returns Standardized JSON Responses
401 Unauthorized if token is missing or invalid400 Bad Request if required fields are missing200 OK with a custom success payloadConfigure Values in theConfiguration 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.
Create Response node to shape your success payload.📌 Use this as a base for building secure, API-style workflows in n8n.
👋 Hello! I'mAudun / 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!


