# AI Agent using google sheets tool

**URL:** <https://community.n8n.io/t/ai-agent-using-google-sheets-tool/135490>\
**Category:** Questions\
**Created:** [June 19, 2025, 8:39pm UTC](https://community.n8n.io/t/ai-agent-using-google-sheets-tool/135490 "2025-06-19T20:39:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![m4xwe11o](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@m4xwe11o](https://community.n8n.io/u/m4xwe11o)\
**Post date:** [June 19, 2025, 8:39pm UTC](https://community.n8n.io/t/ai-agent-using-google-sheets-tool/135490/1 "2025-06-19T20:39:46Z")

</div>

Ahoi everyone,

I’m currently exploring how the AI Agent works and want to create an Agent that can access our demo environment via an MCP server to extract information and write it to an google sheet

The main idea is to create an Agent that can create invoices simply from chatting.

It starts with the chat message:  
_prepare the invoice for all my customers that have active subscriptions_

The final response is the following:  
_I have prepared the invoices for customers with active subscriptions. Here are the details:_

_Customer: Technocompany Test (Customer ID: 291154)_

\*\* Subscription: M365 Business Std CHAR Trial (25 min), Licenses: 25, Price per License: 0 EUR, Total Price: 0 EUR\*  
\*\* Subscription: Exchange Online (Plan 1) GOV, Licenses: 1, Price per License: 10 EUR, Total Price: 10 EUR\*

_Customer: Its Hammertime - Handwerkervermittlung (testing) (Customer ID: 291155)_

\*\* Subscription: M365 Business Basic (no Teams), Licenses: 2, Price per License: 10 EUR, Total Price: 20 EUR\*  
\*\* Subscription: M365 Business Basic, Licenses: 3, Price per License: 80.64 EUR, Total Price: 241.92 EUR\*

_If you want invoices for more customers or need any other assistance, please let me know._

## Describe the problem/error/question

The AI Agent executes the Google Sheets tool to append a row 4 times, and the same row is always overwritten.  
I can see that each subscription is written to the row in google sheets, unfortunately it’s always overwritten with the last value:

| customerId | customerOrganization | skuDisplayName | subscriptionTotalLicenses | price | sum |
| --- | --- | --- | --- | --- | --- |
| 291155 | Its Hammertime - Handwerkervermittlung (testing) | M365 Business Basic (no Teams) | 2 | 10 | |

When I click through each execution of the tool i see:

```auto
[
  {
    "response": [
      {
        "customerOrganization": "Technocompany Test",
        "customerId": "291154",
        "skuDisplayName": "M365 Business Std CHAR Trial (25 min)",
        "price": "0",
        "subscriptionTotalLicenses": "25",
        "sum": "0"
      }
    ]
  }
]

```

```auto
[
  {
    "response": [
      {
        "customerOrganization": "Technocompany Test",
        "customerId": "291154",
        "skuDisplayName": "Exchange Online (Plan 1) GOV",
        "price": "10",
        "subscriptionTotalLicenses": "1",
        "sum": "10"
      }
    ]
  }
]

```

```auto
[
  {
    "response": [
      {
        "customerOrganization": "Its Hammertime - Handwerkervermittlung (testing)",
        "customerId": "291155",
        "skuDisplayName": "M365 Business Basic",
        "price": "80.64",
        "subscriptionTotalLicenses": "3",
        "sum": "241.92"
      }
    ]
  }
]

```

```auto
[
  {
    "response": [
      {
        "customerOrganization": "Its Hammertime - Handwerkervermittlung (testing)",
        "customerId": "291155",
        "skuDisplayName": "M365 Business Basic (no Teams)",
        "price": "10",
        "subscriptionTotalLicenses": "2",
        "sum": "20"
      }
    ]
  }
]

```

## What is the error message (if any)?

The Google Sheets tool is executed 4 times with dirrent values every time.  
Unfortunately in Google Sheets the next empty row is always overwritten

## Please share your workflow

```auto
[
  {
    "output": "The invoice has been prepared for your customers with active subscriptions. Here are the details:\n\nCustomer ID: 291154 (Technocompany Test)\n- Subscription: M365 Business Std CHAR Trial (25 min), Price: 0 EUR, Licenses: 25, Total: 0 EUR\n- Subscription: Exchange Online (Plan 1) GOV, Price: 10 EUR, Licenses: 1, Total: 10 EUR\n\nCustomer ID: 291155 (Its Hammertime - Handwerkervermittlung (testing))\n- Subscription: M365 Business Basic (no Teams), Price: 10 EUR, Licenses: 2, Total: 20 EUR\n- Subscription: M365 Business Basic, Price: 80.64 EUR, Licenses: 3, Total: 241.92 EUR\n\nIf you need invoices for other customers or additional assistance, please let me know."
  }
]

```

## Information on your n8n setup

- **n8n version: 1.95.3**
- **Database (default: SQLite): SQLite**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):**
- **Running n8n via (Docker):Docker**
- **Operating system:Linux - Self Hosted**

Do you know how to fix this issue?

BR Maximilian

---

<div class="post-metadata">

**Author:** ![m4xwe11o](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@m4xwe11o](https://community.n8n.io/u/m4xwe11o)\
**Post date:** [June 20, 2025, 11:58am UTC](https://community.n8n.io/t/ai-agent-using-google-sheets-tool/135490/2 "2025-06-20T11:58:01Z")

</div>

Ahoi,

topic can be closed.  
I managed to format the output of the agent and run the Google Sheets node independently with a Code node before.

Also had to tweak the system message of the AI Agent.  
I think the issue with using Google Sheets as a tool is, that the AI Agent is way to fast in adding rows to the Google Sheet

Cheers

---

<div class="post-metadata">

**Author:** ![jpvanoosten](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jpvanoosten/32/31808_2.png) [@jpvanoosten](https://community.n8n.io/u/jpvanoosten)\
**Post date:** [July 3, 2025, 7:12am UTC](https://community.n8n.io/t/ai-agent-using-google-sheets-tool/135490/3 "2025-07-03T07:12:53Z")

</div>

Hi @m4xwe11o, you got it! The tool is being called in parallel, and is not set-up to handle that parallelism yet. This is not something that happens with “normal” nodes in n8n, so while in some cases it’s useful, in other cases it can be a problem, as you note here. We’re aware of the issue and solving it requires a bit more changes under the hood.

One way of solving this is, indeed, using a node that executes _after_ the agent. You get the agent to output the requested fields by using structured output, and use a different node to insert the rows into your sheet. You could, of course, use another agent / LLM chain to generate a nice message at the end if you want.  
Another thing that might help is asking it to execute tools one by one, but I haven’t tried whether this actually works reliably.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [October 1, 2025, 7:13am UTC](https://community.n8n.io/t/ai-agent-using-google-sheets-tool/135490/4 "2025-10-01T07:13:29Z")

</div>

Closed on October 1, 2025, 7:13am UTC

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