Processing entire list in a single LLM query

Hi, very beginner to n8n here. I am trying to create a simple workflow, where I pass on name of the file, load list of folders (on Google Drive) and try to figure out, which folder is most suitable place to move that file to

I have successfully connected to Google Drive and loaded list of folders as JSON and converted it into the list of names

When I initiate the query to LLM, I provide the prompt like “Please look at the name of this file and find the most appropriate folder in this list

It seems to me that n8n fires a separate query to LLM for each of the folders in the list, so I end up with hundreds of queries. Is there a way to make LLM to take the list as a whole and execute a single query against it?

Thank you

1 Like

Hey, @levank

Could you share your workflow?

n8n attach workflow

It’s likely generating items, so you need to combine them all together into one JSON.

You are probably going to need

Hope this helps.

thank you for your response. I actually have managed to sort it out by eventually getting the prompt right :slight_smile:

1 Like