New Tool Radar

AI Agents & Automation

How to Connect a Google Sheets Tool to an n8n AI Agent

Give an n8n AI agent a Google Sheets tool so it can read rows to answer questions and write rows to record what it did.

Schematic diagram with three steps: Attach Sheets tool, Point at one sheet, then Test a read and a write.

A sheet is the simplest shared memory an agent can use: rows the agent can read to answer, and rows it can write to record what it did. The n8n tutorial lists Google Sheets among the tools an agent can call, and the same tool serves both directions.

Before you start

You need a working n8n AI Agent node, a Google account with access to one sheet, and Google Sheets credentials saved in n8n. Use a copy of the sheet for testing, not the live one, and set the sheet sharing so only the people who need it can open it.

Attach the tool and point it at one sheet

Attach a Google Sheets tool sub-node to the AI Agent node and select the sheet and the tab it may use. Write the tool description with the column names and what each column means, so the model reads the right columns. If the agent should only read, say so in the system message and do not give it a write operation.

Test a read, then a write, then check the sheet by hand

Ask a question whose answer is in the sheet, then ask the agent to record a new row, then open the sheet yourself and check both the answer and the row. A wrong column or a shifted row is the most common failure, and only opening the sheet shows it.

Worked example: A fictional stock sheet with three rows

Maple Cycles is a fictional bike shop. Its agent reads a stock sheet with three rows, then records one sale. The table is the sheet as the agent should read it.

Item In stock Price in dollars
City bike 6 420
Helmet 14 45
Repair stand 3 120

Expected result (UNTESTED): the agent answers the stock question from the sheet, and after the sale the City bike row shows 5 in stock. We checked the n8n tutorial, which lists Google Sheets as an agent tool, but we did not run the read and write on a live n8n instance.

Limits

A sheet has no locking, so two agents writing at once can overwrite each other. The agent can also misread a column if the header names are unclear, so keep headers short and exact. For anything that must not be lost, a database is a better store than a sheet.

Sources

See all