In Http request node: Need to raw response of http instead of only when its success

Question by: prasad8mhatre

Usecase:

  1. There is a need of handling various case as per status code and response from http request.
  2. What is default timeout of the http request?
  3. let say when there is timeout then a email needs to be sent.
  4. So need raw response from http request module and that response will be forwarded to if block and it will transfer it to either true or false flow(sending email).

Please suggest any way to achieve this

The most should actually be possible by adding the option “Full Response” and setting it to true. It will then return all the data, incl. response code. It will then also not fail when the response code is a none 2xx one.

The default timeout (when none got added as an option) is the same as the npm request module uses by default. Sorry not sure right now how long. You would have to check that in the module itself.

To send an email when a Request-Node hits a timeout you would have to define an “Error Workflow”. When the node fails it would trigger the start of that “Error Workflow” and that would then send the email.
An example “Error Workflow” which does exactly that can be found here:
https://n8n.io/workflows/8

An “Error Workflow” can be set in the “Workflow Settings”.