How to read error message and status code from the HTTP Request node

Describe the problem/error/question

Use case: Based on the response received from my HTTP request node, I want my next node to be executed.
Example: If the response is 400 and contains the following message:

{
"code": "missing_parameter",
"message": "Missing listIds or newList"
}

Then, based on this message, I will deactivate (make inactive) the current workflow.

What is the error message (if any)?

NO

Please share your workflow

dummy

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @Gouravdev, to get the status code and the full error message you can use the “Never Error” and “Include Response Headers and Status” options of the HTTP Request node:

image

You can then check for these values in your IF node. If your condition is met you could then disable your workflow via n8n’s REST API.

1 Like