How to Update Multiple Rows in Google Sheets at Once in n8n?

Hi everyone

I’m currently learning n8n and experimenting with Google Sheets automation. I’ve set up a workflow (screenshot attached) that includes:

  • Trigger: “When chat message received”
  • AI Agent connected to:
    • Google Gemini Chat Model
    • Simple Memory
    • Get Row(s) in Google Sheets Tool
    • Update Row in Google Sheets tool

When I ask the AI agent something like —> “Update all tasks due today to priority: High”

The agent responds saying it can only update them → one by one*. Even when I approve it, it behaves in an odd way. instead of updating, it creates duplicate rows with similar data.
I understand that the “Update Row” node in Google Sheets requires a unique identifier (like a row number or unique column) to match and update a specific row, so it makes sense that it’s only handling one row at a time.
I’d like to know if there’s any workaround to update multiple rows at once. For example, all rows that meet a certain condition.
Has anyone managed to handle bulk updates in Google Sheets through n8n? Any tips, patterns, or workarounds (like Function nodes, batch operations, code nodes (JS, Python etc.) would be appreciated.

Thanks in advance! :folded_hands:

Please share your workflow

Share the output returned by the last node

[
{
“output”:
“I found two students with G_activity ‘Book Binding’:\n\n* Tenzin Bhuti (Admission Number: 6675, Class: XIIB)\n* Tenzin Yingsal (Admission Number: 2343, Class: XIB)\n\nI can update these records for you, but I need to do them one by one. Would you like me to update Tenzin Bhuti’s G_activity to ‘Origami’ first?”
}
]

Information on your n8n setup

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

Hi @Tenzin_Nyima_10B15

The limitation here is that the Google Sheet operation only supports updating a single row at a time:
image

A trick I use to work around this is by using the “AI Agent Tool” with “Batch Processing”, this allows the main agent to call the tool with a customized batch size, or let the model decide it:

Writing a clear or detailed description for the AI Agent Tool will make it easier for the main agent to use it effectively..

Try this approach, I think it’s quite efficient:

2 Likes

Thanks a lot for taking the time to reply! :folded_hands: I tried your approach with the AI Agent Tool and batch processing, but unfortunately, it didn’t work on my end. When I asked the AI (via the Chat tool) to update all the student records that have G_activity: “Origami” to “Book Binding”, it said it couldn’t do it and needed all the values of the other fields. Even after providing all the details, the change didn’t reflect in my Google Sheet. I might be doing something wrong with the prompt or setup though. Really appreciate your help though!

you want to update the column that is used for matching which is not possible

Thank you for poiiting out my mistake! It works now. I am able to update multiple rows in Google Sheets by asking the AI agent through the Chat Message trigger node.

1 Like

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