HTTP Request node is failing when the response code is a none 2xx one

I need to handle the response code of the http request, but the http request node is failing when the response code is a none 2xx one even when the option “Full Response” is set to true.

Hi @lqdominguez, welcome to the community!

I am sorry to hear you are having trouble and quickly tried reproducing this on my end. I’ve tried a bunch of status codes using https://httpstat.us/ but didn’t run into trouble here. This was my test:

{
  "nodes": [
    {
      "parameters": {
        "url": "https://httpstat.us/204",
        "options": {
          "fullResponse": true
        }
      },
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        600,
        450
      ]
    }
  ],
  "connections": {}
}

Could you share your workflow (removing any confidential details) and the error you were getting?

Many thanks!

Hi, this is the part of the workflow with the problem

{
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "apply-rules-multiple",
        "responseMode": "lastNode",
        "responseData": "allEntries",
        "options": {
          "binaryData": false
        }
      },
      "name": "Call",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        -930,
        -480
      ],
      "webhookId": "7b7f26cf-eaa7-40b9-8a9a-c72a4bcdfe8c",
      "alwaysOutputData": true
    },
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "https://url.com",
        "jsonParameters": true,
        "options": {
          "bodyContentType": "json",
          "fullResponse": true,
          "bodyContentCustomMimeType": "application/json"
        },
        "bodyParametersJson": "={{$node[\"Call\"].json[\"body\"]}}"
      },
      "name": "add-activities",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        -780,
        -480
      ]
    }
  ],
  "connections": {
    "Call": {
      "main": [
        [
          {
            "node": "add-activities",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Thanks a lot for sharing @lqdominguez! It seems that you haven’t set either the Ignore Response Code option or the Continue On Fail setting (on the Settings tab of the HTTP Request node).

Without these, the execution would stop on all non 2xx-responses as these codes would usually indicate an unsuccessful request. Could you try enabling either one and see if this works for you?

2 Likes

Thanks a lot @MutedJam, I set the Ignore Response Code option and it works.

1 Like

Awesome, thanks so much for confirming!