Basic LLM Chain node to return a flat JSON

Hello,

I would like the Basic LLM Chain node (with an output parser) to return a flat JSON like that

{
  "title": "The article title, exactly as provided",
  "category": "Business/Market",
  "importance_score": 5,
  "executive_takeaway": "One sentence takeaway for a C-suite executive."
}

However, I always get a nested one with this output wrapper

{"output":{"title":"...","category":"..."}}

Any chance to get a flat result ?

The output parser on Basic LLM Chain always wraps the parsed object in `output`, so `{ “output”: { “title”: … } }` is expected. The node doesn’t have a switch that returns the object as the item itself.

The usual fix is a Set (or Edit Fields) node right after the chain. Set the item to the inner object, for example `{{ $json.output }}`, or map `title`, `category`, `importance_score` and `executive_takeaway` from `$json.output.*`. A one-line Code node also works:

```

return [{ json: $json.output }];

```

That gives you the flat shape you listed. If you later add more parser fields, keep reading from `output` so you don’t have to chase a changing wrapper.

Correct, I have used an Edit Fields

Thanks for the code node tip, I will try as well

return [{ json: $json.output }];

The Basic LLM Chain enforces that root `output` key by design through its LangChain parser contract; there isn’t a setting inside the node to flatten it directly.

The simplest workaround is placing a **Code** node right after it (set to *Run Once for Each Item*):

```javascript
return { json: $json.output };
```

Alternatively, if you’re on a recent n8n version, switch to the dedicated **Information Extractor** node—it uses structured outputs natively and places your extracted properties directly at the root level without the LangChain wrapper.

Thanks for the info !