TL;DR;
Is there a way to catch and action on an Authorization Error in the webhook node?
Longer version:
I have a Webhook node set up in a workflow (as the starting point), and have Header Auth set up on the Webhook.
If the webhook is called with incorrect Auth, it returns 401 Authorization data is wrong! (which is as expected), however I would like my Workflow to report on this - for example, an email node to send me an email saying “Hey, this Webhook was called, incorrectly”.
Is this possible?
I have an error handler workflow set up, but it doesn’t seem to be triggered by a failed Auth on the webhook.
You could handle it similar to the solution offered in this thread wherein you continue on fail through the webhook call and conditionally output details about the response: Webhook Error in workflow details - #4 by MutedJam
@runriot There was an assumption on my part that you were calling the webhook from another workflow. Is that the case? Or are you calling it from an external service?
You are correct that the webhook node itself does not have that option, but the HTTP Request node does if you use that to call the webhook.
I’m calling the n8n webhook from an external service.
Thinking about it… The webhook endpoint will most likely just return the 401 state at the header, and then cease - ie not even being able to proceed for the node to pick up the request - so it’s likely impossible to catch it within n8n?
Makes more sense to catch it at the external service end (but in this case, it has no ability to do so, hence this question!)