Throw Error

The Throw Error node stops workflow execution immediately and returns an error response with a custom HTTP status code.

The Throw Error node stops workflow execution immediately and returns an error response with a custom HTTP status code. Use it for validation failures, unauthorized access, or other error conditions.

Overview

PropertyValue
Inputs1
Outputs0
OutputWorkflow stops; error response returned to caller

Parameters

ParameterTypeDescription
labelstringNode identifier (camelCase)
errorMessageexpressionError message (supports expressions)
httpStatusCodenumberHTTP status code (e.g. 400, 401, 403, 404, 429, 500)

Common Status Codes

CodeUse case
400Bad Request (invalid input)
401Unauthorized (authentication required)
403Forbidden (access denied)
404Not Found (resource missing)
422Unprocessable Entity (validation error)
429Too Many Requests (rate limit)
500Internal Server Error

Example

{
  "type": "throwError",
  "data": {
    "label": "validationError",
    "errorMessage": "Text input is required",
    "httpStatusCode": 400
  }
}

Use with Condition to validate input and throw only when invalid:

  • Condition true → continue to Output
  • Condition false → Throw Error