Http node error 400 not handled

I’m using HTTP request node and sometimes I’m getting HTTP 400 errors.

The node window shows only that the request was rejected with error 400 and a stack trace, the node connected afterwards doesn’t get invoked, neither does Error Trigger in the workflow.

Am I missing something?

Hi @mattesilver

When you want it to continue on fail you will have te set this in the setting of the node:

Haven’t used the error trigger yet, but I am guessing that would be a setting as well.

Thanks @BramKn.

As for the error trigger @mattesilver, this would only run when the failing workflow (the one with the HTTP Request node) has an error workflow set.

If the workflow fails, the error workflow would then start at the error trigger:

I’ve created a simple error workflow with an error trigger and a slack message. it tests and sends a test message to my slack channel.
I\ve set it as the error workflow for my n8n instance.
The other workflow with HTTP still errs and error handler doesn’t get invoked.

That only makes it fail for each item.
And I can only get an item with the stack trace and not the server response

If you don’t want to stop exececution on errors you can use the Continue On Fail option suggested by @BramKn above which would do the trick and continue even on errors. You’d just need to make sure to handle the error case afterwards.

Specifically for the HTTP Request node you could alternatively use the Ignore Response Code option:
image

But you’d still need to then implement your own check whether the response matches your expectations or not. This could look like so:

Example Workflow

The Function node in the above example just sets a couple of dummy URLs to use for testing, the HTTP Request and IF nodes are the ones making the request and checking how it went.

I need to see the HTTP response body. I guess my best shot is ignoring the error codes and handling it in the next node.

Still, the error handler workflow isn’t called in either case

So I’ve just tested the error flow upon running into an HTTP Error code and this is working fine for me:
image

As shown above, the HTTP Request node of my “HTTP Error” flow produces a 400 status. My “Error Flow” then runs as expected and the error data is available in the Error Trigger node:

So in order to further look into the problem you have described I’d need an example workflow and error flow using which this can be reproduced.

It’s worth keeping in mind the Error Trigger would not be called when manually executing the original workflow (as in this case you’d have the error right in the UI).

I don’t see response body in your screenshot…

You will not get both. You either:

  • have the node fail and then have the error workflow called (@MutedJam just showed above that it works fine). But there you will just receive the error, not the body. (if “Continue on Fail” and “Ignore Response Code” are not set)

or

  • have the node not fail, the workflow then continuing and you will get the full body (if “Ignore Response Code” is set)
1 Like