Node Development: Get Many Operation Returning Single Item Instead of Multiple Items

When performing a Get Many operation, the response data is being treated as a single item instead of multiple separate items/rows, despite the API returning multiple records in the JSON response.

Current Behavior:
The operation returns a single item with multiple columns, instead of multiple separate items.

Expected Behavior:
We expect the operation to return multiple separate items, one for each record returned by the API.

Code Structure:

// Our handler returns data in this format:
const items = rawResponse.map((item) => ({
  json: item
}));

// Debug output shows the structure:
{
  "isArray": true,
  "length": 3,
  "itemsStructure": [
    {
      "type": "object",
      "hasJsonKey": true,
      "depth": 4
    },
    // ... similar structure for other items
  ]
}

n8n Setup:

  • n8n version: 1.7.x
  • Database (default: SQLite): Default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): Its a new n8n cummunity node being developed
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Windows

Questions:

  1. Is there a specific format requirement for n8n to recognise multiple items vs columns?
  2. Are we missing any n8n-specific wrapper or structure that would signal these should be separate items?
  3. Should we be using any specific n8n utilities or helpers to format the response?

Any insights on how to make n8n treat these as separate items/rows would be greatly appreciated.

I found where in the node I was mishandling the API response. Specifically, when processing a “get many” type operation, the code was incorrectly formatting the response data. It was wrapping the entire array of records received from the API into a single object, and then pushing that object into n8n’s data array. This resulted in a single item containing an array of records, rather than multiple individual items.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.