ai newsDo., 15. Okt.
EilmeldungAlibaba Qwen N1 AI glasses go on sale in China

Mit n8n per Chat auf Google Sheets zugreifen

n8n bietet eine Chat-Vorlage, mit der sich Google Sheets per natürlicher Sprache abfragen lassen. Die KI findet Daten zuverlässig, scheitert aber bei mathematischen Berechnungen immer wieder.

dev.toSonntag 14:29 · 11.10.DE3 Min. Lesezeit
Bild: dev.to

Spreadsheets are where a lot of office work lives: the client list, the sales log, the invoice tracker. n8n ships a popular chat template that lets you ask a Google Sheet questions in plain English, and it feels like magic the first time. It also has a habit that surprises people: it is great at looking things up and sometimes confidently wrong at math. Here is how the setup works, and how to keep the answers honest.

I teach this at Stepthrough, so the walkthrough at the end is my own free lesson. The rest of this post stands on its own.

Three pieces, wired together on the n8n canvas:

Chat message -> AI Agent -> (chat model + Google Sheets tool) -> answer Enter fullscreen mode Exit fullscreen mode The template opens with empty credentials and no data, so the actual work is connecting your own OpenAI key, authorizing Google Sheets, and pointing the tool at a real spreadsheet.

Agents do much better with a boring, clean table. Use one header row, one record per row, and no merged cells. A made-up example for a small consulting firm:

Clear column names matter more than you think. The agent reads them to figure out what it can ask for.

Open the Google Sheets tool node, choose your credential, then pick the document and the sheet. Set the operation to read rows. A common mistake is leaving the tool on a placeholder document, which makes the agent say the sheet is empty when it simply is not looking at yours.

A tool description helps the agent decide when to use it. Something like:

{ "name": "client_invoices", "description": "Returns every row of the client invoice sheet. Columns: Client, Industry, Invoice, Status, Due." } Enter fullscreen mode Exit fullscreen mode Step 3: Give the agent a short system prompt Without guidance the agent improvises. A few plain sentences go a long way:

You answer questions about the client invoice sheet. Always read the sheet before answering. If the answer needs a calculation, show the rows you used. If you are not sure, say so instead of guessing. Enter fullscreen mode Exit fullscreen mode Step 4: Ask it things Try lookups first: "Which clients are overdue?" or "When is Maple Accounting due?" These work well because the agent only has to find rows and quote them.

Now ask: "What is the total of all open and overdue invoices?" Sometimes you get 9,900 (correct), and sometimes a number that is close but off.

The reason is that a language model predicts text. It is not a calculator. When it adds a column of numbers, it is producing what a plausible sum looks like. With three rows that usually works. With three hundred, rows get skipped, duplicated, or truncated, because the tool may only hand back part of the sheet and the model does not always notice.

A good rule of thumb: use the agent for finding and explaining, and use formulas for adding. If a number is going into a report or an email to a client, check it against the sheet once.

None of that requires code beyond what you have seen above, and none of it should touch real client data while you are still learning. Practice on a made-up sheet first.

If you would rather click through it than read about it, I built a free practice version. You work in a practice copy of the n8n editor, it checks each step, and nothing touches your real accounts. It takes about 8 minutes:

n8n: Talk to Your Google Sheets with ChatGPT (free lesson)

Have you hit the "confident wrong number" problem with an agent in your own workflows? I would like to hear how you solved it.

Originaltitel: n8n: Talk to your Google Sheets with an AI Agent (and why it sometimes gets the math wrong)Quelle: dev.to (dev.to). Original öffnen