# How to build an AI Agent That Categorizes Business Expenses: step-by-step guide with screenshots

> Build an AI Agent That Categorizes Business Expenses in n8n, in 69 steps with a screenshot of each one. A free how-to guide, plus a free hands-on…

Source: https://learn.ynteractive.com/content/n8n-ai-agent-categorize-business-expenses-google-sheets/guide · Updated 2026-10-02 · Free from Stepthrough (https://learn.ynteractive.com)

Updated October 2, 2026

Build an AI agent for Maple Street Bookkeeping that sorts business expenses into categories, writes a short note for each and saves them to Google Sheets — chat trigger, AI Agent, system prompt, model, memory, and the Sheets tool.

**About the screenshots.** They come from Stepthrough’s simulated practice environment (a practice copy of n8n), not the live tool, so no real account appears. The buttons and labels match the real screens the lesson was built against. Practice it yourself free at learn.ynteractive.com.

## How do you want to learn?

- [Practice it step by step: Interactive, in a practice copy of n8n, about 12 min](https://learn.ynteractive.com/modules/n8n-ai-agent-finance)
- [Read the guide: 69 steps with screenshots](https://learn.ynteractive.com/content/n8n-ai-agent-categorize-business-expenses-google-sheets/guide)

Lesson overview: [Build an AI Agent That Categorizes Business Expenses](https://learn.ynteractive.com/content/n8n-ai-agent-categorize-business-expenses-google-sheets)

- Tools: n8n
- Time: about 12 minutes, 69 steps in 12 parts
- Level: beginner, no coding needed

## Part 1: Get n8n

### Step 1: Go to n8n.io

In the last lesson you built a Custom GPT that writes payment reminders. That is great for one person. But what if the AI sorted every expense into a category and saved it to a spreadsheet you can review? That is what we are building now. First, you need an n8n account.

![The n8n.io website in Stepthrough’s practice copy, step 1 of 69 (Go to n8n.io): the cursor is on “n8n.io”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-01.webp)

**Step 1 of 69.** Start at **n8n.io**. Click **Get started free**.

### Step 2: Enter your email

This is just practice, so anything works — it won't actually send anything.

![The n8n sign-up form in Stepthrough’s practice copy, step 2 of 69 (Enter your email): the email is filled in (“me@example.com”).](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-02.webp)

**Step 2 of 69.** Type any email address — this is practice, so a fake one is fine.

### Step 3: Sign up

In the real n8n, it sends you a six digit code, then asks for a name, a password, and an account name. Go do that in your own browser later, then come back and we will build.

![The n8n sign-up form in Stepthrough’s practice copy, step 3 of 69 (Sign up): the cursor is on “Continue”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-03.webp)

**Step 3 of 69.** Click **Continue**. n8n emails you a code, then asks for a name and password — do that part on your own and come back here.

## Part 2: API key

### Step 4: Add credit first

Your agent needs a brain, and that means an API key from OpenAI. Go to platform dot openai dot com — that is the developer side, not ChatGPT, and it bills completely separately. Before you make a key, put some money on the account. A brand new key with a zero balance just returns errors.

![The OpenAI platform billing page in Stepthrough’s practice copy, step 4 of 69 (Add credit first): the cursor is on “platform.openai.com → Billing”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-04.webp)

**Step 4 of 69.** Your agent needs a model to think with. At **platform.openai.com → Billing**, click **Add to credit balance** — a key with no credit behind it just errors.

### Step 5: Ten dollars is plenty

Ten dollars goes a very long way. You are charged per request, not per month, and each batch of expenses costs fractions of a cent.

![The OpenAI platform billing page in Stepthrough’s practice copy, step 5 of 69 (Ten dollars is plenty): the cursor is on “Continue”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-05.webp)

**Step 5 of 69.** Ten dollars goes a long way — you pay per request, not per month. Click **Continue**. In your own account you add a card here.

### Step 6: Now the key

Balance sorted. Now go to API keys in the left menu.

![The OpenAI platform billing page in Stepthrough’s practice copy, step 6 of 69 (Now the key): the cursor is on “API Keys”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-06.webp)

**Step 6 of 69.** Balance sorted. Click **API Keys** in the left menu.

### Step 7: Create a secret key

![The OpenAI API keys page in Stepthrough’s practice copy, step 7 of 69 (Create a secret key): the cursor is on “+ Create new secret key”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-07.webp)

**Step 7 of 69.** Click **+ Create new secret key**.

### Step 8: Name the key

Name it after whatever is going to use it. Future you, staring at a list of forty keys, will thank you. I am calling this one n8n agent.

![The OpenAI API keys page in Stepthrough’s practice copy, step 8 of 69 (Name the key): the n8n agent is filled in (“n8n agent”).](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-08.webp)

**Step 8 of 69.** Name it after what will use it. Type **n8n agent**.

### Step 9: Create it

Default project, all permissions — that is fine for this. Create the key.

![The OpenAI API keys page in Stepthrough’s practice copy, step 9 of 69 (Create it): the cursor is on “Create secret key”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-09.webp)

**Step 9 of 69.** Leave Project and Permissions alone and click **Create secret key**.

### Step 10: Copy it now

Now pay attention, because this is the only time you will ever see this key. Copy it and paste it into n8n, or into your password manager. If you lose it, you do not get it back — you delete it and make another.

![The OpenAI API keys page in Stepthrough’s practice copy, step 10 of 69 (Copy it now): the cursor is on “Copy”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-10.webp)

**Step 10 of 69.** This is the only time OpenAI shows you the key. Click **Copy**, then paste it somewhere safe.

### Step 11: Back to n8n

One last warning — this key can spend your money. Never commit it to code, never paste it into a chat, and if it ever shows up on screen while you are recording, revoke it before you publish.

![The OpenAI API keys page in Stepthrough’s practice copy, step 11 of 69 (Back to n8n): the cursor is on “Done”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-11.webp)

**Step 11 of 69.** Click **Done**. Treat that key like a password — never paste it into a chat, a repo, or a screen recording.

## Part 3: New workflow

### Step 12: Start a new workflow

Now you are inside n8n. This overview page lists every workflow you have. Top right, click create workflow, and you land on an empty canvas.

![The n8n overview page in Stepthrough’s practice copy, step 12 of 69 (Start a new workflow): the cursor is on “Create workflow”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-12.webp)

**Step 12 of 69.** This is your n8n home. Click **Create workflow** in the top right.

## Part 4: Chat trigger

### Step 13: Add the first step

Every workflow needs a trigger — the thing that kicks it off. We want a chat trigger so you can hand the agent a batch of expenses.

![The n8n workflow canvas in Stepthrough’s practice copy, step 13 of 69 (Add the first step): the cursor is on “Add first step…”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-13.webp)

**Step 13 of 69.** Every workflow starts with a trigger. Click **Add first step…**

### Step 14: Trigger on a chat message

A panel slides in with every way a workflow can start — manually, on a schedule, on a webhook. We want on chat message, so we can have a conversation with the agent.

![The n8n node list in Stepthrough’s practice copy, step 14 of 69 (Trigger on a chat message): the cursor is on “On chat message”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-14.webp)

**Step 14 of 69.** The trigger panel opened on the right. Pick **On chat message** near the bottom.

### Step 15: Back to the canvas

n8n opens the node so you can configure it. There is nothing we need to change here, so close it with the X in the top right and get back to the canvas.

![An n8n node’s settings window in Stepthrough’s practice copy, step 15 of 69 (Back to the canvas): the cursor is on “×”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-15.webp)

**Step 15 of 69.** n8n opens the node so you can configure it. Nothing to change here — click the **×** in the top right.

## Part 5: AI Agent

### Step 16: Add the next node

Now we decide what happens when a message comes in.

![The n8n workflow canvas in Stepthrough’s practice copy, step 16 of 69 (Add the next node): the cursor is on “+”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-16.webp)

**Step 16 of 69.** Click the **+** on the right edge of the trigger node.

### Step 17: Add the AI Agent

There it is — AI Agent. This is the piece that can plan and then carry out actions using whatever tools you give it. You give it a batch of expenses, and it can categorize them and save them to a spreadsheet — all in one step.

![The n8n node list in Stepthrough’s practice copy, step 17 of 69 (Add the AI Agent): the cursor is on “AI Agent”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-17.webp)

**Step 17 of 69.** Click **AI Agent** — it makes a plan and carries it out using the tools you give it.

## Part 6: System prompt

### Step 18: Open the options

Right now this agent has no personality and no orders. It does not know it works for Maple Street Bookkeeping.

![An n8n node’s settings window in Stepthrough’s practice copy, step 18 of 69 (Open the options): the cursor is on “+ Add Option”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-18.webp)

**Step 18 of 69.** The agent has no personality yet. Click **+ Add Option** under Options.

### Step 19: Add a system message

Pick system message. This is the standing instruction the agent reads before every request. It is where we tell it who Maple Street is, which categories to use, and how to format each expense.

![A dropdown menu in n8n in Stepthrough’s practice copy, step 19 of 69 (Add a system message): the cursor is on “System Message”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-19.webp)

**Step 19 of 69.** Choose **System Message**. This is the standing instruction the agent follows every time.

### Step 20: Write the system prompt

Here is the actual prompt. It describes Maple Street Bookkeeping, lists the only categories allowed, and tells the agent what to return: date, vendor, amount, category, and a note. Anything unclear goes to needs review. It also tells the agent to use the Google Sheets tool when you ask it to save.

![An n8n node’s settings window in Stepthrough’s practice copy, step 20 of 69 (Write the system prompt): the system prompt is filled in (“You are the expense categorizing assistant for…”).](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-20.webp)

**Step 20 of 69.** This is the standing instruction. It is long, so just Paste in the system prompt on the box.

```text
You are the expense categorizing assistant for Maple Street Bookkeeping.

Maple Street Bookkeeping is a small bookkeeping firm. It keeps the books for about 60 small businesses and for itself.

The audience is the bookkeeper who reviews every entry before it is posted.

The tone should be plain, brief and factual.

Your job is to sort each expense the user gives you into one category and write a short note about it.

Use only these categories:
- Office Supplies
- Software & Subscriptions
- Meals
- Travel
- Utilities
- Needs Review

For each expense, return:
- Date
- Vendor
- Amount
- Category
- Note (one sentence: what it was for, and anything the bookkeeper should check, like a missing receipt)

If an expense could fit more than one category, or the details are unclear, use Needs Review and say why.

When the user asks you to save the expenses, use the Google Sheets tool to store each one.

Do not give tax advice. Do not change amounts or invent details.
```

### Step 21: Back to the canvas

That gives the agent everything it needs to know about Maple Street. Close the node.

![An n8n node’s settings window in Stepthrough’s practice copy, step 21 of 69 (Back to the canvas): the cursor is on “×”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-21.webp)

**Step 21 of 69.** That tells the agent who it works for and how to categorize expenses. Close the node with the **×**.

## Part 7: Chat model

### Step 22: Give the agent a brain

See that red triangle on the agent? It is complaining because it has no model. An agent can plan, but it cannot think without a language model underneath it.

![The n8n workflow canvas in Stepthrough’s practice copy, step 22 of 69 (Give the agent a brain): the cursor is on “+”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-22.webp)

**Step 22 of 69.** The agent has a red warning: it has no model. Click the **+** under **Chat Model**.

### Step 23: Pick OpenAI

OpenAI chat model. This is where that API key finally gets used.

![The n8n node list in Stepthrough’s practice copy, step 23 of 69 (Pick OpenAI): the cursor is on “OpenAI Chat Model”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-23.webp)

**Step 23 of 69.** Click **OpenAI Chat Model**.

### Step 24: Open the credentials

And here is where that key you copied finally goes.

![An n8n node’s settings window in Stepthrough’s practice copy, step 24 of 69 (Open the credentials): the cursor is on “Credential to connect with”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-24.webp)

**Step 24 of 69.** Here is where that key goes. Click the **Credential to connect with** dropdown.

### Step 25: Create a new credential

You want create new credential, right at the bottom.

![A dropdown menu in n8n in Stepthrough’s practice copy, step 25 of 69 (Create a new credential): the cursor is on “+ Create new credential”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-25.webp)

**Step 25 of 69.** Click **+ Create new credential** at the bottom of the list.

### Step 26: Paste the key

This is the one moment it matters that you copied it — remember, OpenAI never shows it to you again.

![The n8n credential window in Stepthrough’s practice copy, step 26 of 69 (Paste the key): the api key is filled in (“sk-proj-EXAMPLE-not-a-real-key-0000”).](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-26.webp)

**Step 26 of 69.** Paste in the API key on the field to drop in the key you copied from OpenAI.

### Step 27: Save the credential

n8n tests the connection straight away, and from now on this credential is available to every node in every workflow — you only do this once.

![The n8n credential window in Stepthrough’s practice copy, step 27 of 69 (Save the credential): the cursor is on “Save”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-27.webp)

**Step 27 of 69.** Click **Save**. n8n tests the connection and stores the key for every future node.

### Step 28: Open the model list

Now the model dropdown.

![An n8n node’s settings window in Stepthrough’s practice copy, step 28 of 69 (Open the model list): the cursor is on “Model”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-28.webp)

**Step 28 of 69.** Now click the **Model** dropdown.

### Step 29: Choose the model

GPT five mini. Fast, cheap, and plenty for sorting expenses. Do not reach for the expensive model until you have a reason.

![A dropdown menu in n8n in Stepthrough’s practice copy, step 29 of 69 (Choose the model): the cursor is on “gpt-5-mini”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-29.webp)

**Step 29 of 69.** Pick **gpt-5-mini** — fast and cheap, plenty for this.

### Step 30: Back to the canvas

That is the brain wired in. Close it up.

![An n8n node’s settings window in Stepthrough’s practice copy, step 30 of 69 (Back to the canvas): the cursor is on “×”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-30.webp)

**Step 30 of 69.** The model is wired up. Close the node with the **×**.

## Part 8: Memory

### Step 31: Add memory

Next, memory. Without this, every message starts from nothing — you could not say save those expenses, because it would not remember which ones you meant.

![The n8n workflow canvas in Stepthrough’s practice copy, step 31 of 69 (Add memory): the cursor is on “+”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-31.webp)

**Step 31 of 69.** Without memory the agent forgets each message. Click the **+** under **Memory**.

### Step 32: Simple Memory

Simple memory is fine here — it keeps the recent conversation inside n8n, no database, no extra credentials.

![The n8n node list in Stepthrough’s practice copy, step 32 of 69 (Simple Memory): the cursor is on “Simple Memory”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-32.webp)

**Step 32 of 69.** Pick **Simple Memory**. It keeps the recent conversation in n8n itself.

## Part 9: Sheets tool

### Step 33: Add a tool

And now the good part — tools. This is what separates an agent from a chatbot. A chatbot just talks. An agent does things. We are going to give it Google Sheets so it can save every expense into a spreadsheet you can review.

![The n8n workflow canvas in Stepthrough’s practice copy, step 33 of 69 (Add a tool): the cursor is on “+”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-33.webp)

**Step 33 of 69.** Tools are how the agent acts on the world. Click the **+** under **Tool**.

### Step 34: Add Google Sheets

Google Sheets tool. Now the agent can write rows into a real spreadsheet, with columns matching what the system prompt tells it to return. When you say save those expenses, each one becomes a row.

![The n8n node list in Stepthrough’s practice copy, step 34 of 69 (Add Google Sheets): the cursor is on “Google Sheets Tool”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-34.webp)

**Step 34 of 69.** Click **Google Sheets Tool** — read, update and write data to Google Sheets.

## Part 10: Create the spreadsheet

### Step 35: Back to the canvas

Before we set this up, we need to actually create the spreadsheet. Close this node for now — we are going to hop over to Google Sheets and make one.

![An n8n node’s settings window in Stepthrough’s practice copy, step 35 of 69 (Back to the canvas): the cursor is on “Back to the canvas”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-35.webp)

**Step 35 of 69.** Before we configure this node, we need a spreadsheet for the agent to write to. Close the node — we will come back.

### Step 36: Open Google Sheets

Switch to Google Sheets. You need to create the spreadsheet that this node will write to.

![Google Sheets in Stepthrough’s practice copy, step 36 of 69 (Open Google Sheets): the cursor is on “Google Sheets”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-36.webp)

**Step 36 of 69.** Click the **Google Sheets** tab to create a new blank spreadsheet.

### Step 37: Name the spreadsheet

First, name it so you can find it later.

![Google Sheets in Stepthrough’s practice copy, step 37 of 69 (Name the spreadsheet): the cursor is on “Expense Log”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-37.webp)

**Step 37 of 69.** Click the title and rename it to **Expense Log**.

### Step 38: Type the first column header

Now set up the column headers. These need to match what the system prompt tells the agent to return. In A1, type Date.

![Google Sheets in Stepthrough’s practice copy, step 38 of 69 (Type the first column header): the cursor is on “A1”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-38.webp)

**Step 38 of 69.** In cell **A1**, type **Date**.

### Step 39: Vendor

B1 — Vendor.

![Google Sheets in Stepthrough’s practice copy, step 39 of 69 (Vendor): the cursor is on “B1”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-39.webp)

**Step 39 of 69.** In cell **B1**, type **Vendor**.

### Step 40: Amount

C1 — Amount.

![Google Sheets in Stepthrough’s practice copy, step 40 of 69 (Amount): the cursor is on “C1”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-40.webp)

**Step 40 of 69.** In cell **C1**, type **Amount**.

### Step 41: Category

D1 — Category.

![Google Sheets in Stepthrough’s practice copy, step 41 of 69 (Category): the cursor is on “D1”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-41.webp)

**Step 41 of 69.** In cell **D1**, type **Category**.

### Step 42: Note

And E1 — Note. Five columns, matching exactly what the system prompt tells the agent to return. Each expense becomes a row in this sheet.

![Google Sheets in Stepthrough’s practice copy, step 42 of 69 (Note): the cursor is on “E1”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-42.webp)

**Step 42 of 69.** In cell **E1**, type **Note**. That is all five columns — matching the system prompt.

### Step 43: Back to n8n

The spreadsheet is ready. Switch back to n8n and connect the Google Sheets node to it.

![Google Sheets in Stepthrough’s practice copy, step 43 of 69 (Back to n8n): the cursor is on “n8n”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-43.webp)

**Step 43 of 69.** The spreadsheet is ready. Click the **n8n** tab to go back and connect it.

### Step 44: Open the Sheets node

Double click the Google Sheets node to open it back up. Now we can connect it to the spreadsheet we just made.

![The n8n workflow canvas in Stepthrough’s practice copy, step 44 of 69 (Open the Sheets node): the cursor is on “Google Sheets”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-44.webp)

**Step 44 of 69.** Double-click the **Google Sheets** node to configure it.

## Part 11: Configure Sheets

### Step 45: Add a credential

Now we need to connect this to a real Google account.

![An n8n node’s settings window in Stepthrough’s practice copy, step 45 of 69 (Add a credential): the cursor is on “Credential”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-45.webp)

**Step 45 of 69.** The Sheets node needs a Google account. Click the **Credential** dropdown.

### Step 46: Create a new credential

Create new credential — this one uses Google OAuth instead of an API key, so it is going to open a sign-in window.

![A dropdown menu in n8n in Stepthrough’s practice copy, step 46 of 69 (Create a new credential): the cursor is on “+ Create new credential”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-46.webp)

**Step 46 of 69.** Click **+ Create new credential** to sign in with Google.

### Step 47: Sign in with Google

This opens the Google account chooser so you can pick which account to connect.

![The Google sign-in window in Stepthrough’s practice copy, step 47 of 69 (Sign in with Google): the cursor is on “Sign in with Google”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-47.webp)

**Step 47 of 69.** Click **Sign in with Google** to connect your account.

### Step 48: Choose your account

Pick the Google account you want n8n to use. This is the account that owns the spreadsheet.

![The Google sign-in window in Stepthrough’s practice copy, step 48 of 69 (Choose your account): the cursor is on “Google account”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-48.webp)

**Step 48 of 69.** Click your **Google account** to continue.

### Step 49: Allow Sheets access

Google is asking what n8n is allowed to do. Check the first box — this lets n8n read and write your spreadsheets.

![The Google sign-in window in Stepthrough’s practice copy, step 49 of 69 (Allow Sheets access): the cursor is on “See, edit, create, and delete all your Google Sheets…”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-49.webp)

**Step 49 of 69.** Google needs permission. Check **See, edit, create, and delete all your Google Sheets spreadsheets**.

### Step 50: Allow Drive access

Second box — n8n needs Drive access so it can find your spreadsheets by name.

![The Google sign-in window in Stepthrough’s practice copy, step 50 of 69 (Allow Drive access): the cursor is on “See, edit, create, and delete all of your Google Drive files”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-50.webp)

**Step 50 of 69.** Check **See, edit, create, and delete all of your Google Drive files**.

### Step 51: Allow external service

Last one — this lets Google connect to n8n as an external service. Check it.

![The Google sign-in window in Stepthrough’s practice copy, step 51 of 69 (Allow external service): the cursor is on “Connect to an external service”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-51.webp)

**Step 51 of 69.** Check **Connect to an external service**.

### Step 52: Sign in

All three checked.

![The Google sign-in window in Stepthrough’s practice copy, step 52 of 69 (Sign in): the cursor is on “Continue”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-52.webp)

**Step 52 of 69.** All three are checked. Click **Continue** to complete the Google sign-in.

### Step 53: Pick the operation

Now we tell the node what to do. By default it reads rows, but we want to add rows.

![An n8n node’s settings window in Stepthrough’s practice copy, step 53 of 69 (Pick the operation): the cursor is on “Operation”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-53.webp)

**Step 53 of 69.** Now tell n8n what to do with the sheet. Click the **Operation** dropdown.

### Step 54: Append Row

Append row. Every expense the agent sorts gets added as a new row at the bottom of the sheet.

![A dropdown menu in n8n in Stepthrough’s practice copy, step 54 of 69 (Append Row): the cursor is on “Append Row”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-54.webp)

**Step 54 of 69.** Pick **Append Row** — the agent will add a new row for each expense.

### Step 55: Choose the spreadsheet

Now pick the spreadsheet.

![An n8n node’s settings window in Stepthrough’s practice copy, step 55 of 69 (Choose the spreadsheet): the cursor is on “Document”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-55.webp)

**Step 55 of 69.** Click the **Document** dropdown to pick which spreadsheet to write to.

### Step 56: Expense Log

Expense Log — the sheet we set up with columns for date, vendor, amount, category, and note.

![A dropdown menu in n8n in Stepthrough’s practice copy, step 56 of 69 (Expense Log): the cursor is on “Expense Log”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-56.webp)

**Step 56 of 69.** Click **Expense Log** — the sheet we set up for Maple Street.

### Step 57: Pick the sheet tab

Now pick which tab inside that spreadsheet.

![An n8n node’s settings window in Stepthrough’s practice copy, step 57 of 69 (Pick the sheet tab): the cursor is on “Sheet”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-57.webp)

**Step 57 of 69.** Click the **Sheet** dropdown to choose which tab inside the spreadsheet.

### Step 58: Sheet1

Sheet one — it is the only tab, so this is simple.

![A dropdown menu in n8n in Stepthrough’s practice copy, step 58 of 69 (Sheet1): the cursor is on “Sheet1”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-58.webp)

**Step 58 of 69.** Click **Sheet1**.

### Step 59: Map the Date column

Now the columns. Each column has a purple button — click it and the AI agent figures out what data goes there.

![An n8n node’s settings window in Stepthrough’s practice copy, step 59 of 69 (Map the Date column): the cursor is on “Values to Send”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-59.webp)

**Step 59 of 69.** Under **Values to Send**, click the **✦** button next to **Date** — the AI agent will fill this in automatically.

### Step 60: Map the Vendor column

Vendor. Same thing — click the purple button.

![An n8n node’s settings window in Stepthrough’s practice copy, step 60 of 69 (Map the Vendor column): the cursor is on “✦”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-60.webp)

**Step 60 of 69.** Click the **✦** button next to **Vendor**.

### Step 61: Map the Amount column

Amount.

![An n8n node’s settings window in Stepthrough’s practice copy, step 61 of 69 (Map the Amount column): the cursor is on “✦”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-61.webp)

**Step 61 of 69.** Click the **✦** button next to **Amount**.

### Step 62: Map the Category column

Category.

![An n8n node’s settings window in Stepthrough’s practice copy, step 62 of 69 (Map the Category column): the cursor is on “✦”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-62.webp)

**Step 62 of 69.** Click the **✦** button next to **Category**.

### Step 63: Map the Note column

And note. Each one is now set to defined automatically by the model — the agent reads your column headers and figures out what goes where.

![An n8n node’s settings window in Stepthrough’s practice copy, step 63 of 69 (Map the Note column): the cursor is on “✦”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-63.webp)

**Step 63 of 69.** Click the **✦** button next to **Note**.

### Step 64: Back to the canvas

The sheets tool is fully wired up — credential, operation, spreadsheet, sheet, and column mapping. Close it and let us test this thing.

![An n8n node’s settings window in Stepthrough’s practice copy, step 64 of 69 (Back to the canvas): the cursor is on “×”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-64.webp)

**Step 64 of 69.** Google Sheets is fully configured. Close the node with the **×**.

## Part 12: Test the agent

### Step 65: Open the chat

Everything is connected. Time to see if it works.

![The n8n workflow editor in Stepthrough’s practice copy, step 65 of 69 (Open the chat): the cursor is on “Open chat”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-65.webp)

**Step 65 of 69.** Time to test. Click **Open chat** at the bottom of the canvas.

### Step 66: Send some expenses

Give it a batch of expenses.

![The n8n chat test panel in Stepthrough’s practice copy, step 66 of 69 (Send some expenses): the prompt is filled in (“Categorize these expenses: Sep 22, Corner…”).](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-66.webp)

**Step 66 of 69.** Type a prompt — give the agent a batch of expenses to categorize.

```text
Categorize these expenses: Sep 22, Corner Office Supply, $64.18, printer paper and toner. Sep 23, CloudLedger, $45.00, monthly accounting software. Sep 24, Harbor Street Cafe, $38.50, lunch with a client.
```

### Step 67: Send the message

Send it off. The agent reads your system prompt and sorts each expense into a category, with a short note, in the exact format you asked for.

![The n8n chat test panel in Stepthrough’s practice copy, step 67 of 69 (Send the message): the cursor is on “Send”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-67.webp)

**Step 67 of 69.** Click **Send** to talk to the agent.

### Step 68: Save to the sheet

Three expenses — office supplies, software, and a client lunch, each with a category and a short note. Now tell it to save them. This is where the Google Sheets tool kicks in.

![The n8n chat test panel in Stepthrough’s practice copy, step 68 of 69 (Save to the sheet): the prompt is filled in (“Yes, save those expenses to the sheet”).](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-68.webp)

**Step 68 of 69.** Now tell the agent to save those expenses to Google Sheets.

### Step 69: Send it

Send it. The agent uses the Google Sheets tool to write each expense as a row — date, vendor, amount, category, and note.

![The n8n chat test panel in Stepthrough’s practice copy, step 69 of 69 (Send it): the cursor is on “Send”, highlighted.](https://learn.ynteractive.com/content/guide/n8n-ai-agent-finance/step-69.webp)

**Step 69 of 69.** Click **Send** — the agent will use the Google Sheets tool to write the rows.

## Now do it yourself, free

Reading the steps is a start. Doing them is how it sticks. The interactive lesson puts you in a practice copy of n8n: you do every step yourself, it checks your work, and “Do it for me” finishes any step you get stuck on. Nothing touches your real accounts.

[Practice “Build an AI Agent That Categorizes Business Expenses” step by step](https://learn.ynteractive.com/modules/n8n-ai-agent-finance)

[Build an AI Agent That Categorizes Business Expenses: lesson overview](https://learn.ynteractive.com/content/n8n-ai-agent-categorize-business-expenses-google-sheets) · [All free tutorials](https://learn.ynteractive.com/content)
