> ## Documentation Index
> Fetch the complete documentation index at: https://docs.herogpu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 🛍️ Build an Order-Support Chatbot with n8n and the ZeroGPU Chat Model

> Build ShopBot in n8n: an AI Agent on the ZeroGPU Chat Model that answers order questions, calls an order-lookup tool on its own, and remembers the conversation, replying in 1 to 4 seconds for about a tenth of a cent per conversation.

This notebook demonstrates how to build an order-support chatbot in n8n with the ZeroGPU Chat Model as its brain. You'll build ShopBot, the support assistant for a small online shop called Northwind Store. Customers ask where their order is, and an n8n AI Agent running on DeepSeek V4.1 Flash decides on its own when to call an order-lookup tool, answers from the result and the store's policies, and remembers the conversation so follow-up questions just work. By combining n8n and herogpu, this notebook walks you through a practical pattern for taking "Where is my order?" messages off a support team's plate, with each reply in 1 to 4 seconds and a whole conversation for about a tenth of a cent.

For the full reference, see the [n8n integration guide](https://docs.herogpu.com/integrations/n8n.md). Just want the workflow? Copy it from the **📥 Copy the Workflow** section below and paste it into n8n.

In this notebook, you'll explore:

* **n8n**: A fair-code workflow automation platform with a visual canvas, hundreds of built-in integrations, and AI nodes for agents, memory, and tools. Here it runs the chat, the AI Agent, its conversation memory, and the order-lookup tool.
* **Herogpu**: A compute-efficient inference provider for apps and agents. We run purpose-built small and nano language models across an edge network for the high-volume tasks you run constantly - classification, extraction, moderation, routing, summarization - at \~10x lower latency and 50%+ lower cost than frontier-model workflows. Auto-scaling, with zero GPU infrastructure to manage. Plug in and you're live.
* **ZeroGPU nodes for n8n**: The official community node package, `@zerogpu/n8n-nodes-zerogpu`, which adds a ZeroGPU Chat Model, ZeroGPU Embeddings, and a ZeroGPU node to n8n. Here the ZeroGPU Chat Model is the agent's brain, running DeepSeek V4.1 Flash.

This setup not only demonstrates a practical application of tool-calling chat agents on a low-cost model, but also provides a flexible framework that can be adapted to other real-world scenarios requiring conversational assistants that look up live data and follow your business rules.

## 🎥 Watch the Video Guide

If you prefer a visual walkthrough, check out the accompanying video guide below:

[YouTube video player](https://www.youtube.com/embed/9Es7FwDEV9s)

## 📥 Copy the Workflow

Want to skip the build? The finished workflow from the video, exported from n8n, is in its own file. It includes the blue note from the canvas in the video.

> [card] [n8n-shopbot-order-support.json](https://raw.githubusercontent.com/zerogpu/docs/main/cookbook/workflows/n8n-shopbot-order-support.json)
>
> Open the workflow as raw JSON on its own page.

Bring it into n8n in any of three ways:

* **Paste it.** Open the link, select everything and copy it (**Cmd + A**, then **Cmd + C** on a Mac, or **Ctrl + A**, then **Ctrl + C** elsewhere). Then click an empty spot on a new workflow's canvas and paste.
* **Import from URL.** In a new workflow, open the **...** menu at the top right, choose **Import from URL**, and paste the link.
* **Import from File.** Save the page as `n8n-shopbot-order-support.json`, then choose **Import from File** in the same menu.

Before you run it, install the ZeroGPU nodes and create your credential, as described in the next two sections. Then double-click **ZeroGPU Chat Model** and select your credential. The export leaves credentials out, so no API key travels with it. It also has no `model` field on the ZeroGPU nodes, because n8n leaves default values out of exported workflows, so the ZeroGPU Chat Model runs on its default, `deepseek-v4.1-flash`. To see how every node is set up and why, follow **Building ShopBot with n8n** below.

## 📦 Installation

First, you need a self-hosted n8n instance where you're the owner or an admin. If you don't have one yet, start n8n locally with Node.js 20.19 to 24.x, then open [http://localhost:5678](http://localhost:5678):

```bash theme={null}
npx n8n
```

Next, install the herogpu community nodes. In n8n, go to **Settings** > **Community Nodes** and select **Install**. Enter the package name below, check **I understand the risks of installing unverified code from a public source**, and select **Install**:

```
@zerogpu/n8n-nodes-zerogpu
```

Search for `ZeroGPU` in the nodes panel to confirm the install. You'll see three nodes: **ZeroGPU**, **ZeroGPU Chat Model**, and **ZeroGPU Embeddings**. If n8n runs in queue mode, or you'd rather install from a shell, follow the manual steps in the [n8n integration guide](https://docs.herogpu.com/integrations/n8n.md#install-the-zerogpu-nodes).

Everything else in this cookbook is built into n8n: the Chat Trigger, the AI Agent, Simple Memory, and the Code Tool.

## 🔑 Setting Up API Keys

You'll need to set up your API key for herogpu. This ensures that n8n can reach herogpu's models securely.

You can go to [here](https://platform.herogpu.com/dashboard) to get an API key from herogpu. The key starts with `zgpu-api-`.

n8n keeps API keys in encrypted credentials, so you paste the key once and pick it on every ZeroGPU node:

1. Open **Credentials**, create a new credential, and search for **ZeroGPU API**.
2. Paste your key into **API Key** and save. n8n checks the key against an endpoint that needs authentication, without running any inference.

In the video, the credential is called **ZeroGPU API - test key**. Name yours anything you like; you'll select it on the ZeroGPU Chat Model in a moment. The key stays masked in the credential form.

## 🔌 Access Chat with herogpu

Herogpu is a compute-efficient inference provider for apps and agents. We run purpose-built small and nano language models across an edge network for the high-volume tasks you run constantly - classification, extraction, moderation, routing, summarization - at \~10x lower latency and 50%+ lower cost than frontier-model workflows. Auto-scaling, with zero GPU infrastructure to manage. Plug in and you're live. In this section, we will connect the ZeroGPU Chat Model to an n8n AI Agent and ask it one question as an example.

Create a new workflow, click an empty spot on the canvas, and paste this (**Cmd + V** on a Mac, **Ctrl + V** elsewhere). It's a chat, an AI Agent on the ZeroGPU Chat Model, and n8n's built-in Calculator as a tool:

```json Paste onto the canvas theme={null}
{
  "nodes": [
    { "name": "When chat message received", "type": "@n8n/n8n-nodes-langchain.chatTrigger", "typeVersion": 1.1, "position": [0, 0], "parameters": { "options": {} } },
    { "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "typeVersion": 3.1, "position": [256, 0], "parameters": { "options": {} } },
    { "name": "ZeroGPU Chat Model", "type": "@zerogpu/n8n-nodes-zerogpu.zeroGpuChatModel", "typeVersion": 1, "position": [160, 240], "parameters": { "model": "deepseek-v4.1-flash", "options": {} } },
    { "name": "Calculator", "type": "@n8n/n8n-nodes-langchain.toolCalculator", "typeVersion": 1, "position": [400, 240], "parameters": {} }
  ],
  "connections": {
    "When chat message received": { "main": [[{ "node": "AI Agent", "type": "main", "index": 0 }]] },
    "ZeroGPU Chat Model": { "ai_languageModel": [[{ "node": "AI Agent", "type": "ai_languageModel", "index": 0 }]] },
    "Calculator": { "ai_tool": [[{ "node": "AI Agent", "type": "ai_tool", "index": 0 }]] }
  }
}
```

Double-click **ZeroGPU Chat Model** and select your credential. **Model Name or ID** already reads `deepseek-v4.1-flash`, the node's default. Open the model list to see every herogpu chat model; it loads live from herogpu's catalog, so new models appear without updating the package. Close the panel, click **Open chat** at the bottom of the canvas, and send:

```text theme={null}
What is 23 times 47?
```

```
23 times 47 is 1,081.
```

The **Logs** panel on the right of the chat shows what happened: **ZeroGPU Chat Model** decided to call **Calculator**, then wrote the answer from its result, each step with its time and token count.

🎉 **herogpu effortlessly powers n8n's AI Agent through the ZeroGPU Chat Model, providing a fast, low-cost brain for AI integration!**

## 🛍️ Building ShopBot with n8n

*This section builds ShopBot node by node: a chat, an AI Agent with the store's policies, conversation memory, and an order-lookup tool. Every model call behind it runs on herogpu.*

When you're done, the canvas looks like this:

```
Customer chat ──▶ AI Agent
                    ├─ Chat Model:  ZeroGPU Chat Model (deepseek-v4.1-flash)
                    ├─ Memory:      Simple Memory (last 8 interactions)
                    └─ Tool:        Order lookup (lookup_order)
```

You can build it step by step below, or copy the finished workflow from the **📥 Copy the Workflow** section near the top of this page.

### Step 1: Add the chat trigger

Create a new workflow and add a **Chat Trigger** (**When chat message received**). Rename it **Customer chat**. Leave its options as they are: the chat runs in the editor's chat panel, which is all you need while you build. Turn on **Make Chat Publicly Available** later if you want a hosted chat page for real customers.

### Step 2: Add the AI Agent and its instructions

Add an **AI Agent** after the trigger. Open it, add the **System Message** option, and paste ShopBot's instructions:

```text System message theme={null}
You are ShopBot, the friendly support assistant for Northwind Store. Whenever a customer mentions an order number (format NW-#####), call the lookup_order tool and answer from its result. Store policies: free returns within 30 days of delivery, refunds reach the original payment method in 5-7 business days, standard shipping takes 3-5 business days. Keep answers short, warm and specific.
```

The instructions do two jobs. They tell the agent when to use the tool (whenever it sees an order number), and they carry the store's policies, so questions about returns, refunds, and shipping are answered without any tool call at all.

### Step 3: Connect the ZeroGPU Chat Model

Under the agent's **Chat Model** input, click **+**, choose **ZeroGPU Chat Model**, and select your credential. Keep **Model Name or ID** on `deepseek-v4.1-flash`: it called the lookup tool reliably in every test, at \$0.30 per 1M input tokens and \$1.20 per 1M output tokens.

The model list comes live from herogpu and includes a few models that can't call tools, which an agent needs. `LFM2.5-1.2B-Instruct`, for example, stops the agent with `Tool calling is not supported for model`. For other models that work, see the [Chat Model table](https://docs.herogpu.com/integrations/n8n.md#zerogpu-chat-model) in the integration guide.

### Step 4: Give ShopBot a memory

Under the agent's **Memory** input, click **+** and choose **Simple Memory**. Set **Context Window Length** to `8`, so the agent remembers the last eight interactions of the conversation. That's what lets a customer say "them" in the second message and have ShopBot know which order they mean.

Each chat session gets its own memory. Reloading the editor starts a new session, so ShopBot forgets the previous conversation, which is handy for a clean retake.

### Step 5: Add the order-lookup tool

Under the agent's **Tool** input, click **+** and choose **Code Tool**. Set **Name** to `lookup_order` and **Description** to:

```text Description theme={null}
Look up the live status of a Northwind Store order. Input: the order number, like NW-10421.
```

Leave **Language** on JavaScript and paste this code. Then rename the node **Order lookup**:

```javascript Order lookup theme={null}
const orders = {
  'NW-10421': { status: 'Shipped', item: 'Wireless earbuds', carrier: 'BlueDart', eta: '27 Nov 2026' },
  'NW-10422': { status: 'Processing', item: 'Running shoes (UK 9)', eta: 'Ships in 1-2 days' },
  'NW-10423': { status: 'Delivered', item: 'Coffee grinder', deliveredOn: '20 Nov 2026' },
};
const id = (String(query).match(/NW-\d{5}/i) || [''])[0].toUpperCase();
return orders[id] ? JSON.stringify({ order: id, ...orders[id] }) : `No order found for "${query}". Order numbers look like NW-10421.`;
```

The agent passes its input in `query`. The code pulls the first order number out of it, in any letter case, and returns the order as a JSON string, or a short "No order found" message the agent can relay. When the agent looks up NW-10421, the tool returns:

```json theme={null}
{"order":"NW-10421","status":"Shipped","item":"Wireless earbuds","carrier":"BlueDart","eta":"27 Nov 2026"}
```

The three orders are sample data, so the demo runs with no store behind it. For real customers, replace the Code Tool with an **HTTP Request** tool that calls your order API, or a database tool, and keep the same name and description.

### Step 6: Or import the finished workflow

Prefer to skip the clicking? Copy the finished workflow from the **📥 Copy the Workflow** section near the top of this page, paste it onto an empty canvas, and select your credential on **ZeroGPU Chat Model**. Save the workflow.

### Step 7: Chat with ShopBot

Click **Fit view** (the first button at the bottom left of the canvas) so every node is in view, then click **Open chat**. Send these three messages one at a time, waiting for each reply.

First, an order question:

```text theme={null}
Hi! Where is my order NW-10421?
```

```
Hi there! 😊 Your order NW-10421 (wireless earbuds) has shipped with BlueDart and is estimated to arrive on 27 Nov 2026.
```

Watch the **Logs** panel while it answers: **AI Agent**, then **ZeroGPU Chat Model**, **Order lookup**, and **ZeroGPU Chat Model** again. The agent called the tool on its own, read the result, and wrote the reply. Now a follow-up that never names the order:

```text theme={null}
Can I return them if I don't like them?
```

```
Absolutely! You can return the earbuds for free within 30 days of delivery. Once we receive them, your refund will reach your original payment method in 5-7 business days.
```

This time **Order lookup** doesn't run. ShopBot knew "them" meant the earbuds from its memory and answered from the policies in its instructions. Last, a second order:

```text theme={null}
And my other order, NW-10422?
```

```
Your order NW-10422 (running shoes, UK 9) is still being processed and will ship in 1-2 days.
```

**Order lookup** runs again for this one. The wording of the replies changes a little from run to run, but the facts don't: they come from the tool and the policies. In both full takes of this conversation for the video, the agent called the tool for the first and third messages and skipped it for the second.

### Step 8: Check the speed and the cost

Click a **ZeroGPU Chat Model** row in the **Logs** panel to see that call's duration and token counts. In testing, every reply came back in 1.1 to 3.6 seconds, including the ones with a tool call. A whole three-message conversation used about 2,800 input tokens and 250 output tokens on DeepSeek V4.1 Flash:

```
input   ~2,800 tokens x $0.30/1M  ≈ $0.00085
output    ~250 tokens x $1.20/1M  ≈ $0.00030
                  per conversation ≈ $0.0012
```

That's about a tenth of a cent per conversation, or roughly \$1.20 for a thousand of them.

### Step 9: Try the edges (optional)

A few more things to try in the same chat:

```
What about NW-10423?   →  delivered on 20 Nov 2026 (the coffee grinder)
Where is NW-99999?      →  the tool finds no order, and ShopBot asks you to check the number
```

If you open **ZeroGPU Chat Model** and switch to a model that can't call tools, such as `LFM2.5-1.2B-Instruct`, the next message stops with `Tool calling is not supported for model`. Switch back to `deepseek-v4.1-flash`, or try another tool-capable model like `gpt-6-luna` and compare the replies in **Logs**.

🎉 In a handful of nodes, you built ShopBot: an n8n AI Agent on the ZeroGPU Chat Model that looks up orders on its own, follows your store's policies, and remembers the conversation, replying in 1 to 4 seconds for about a tenth of a cent per conversation. Swap the sample orders for your real order API and it's ready for customers.

## 🌟 Highlights

This notebook has guided you through setting up and running an n8n workflow with herogpu for an order-support chatbot. You can adapt and expand this example for various other scenarios requiring conversational assistants that look up live data and follow your business rules.

Key tools utilized in this notebook include:

* **n8n**: A fair-code workflow automation platform with a visual canvas, hundreds of built-in integrations, and AI nodes for agents, memory, and tools. Here it runs the chat, the AI Agent, its conversation memory, and the order-lookup tool.
* **Herogpu**: A compute-efficient inference provider for apps and agents. We run purpose-built small and nano language models across an edge network for the high-volume tasks you run constantly - classification, extraction, moderation, routing, summarization - at \~10x lower latency and 50%+ lower cost than frontier-model workflows. Auto-scaling, with zero GPU infrastructure to manage. Plug in and you're live.
* **ZeroGPU nodes for n8n**: The official community node package, `@zerogpu/n8n-nodes-zerogpu`, which adds a ZeroGPU Chat Model, ZeroGPU Embeddings, and a ZeroGPU node to n8n. Here the ZeroGPU Chat Model is the agent's brain, running DeepSeek V4.1 Flash.

This comprehensive setup allows you to adapt and expand the example for various scenarios requiring conversational assistants that look up live data and follow your business rules.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.