Loop on reading xlsx file using AI Agent

Dear,

I want to read a file xlsx which contain on ColumnA name “Question” and ColumnB name “response”

Question must be injected to AI agent as question on Chat and on the output of AI Agent i get an answer which save into a file.

So i read each row of the file test.xlsx, get each question using by AI Agent and wrote on a unique file each answer given by AI Agent.

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • **n8n version:1.98.1
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):Docker
  • **Operating system:Win10
1 Like

Hi @jamal

The next step in your flow can be an AI Agent. That will take in each row in the sheet, and answer each question.

Are you stuck somewhere?

:heart:If this response helped you, please click the heart to show that it is useful

I create this workflow, it’s works but i get this result on .csv file output:

output
La question n’a pas de lien avec le domaine définioutput
La question n’a pas de lien avec le domaine défini

i would like to have only one header row contain (question: input from AI AGent , output: result from AI Agent):

question;output;
question1;La question n’a pas de lien avec le domaine défini;
question2;La question n’a pas de lien avec le domaine défini;

1 Like

@jamal

You need to use an output parser to output into json. Then use a set node to pivot to two columns. After its in that format, you should be ablt to output to csv.

:white_check_mark:If this response solved your issue, mark it as the solution to help the community

Workflow below.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.