Most small businesses track their customers and orders in Google Sheets. It works fine — until someone needs to look something up quickly. Then it becomes five minutes of scrolling, filtering, and Ctrl+F just to answer a simple question like "what's the status of Ahmed's order?"

I built an AI agent in n8n that eliminates that entirely. You ask it a question in plain language, it queries the Google Sheet, and gives you a direct answer. No spreadsheet access needed, no manual searching. In this post I'll walk through exactly how I built it and why I made the choices I did.

What you'll need A self-hosted or cloud n8n instance, a Google Sheet with your customer/order data, and a free OpenRouter account. Total AI cost: €0.

Why OpenRouter Instead of OpenAI Directly

The honest reason: OpenRouter has a free tier and OpenAI doesn't. When you're building and testing automations, you don't want to burn through paid API credits on every test run. OpenRouter gives you access to capable models from Meta, Google, and Mistral — completely free up to a generous daily limit.

Beyond cost, OpenRouter acts as a single unified API for dozens of models. Your n8n workflow doesn't care which model is behind it — you point it at OpenRouter and swap models in one place whenever you need to. For a customer service agent doing straightforward lookups and responses, a free model is more than capable enough. I've been using it in production without issues.

To get started: go to openrouter.ai → sign up → API Keys → create a key. Free, no credit card needed.

The Workflow Structure

The entire agent is 6 nodes. Here's what it looks like:

n8n AI customer service agent workflow showing chat trigger, AI agent, OpenRouter model, and 4 Google Sheets tools

The complete workflow — When chat message received → AI Agent with OpenRouter model → 4 Google Sheets tools

Reading from left to right: the When Chat Message Received trigger fires every time someone sends a message in the built-in n8n chat interface. That message goes straight to the AI Agent node, which is the brain of the whole thing. The agent has access to 4 tools — all Google Sheets operations — and decides which one to call based on what the user asked.

The 4 Tools

This is where the real work happens. Each tool is a Google Sheets node configured for a specific operation. The agent picks the right one based on what the user asks.

1. orders_by_order_id

Reads the sheet and filters by order ID. Used when someone asks "what's the status of order #1045?" The agent extracts the ID from the message and passes it to this tool.

2. orders_by_name

Same sheet, but filters by customer name. Used for "show me all orders for Sarah" or "has Mohammed placed any orders recently?" Name-based lookups are more common in practice because people remember names, not order numbers.

3. customer_status_by_name

Reads a separate customer status sheet. Returns things like account standing, subscription tier, or any custom status field you track. Useful for "is this customer still active?" type questions.

4. Append Row in Sheet

The only write operation. When a new order or customer record needs to be added, the agent uses this tool. You describe what to add and the agent formats it correctly and writes it to the sheet.

The agent decides which tool to use on its own — you don't route anything manually. This is what makes it an agent rather than just a workflow. You give it tools and a system prompt, it figures out the rest.

Configuring the AI Agent Node

The AI Agent node is where you connect everything together. In n8n, open the node and set:

The most important part is the system prompt. This tells the agent who it is, what data it has access to, and how to respond. Here's roughly what mine looks like:

You are a customer service assistant with access to order and customer data.

You have 4 tools:
- orders_by_order_id: look up an order by its ID number
- orders_by_name: look up orders by customer name
- customer_status_by_name: check a customer's account status
- append_row: add a new record to the sheet

Always use the most specific tool for the question.
If the user provides an order ID, use orders_by_order_id.
If they provide a name, use orders_by_name.
Answer concisely. If no record is found, say so clearly.

The clearer your system prompt, the more reliably the agent picks the right tool. Spend time on this — it's the difference between an agent that works and one that guesses wrong half the time.

Setting Up the Google Sheets Tools

Each tool node is a standard Google Sheets node in n8n. The key settings for the read tools:

⚠ The tool description matters a lot Write it like you're explaining the tool to a new employee. "Looks up order details when given an order ID number" is much better than "reads orders sheet." The agent uses this description to decide which tool to call.

For the append tool, set Operation to Append row and map the columns. You can use expressions to pull values from the agent's output, or let the agent construct the row data itself from the conversation.

Testing It

Once everything is connected, click the chat bubble in the bottom right of n8n to open the built-in chat interface. Try a few test messages:

User: What's the status of order 1042?
Agent: Order 1042 belongs to Sarah M. — status is Shipped, 
       dispatched on 14 Feb 2026.

User: Show me all orders for Ahmed
Agent: I found 3 orders for Ahmed:
       #1031 - Delivered
       #1038 - Processing  
       #1044 - Shipped

User: Add a new order for Maria, order #1050, status Pending
Agent: Done — I've added order #1050 for Maria with status 
       Pending to the sheet.

If the agent picks the wrong tool or gives a vague answer, go back and sharpen the system prompt and tool descriptions. That's usually the fix.

What I'd Do Differently

Add memory for longer sessions. Right now each message is independent — the agent doesn't remember what was said earlier in the conversation. This works fine for quick lookups but feels unnatural if someone asks a follow-up question. n8n has a Window Buffer Memory node that you can connect to the agent to fix this.

Add input validation. The agent will try to call tools even on vague or irrelevant messages. Adding a check at the start of the workflow — an IF node that only routes clear customer service queries to the agent — would make it more robust in production.

Use a stronger model for complex queries. The free Llama model handles straightforward lookups perfectly. But if you want the agent to reason across multiple rows, summarise patterns, or handle ambiguous requests, switch to a stronger model on OpenRouter. Some paid models on OpenRouter are still much cheaper than OpenAI direct.

Conclusion

The entire workflow took about 2 hours to build and test — most of that time was writing and refining the system prompt. The actual n8n configuration is straightforward once you understand how tools work in the AI Agent node.

What I like most about this setup is how accessible it is. A small business that already uses Google Sheets for orders gets an AI assistant on top of their existing data, with zero database migration, zero new software to learn, and zero AI costs. They just ask questions and get answers.

If you want to take it further, the next step is connecting it to WhatsApp or Telegram so customers can query their own order status directly — without needing access to your internal n8n instance at all.