Hi @flipflip, items[0] selects only the first product. In 2.39.7, this option doesn’t support items[*], and _embedded.items won’t work in “Field Containing Data” either.
Use a Call n8n Workflow Tool connected to your agent, with this sub-workflow:
When Executed by Another Workflow → HTTP Request → Code
Keep your existing HTTP request settings. Set the Code node to “Run Once for All Items” and use:
Publish that sub-workflow and select it in the tool. The agent gets only these two fields for every returned product, without receiving the full API response first.
@flipflip the standard "Optimizec Response " feature in the n8n Request node currently does not support array wildcards (like items[*] or items) to pluck nested values dynamically
Since you explicitly hardcorded the index item[0] , n8n limits the filtered scope to strictly that first entry . To extract specific values accross every object inside the array dynamically while keeping payloads lean for an LLM agent , you can apply two reliable solutions:
Solution 1 : Use a JavaScript Expression ( Recommended)
You can leaverage JavaScript’s Built-in .map() and .pluck() array operators inside n8n expression to dynamically map over the array and filter just the fields you want.
Next to Fields parameter box, switch the toggle from fixed to expression.
This extracts the dynamic attributes from every item in your _embedded.items array and bundles them into a clean array structure for your LLM.
Solution 2 :Pre-process with an "Edit Fields (set) "Node
if you prefer configuring it natively via workflow paths before passing the schema data to your Agent tool, use an Edit Fields node right after your API Call.
Add an Edit Fields (set) node after the HTTP Request node.
Toggle off keep All other fields (to remove the bulky raw data metadata).
Click Add Field , name it optimized_items, select Array as the data type, and use this expression below :
{{$json._embedded.items.pluck('values')}}
Alternatively , map it cleanly via a small JavaScript snippet inside a Code Node if you want perfect precision over the nested key targets: