So I’m filtering data to avoid process everything in LLM, and after AI node I’m getting a single output field, so what is the intended way to restore original object + add LLM output, so after #3 I got objects with the same data structure?
– #1 – data object with 6 fields
– if the data goes around LLM node, it will arrive to #3 with all the same fields
– if the data goes through LLM node it will be shrank to a single “output” field.
To restore original object I have to use “LLM Output Normalise” and access previous node data with an ugly $('skip_llm').body.
Are there other ways to achieve that?
This spreads all original fields and just overrides/adds category from the LLM output no need to list each field manually.
It happens becasue the AI Agent node is designed to return only its output field, it doesn’t carry forward the input item’s data. This is by design, not a bug. So restoring context from a previous node is always required after any LLM/Agent node.
the spread operator issue happens because you’re getting an undefined value from a previous node—most likely skip_llm doesnt exist on that branch. try wrapping it: {{ { …($(‘skip_llm’).item.json || {}), category: $json.output } }} or if youre confident skip_llm always exists, debug the node with a quick log to confirm the data flow. also make sure alwaysOutputData is enabled on your ai agent node so it passes through even when empty.