Skip to content

Validate

The validate node checks one message property before the flow continues. It supports a practical JSON Schema subset without external dependencies.

PropertyPurpose
NameFlow label.
Propertymsg path to validate, such as payload or payload.data.
On invalidRoute to a second output or throw to a Catch node.
StrictReject object properties that are not declared in the schema.
CoerceConvert supported string values to numbers or booleans.
SchemaDefinition created in Builder or JSON view.

Invalid JSON or structurally invalid schemas block deployment.

Builder supports simple flat object properties with name, type, required state, and description.

Use JSON view for nested objects, arrays, enums, constants, formats, and other constraints. A schema that the Builder cannot represent remains in JSON view.

  • type: string, number, integer, boolean, object, array, null
  • required
  • properties
  • items
  • enum
  • const
  • minimum, maximum
  • minLength, maxLength
  • pattern
  • format: email, uuid, date, date-time, url
  • minItems, maxItems
  • additionalProperties

Unknown keywords are ignored and shown as editor warnings.

msg.schema can override the configured schema with an object or JSON string. Use this only when the source of the schema is trusted and validated.

In Route to 2nd output mode:

  1. Valid messages leave the first output.
  2. Invalid messages leave the second output with msg.validationErrors.

Each validation error contains a path and message.

In Throw error mode, the node has one valid output. Invalid messages are sent to Node-RED error handling with msg.validationErrors attached.

When Coerce succeeds, the converted value is written back to the configured message property.