How to Process Google Sheet Rows with OpenAI and Save Responses Back to the Same Row”

Describe the problem/error/question

I am trying to create an n8n workflow to process rows of data from a Google Sheet. Each row contains answers to five interview questions (in columns q1 to q5). I want to:
• Exclude the header row.
• Evaluate each cell (q1 to q5) using a specific OpenAI prompt (prompt1 to prompt5) for each question.
• Save the OpenAI responses in new columns of the same row (e.g., columns F to J).

I am getting stuck in the best way too approach this and I am sure there is a simple way. I use a loop function to get each row, but I don’t know if I need another loop to process each cell in each row differently
i.e.

  • send cell q1 to openai model using prompt1
  • loop till the 5th cell
  • aggregate result and append to the row
  • loop over the other rows in google sheet

What is the error message (if any)?

none - this is me looking for an efficient way

Please share your workflow

type or paste code here
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

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

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

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