I have a problem with this workflow right now. I want to analyze for example three files while using Ollama but the model only reads one file
I want it to read all three files because it needs to choose something from among the three and the model must read all three files together not just one
Hi @claw you can loop all these files so that the agent uses all the 3 files and then proceeds with the workflow instead of reading one file and then moving ahead.
So loop your Drive files something like this: Your Flow Should Look Like This
The issue is that AI sub-nodes in n8n only look at the first item, so even though 3 files come in Ollama just reads the first one. You need to merge everything into a single item before it hits the LLM node, easiest way is to add an Aggregate node set to “All Item Data” right before your Ollama chain and then reference the combined content in your prompt.
The issue is that LLM nodes in n8n only process the first input item, so even though 3 items go in it only reads one. You need to merge everything into a single item before it hits Ollama, easiest way is to drop an Aggregate node between your Google Drive nodes and the LLM node so all the file contents get combined into one item that the model can actually see together. I tried explaining it better
this is the same logic
do you understand my problem?
can you show example please
i feel this is the correct path but the merge still give me three files
As far as you have asked.
And your current workflow setup does not allow this , and my example flow solves this problem.
And for this the sample flow works as it will scan all the files and then will continue your flow in the DONE branch of the loop so that your AI gets all 3 images and then it can process it further.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.