Why does n8n always return arrays, even when I return a single object?

Hi all,

I’m working on a workflow where I want to return a single JSON object when responding to webhook. Instead the JSON is always wrapped in an array.
Is there a clean way to truly return just a single JSON object?

this is the data that respond to webhook sends to my backend

[
   {
      "output": 
         {
           "status":  "error",
          "action":  "createPoster",
          "link":  "",
          "text": "Tool execution failed due to an undefined error."
         }
      }
]

I want it to be the following

{
          "status": "error",
          "action": "createPoster",
          "link": "",
          "text": "Tool execution failed due to an undefined error."
}

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.85.4
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): web app
  • Operating system: macos sequoia 15.0


Your code is correct.
The output of the Respond to Webhook node is not the same as the actual output of the Webhook.
The output you see in the workflow is the data that is passed to nodes in your workflow after this node.

To have the same object you could use the Set node, change the mode to json and set Respond with= First incoming item in your Respond to Webhook node

1 Like

thank you!

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