Validate
The validate node checks one message property before the flow continues. It
supports a practical JSON Schema subset without external dependencies.
Properties
Section titled “Properties”| Property | Purpose |
|---|---|
| Name | Flow label. |
| Property | msg path to validate, such as payload or payload.data. |
| On invalid | Route to a second output or throw to a Catch node. |
| Strict | Reject object properties that are not declared in the schema. |
| Coerce | Convert supported string values to numbers or booleans. |
| Schema | Definition created in Builder or JSON view. |
Invalid JSON or structurally invalid schemas block deployment.
Builder And JSON Views
Section titled “Builder And JSON Views”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.
Supported Keywords
Section titled “Supported Keywords”type: string, number, integer, boolean, object, array, nullrequiredpropertiesitemsenumconstminimum,maximumminLength,maxLengthpatternformat: email, uuid, date, date-time, urlminItems,maxItemsadditionalProperties
Unknown keywords are ignored and shown as editor warnings.
Runtime Schema
Section titled “Runtime Schema”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.
Outputs
Section titled “Outputs”In Route to 2nd output mode:
- Valid messages leave the first output.
- 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.