Node-RED flow fails to process custom event type in app enablement workspace

I’m having trouble with a Node-RED flow that’s supposed to process custom event types from our IoT devices. The flow executes fine for standard Watson IoT event types, but completely halts when it receives our custom event schema.

Our devices send events with this structure:

{
  "eventType": "maintenance_alert",
  "payload": {"equipmentId": "E-1001", "severity": "high"}
}

The Node-RED parser node throws an error: “Unrecognized event format” and the flow stops processing. I’ve checked the custom event schema registration in Watson IoT Platform and it shows as active. The error handling in the flow doesn’t catch this issue either - it just silently fails. Has anyone successfully implemented custom event type processing in Node-RED with Watson IoT wiot-24?

I added a function node to log the incoming message structure, and I can see the custom event arriving correctly. The issue happens specifically in the Watson IoT parser node - it seems to validate against a hardcoded schema and rejects anything that doesn’t match standard Watson IoT event types. Is there a way to bypass the parser validation or register custom schemas properly?

Custom event types need explicit schema mapping in your Node-RED flow. The Watson IoT input node expects standard event formats by default. Add a function node before your parser to transform the custom event into a format the parser recognizes. Also check if your event schema in Watson IoT includes the exact field names and types you’re sending.

The issue is a combination of three factors that need to be addressed systematically.

First, the custom event schema must be properly registered at the device type level with exact field matching. Your schema registration should look like this in Watson IoT Platform:

{
  "name": "maintenance_alert",
  "fields": [
    {"name": "eventType", "type": "string"},
    {"name": "payload.equipmentId", "type": "string"},
    {"name": "payload.severity", "type": "string"}
  ]
}

Notice the nested field notation for payload properties - this is critical for the parser to validate correctly.

Second, update your Node-RED parser node configuration. The Watson IoT input node has a “Schema Validation” option that defaults to “strict”. Change this to “lenient” mode to allow custom event types:

// In your function node before the parser:
msg.eventType = msg.payload.eventType;
msg.schemaValidation = "lenient";
return msg;

Third, implement proper error handling with a catch node. Your current flow likely has no catch node attached to the parser, causing silent failures. Add this error handler:

// Catch node function:
if (msg.error.source.type === "wiotp-parser") {
  node.warn("Schema validation failed: " + msg.error.message);
  // Route to alternate processing or dead letter queue
}

The combination of proper schema registration with nested field notation, lenient validation mode in the parser, and comprehensive error handling will resolve your custom event processing issues. After making these changes, restart your Node-RED flow and monitor the debug panel for any remaining validation warnings.