Skip to main content
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. 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:

📥 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.

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:
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:
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. 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 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:
Paste onto the canvas
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:
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:
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:
System message
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 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:
Description
Leave Language on JavaScript and paste this code. Then rename the node Order lookup:
Order lookup
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:
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:
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:
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:
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:
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:
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.