- n8n: A fair-code workflow automation platform with a visual canvas, hundreds of built-in integrations, and AI nodes for agents, memory, vector stores, and tools. Here it loads the handbook into a vector store and runs the chat and the AI Agent that searches it.
- 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 ZeroGPU Embeddings turns the handbook and every question into vectors, and the ZeroGPU Chat Model writes the answers.
🎥 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-hr-policy-assistant.json
Open the workflow as raw JSON on its own page.
- 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-hr-policy-assistant.json, then choose Import from File in the same menu.
model field on the ZeroGPU nodes, because n8n leaves default values out of exported workflows, so both embeddings nodes run on all-minilm-l6-v2 and the chat model on deepseek-v4.1-flash. Then click Execute workflow once to load the handbook before you open the chat. To see how every node is set up and why, follow Building the HR Policy Assistant 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: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.
The vector store in this cookbook is n8n’s built-in Simple Vector Store, which keeps vectors in n8n’s memory, so there’s no database to set up.
🔑 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 withzgpu-api-.
n8n keeps API keys in encrypted credentials, so you paste the key once and pick it on every ZeroGPU node:
- Open Credentials, create a new credential, and search for ZeroGPU API.
- Paste your key into API Key and save. n8n checks the key against an endpoint that needs authentication, without running any inference.
🔢 Access Embeddings 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 turn one sentence into a vector with the ZeroGPU node 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 manual trigger and one ZeroGPU node set to Embedding > Embed Text:Paste onto the canvas
all-minilm-l6-v2 costs $0.004 per 1M input tokens, so those 18 tokens cost a tiny fraction of a cent. In the RAG workflow below, you won’t call Embed Text yourself: the ZeroGPU Embeddings node plugs into the vector store and embeds every document and question for you.
🎉 herogpu effortlessly turns text into 384-dimensional vectors, providing fast, near-free embeddings for AI integration!
📚 Building the HR Policy Assistant with n8n
This section builds two flows on one canvas: one that embeds the handbook into a vector store, and one where an AI Agent searches it to answer questions. Every embedding and model call behind them runs on herogpu. When you’re done, the canvas looks like this:Step 1: Write the handbook
Create a new workflow and add a Manual Trigger (When clicking ‘Execute workflow’). After it, add a Code node, rename it Employee handbook, and paste this code. It returns the handbook as seven items, one per policy section:Employee handbook
all-minilm-l6-v2 reads. Northwind Labs and its handbook are made up for this demo. For your own handbook, you could load a file from Google Drive or a URL instead, and read PDFs with the ZeroGPU node’s Extract Text operation.
Step 2: Store the handbook in a vector store
Add a Simple Vector Store after Employee handbook and rename it Store handbook in vector store. Set:Step 3: Connect ZeroGPU Embeddings and a data loader
The vector store has two inputs underneath it. Under Embedding, click +, choose ZeroGPU Embeddings, and select your credential. Keep Model Name or ID onall-minilm-l6-v2, the node’s default, which returns 384-dimensional vectors for $0.004 per 1M tokens.
Under Document, click + and choose Default Data Loader. Set Type of Data to JSON, Mode to Load Specific Data, and Data to this expression, so each handbook section becomes one document:
Data
Step 4: Load the handbook
Click Execute workflow at the bottom of the canvas. The flow finishes in about 2 seconds (1.2 to 2.0 in testing), and Store handbook in vector store shows 7 items: one stored document per policy. Open ZeroGPU Embeddings to see the call it made, with the sevendocuments going in and seven vectors coming back.
The whole handbook is about 1,200 characters, roughly 300 tokens, so embedding it costs about $0.0000012. Run this step again whenever the handbook changes. The Simple Vector Store keeps its data in n8n’s memory, so it’s also empty after n8n restarts, and the assistant would say the handbook doesn’t cover anything until you load it again.
Step 5: Add the chat and the AI Agent
Now the second flow. Add a Chat Trigger (When chat message received) and rename it Employee question. Add an AI Agent after it, open it, add the System Message option, and paste:System message
Step 6: Connect the ZeroGPU Chat Model and Simple Memory
Under the agent’s Chat Model input, click +, choose ZeroGPU Chat Model, and select your credential. Keep Model Name or ID ondeepseek-v4.1-flash, at $0.30 per 1M input tokens and $1.20 per 1M output tokens. Under Memory, click +, choose Simple Memory, and set Context Window Length to 8, so employees can ask follow-ups like “And for sick leave?”
Step 7: Give the agent the handbook as a search tool
Under the agent’s Tool input, click + and choose Simple Vector Store. Rename it HR handbook and set:
Then, under HR handbook’s own Embedding input, click +, choose ZeroGPU Embeddings, select your credential, keep
all-minilm-l6-v2, and rename it ZeroGPU Embeddings (search). It turns each question into a vector to compare against the stored ones. It must use the same model as the node that stored the handbook: vectors from a different model wouldn’t match.
Step 8: 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 Embeddings, ZeroGPU Chat Model, and ZeroGPU Embeddings (search). Save the workflow, then click Execute workflow once to load the handbook, as in Step 4.Step 9: Ask the HR assistant
Click Fit view (the first button at the bottom left of the canvas), then Open chat. Ask these four questions one at a time. First, a question with a number in the answer:Step 10: Check the speed and the cost
Click the rows in Logs to see each step’s time and tokens. In testing, each answer took about 3 seconds (2.8 to 3.5), with one handbook search per question, and four answers together cost about $0.004, about a tenth of a cent each. Almost all of that is the chat model. The embeddings round to zero: each question is a dozen or so tokens at $0.004 per 1M, and the whole handbook cost about $0.0000012 to index.Step 11: Take it to production (optional)
The Simple Vector Store is perfect for a demo, but it lives in n8n’s memory: it’s empty after a restart, and its memory keys are shared across the whole n8n instance. For production, swap both Simple Vector Store nodes for a persistent store such as Pinecone, Supabase, Qdrant, or PGVector, create the index with 384 dimensions to matchall-minilm-l6-v2, and keep ZeroGPU Embeddings on both the insert and search side. If your n8n runs in queue mode, replace Simple Memory with a database-backed memory, since n8n’s docs say Simple Memory doesn’t work in that mode. Then turn on Make Chat Publicly Available on Employee question to give employees their own chat page.
🎉 You built an HR assistant that answers from your own handbook: ZeroGPU Embeddings indexed seven policies in about 2 seconds, and an AI Agent on the ZeroGPU Chat Model searched them before every answer, quoted the exact numbers, and admitted when the handbook was silent, for about a tenth of a cent per answer.
🌟 Highlights
This notebook has guided you through setting up and running an n8n workflow with herogpu for an HR policy assistant built on retrieval-augmented generation. You can adapt and expand this example for various other scenarios requiring assistants that answer only from your own policies, manuals, and knowledge bases. 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, vector stores, and tools. Here it loads the handbook into a vector store and runs the chat and the AI Agent that searches it.
- 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 ZeroGPU Embeddings turns the handbook and every question into vectors, and the ZeroGPU Chat Model writes the answers.

