Add option to normalize single object to array

It would help if there was a node for:

My use case:

My use case:
When working with XML-based APIs (e.g. ERP systems), the API response format depends on the number of results:
Multiple results → returns an array:
DataExport: [ { “field1”: “value1” }, { “field2”: “value2” } ]
Single result → returns a single object:
DataExport: { “field1”: “value1” }
This inconsistent behavior causes the Split Out node to fail silently when a single object is returned. Instead of preserving the object, the node calls Object.values() internally and splits the object’s values into separate items, losing all field names in the process.
Example of the problem:
Input: DataExport: { “city”: “Berlin”, “zip”: “10115” }
Current output without fix - 2 items with data loss:
{ “DataExport”: “Berlin” }
{ “DataExport”: “10115” }
Expected output with fix - 1 item preserved correctly:
{ “city”: “Berlin”, “zip”: “10115” }
Currently the only workaround is to add a Code node before Split Out to manually wrap the field in an array:
const items = $input.all();
return items.map(item => {
const data = item.json.DocumentElement.DataExport;
if (!Array.isArray(data)) {
item.json.DocumentElement.DataExport = [data];
}
return item;
});
A simple toggle option “Normalize to Array” directly in the Split Out node would eliminate this extra step and make the node more robust for real-world API integrations.

Any resources to support this?

This is a well known problem with XML to JSON conversion. Many XML APIs follow the pattern of returning a single object instead of an array when only one result exists.

Are you willing to work on this?

Yes. I have already implemented this feature as a custom node and tested it successfully. I am willing to submit a Pull Request with the implementation.
The implementation adds a boolean toggle “Normalize to Array” to the Split Out node properties. When enabled it checks if the field to split is not already an array and wraps it in one before proceeding with the split operation. The change is minimal and fully backwards compatible - existing workflows are not affected since the toggle defaults to false.