Error "No data found from main input"

Hi community :waving_hand:,

I’m building a workflow in n8n to centralize transportation requests. The current structure is:
Gmail Trigger → Basic LLM Chain (with Structured Output Parser.1) → Edit Fields → Google Sheets

The issue I’m facing is that I cannot connect the Structured Output Parser.1 directly to the Edit Fields node. n8n only allows me to connect Basic LLM Chain → Edit Fields, but when I do this, I get the following error:

No data found from “main” input

I understand this means the Edit Fields node is not receiving any valid input items, but I don’t understand how to make the structured JSON from Structured Output Parser.1 available as a main output to use it in Edit Fields or in a Set node.

In the output of Structured Output Parser.1 I can clearly see my structured JSON inside response.output, for example:

In the Edit Fields node, I’m trying to use expressions like:

But since Edit Fields is only connected to the Basic LLM Chain, I either get undefined or the “main input” error.

Question:

How should I correctly connect the Structured Output Parser.1 so that its data is available in the Edit Fields or Set node?
Is there a way for the parser to expose a main output that can be connected, or should I always map directly from the Basic LLM Chain output?

Any guidance would be super helpful :folded_hands:

Structured outputs node is part of the LangChain wrapper that n8n uses for AI stuff.

AI nodes consist of Root Nodes (Agent node, Basic LLM chain…) and sub nodes (chat models, memory, tools, structured outputs)

In the Set node, you can only reference outputs of the Root nodes. Sub nodes are not accessible like this.

What you are trying to achieve should be doable when you reference the output of the Agent / Basic LLM node.

1 Like

So if I wanted to extract, for example, token count used by Chat Model subnode how do I do it exactly?