Webhook response for error

Hi,

I want to manage errors on a workflow with a Webhook Trigger, so I use an Error Trigger Workflow like this :

I want a response like this :

But when I send the query with Postman I just have the response “Error in workflow”.

How can I fix that ?

Hi @BenJ, the error workflow would be completely separate from your original workflow receiving the webhook in the workflow. It is unfortunately not possible to use the Respond to Webhook node in a different workflow than the Webhook node itself.

In case you do want to respond with a specific error message to incoming requests you would have to handle the error in the main workflow. This typically means using the “Continue On Fail” option for the relevant nodes in your main workflow, then using a subsequent IF node to check whether an error has occurred. For example:

When the HTTP Request node runs into an error, the execution will still continue because of the “Continue On Fail” option:

image

The IF node then checks if any error information is coming from the HTTP Request node. If so, the error response will be sent:

If the HTTP Request in this example is successful, the success response will be sent instead:

Hope this helps!

Hi @MutedJam,
Thank you for your reply.
If I have multiple nodes that could be in error, do I have to do this method for all of them ?

If I have multiple nodes that could be in error, do I have to do this method for all of them ?

This depends on how detailed you want your error messages to be. It can be helpful for your users to return an error message like “database lookup failed” if a PostgreSQL failed for example and another error like “CRM update failed” for a Hubspot node failing to run.

But you wouldn’t have to do this. Instead you can put all nodes that could potentially fail in a separate workflow with a Execute Workflow trigger node. In your main workflow you can then use the regular Execute Workflow node to call your sub-workflow consisting of multiple other nodes and simply check if an error occurred on this Execute Workflow node.

Hope this makes sense :slight_smile:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.