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

# 🧰 Triage a Support Inbox with n8n and ZeroGPU Tools

> Give an n8n AI Agent four ZeroGPU Tools - Redact PII, Moderate Text, Classify by Schema, and Summarize Text - and turn any customer email into a triage card with a safety verdict, a team, a summary, and a PII-free copy to forward, in about 10 seconds for about a fifth of a cent.

This notebook demonstrates how to give an n8n AI Agent herogpu's task models as tools and use them to triage a support inbox. You'll build a copilot for a support lead: paste any customer email into the chat, and the agent strips the personal data first, then checks the redacted text for abuse, works out which team owns it, and summarizes it, returning a triage card with a safety verdict, a team, a one-line summary, and a copy that's safe to forward. Each tool is a ZeroGPU Tool backed by a small, purpose-built model, and the agent on DeepSeek V4.1 Flash decides how to use them. By combining n8n and herogpu, this notebook walks you through a practical pattern for putting fast, cheap specialist models behind an agent, with every message triaged in about 10 seconds for about a fifth 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, and the four tools it can call.
* **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, also available to agents as ZeroGPU Tool. Here the ZeroGPU Chat Model runs the agent, and four ZeroGPU Tools do the redaction, moderation, classification, and summarization.

This setup not only demonstrates a practical application of agents that delegate work to specialist models, but also provides a flexible framework that can be adapted to other real-world scenarios requiring privacy-safe triage, moderation, and routing of incoming messages.

## 🎥 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/vLwzuvyreZA)

## 📥 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 and a yellow note with a sample email to paste.

> [card] [n8n-support-inbox-copilot.json](https://raw.githubusercontent.com/zerogpu/docs/main/cookbook/workflows/n8n-support-inbox-copilot.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-support-inbox-copilot.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 each of the five ZeroGPU nodes (**ZeroGPU Chat Model**, **Moderate Text**, **Classify Team**, **Redact PII**, and **Summarize Message**) 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 every ZeroGPU node runs on its operation's default model, the ones listed in Step 7. To see how every node is set up and why, follow **Building the Support Inbox Copilot 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**. When you attach the ZeroGPU node to an agent's **Tool** input, n8n lists it as **ZeroGPU Tool**. 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).

## 🔑 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.

This workflow has five ZeroGPU nodes (the chat model and four tools), and all five use the same credential.

## 🔐 Access PII Redaction 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 redact the personal data from a customer email with a single 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 **Extraction** > **Redact PII**:

```json Paste onto the canvas theme={null}
{
  "nodes": [
    { "name": "Start", "type": "n8n-nodes-base.manualTrigger", "typeVersion": 1, "position": [0, 0], "parameters": {} },
    { "name": "Redact PII", "type": "@zerogpu/n8n-nodes-zerogpu.zeroGpu", "typeVersion": 1, "position": [224, 0], "parameters": { "resource": "extraction", "operation": "redactPii", "model": "gliner2.5-base-v1", "text": "Hi, this is Jessica Miller (jessica.miller@gmail.com, +1 (415) 555-0142). I was charged twice for my Pro plan - once on 3 Nov and again today. I've emailed twice with no answer and I'm really frustrated. Please refund the duplicate charge to my card ending 4242 as soon as possible.", "options": {} } }
  ],
  "connections": { "Start": { "main": [[{ "node": "Redact PII", "type": "main", "index": 0 }]] } }
}
```

Double-click **Redact PII**, select your credential, and look at the **Labels** field: it starts with eight common types of personal data (`person, email, phone number, address, date of birth, credit card number, social security number, ip address`), and only those types are redacted. Click **Execute workflow**:

```json theme={null}
{
  "text": "Hi, this is [PERSON] ([EMAIL], [PHONE_NUMBER]). I was charged twice for my Pro plan - once on 3 Nov and again today. I've emailed twice with no answer and I'm really frustrated. Please refund the duplicate charge to my card ending [CREDIT_CARD_NUMBER] as soon as possible.",
  "entities": {
    "person": ["Jessica Miller"],
    "email": ["jessica.miller@gmail.com"],
    "phone number": ["+1 (415) 555-0142"],
    "credit card number": ["4242"]
  }
}
```

The GLiNER model found the name, email, phone number, and card, and the node replaced each one with a tag built from its label. Even "card ending 4242" becomes `[CREDIT_CARD_NUMBER]`: the model treats the last four digits of a card as card data.

🎉 **herogpu effortlessly strips personal data out of customer messages, providing a fast, low-cost privacy layer for AI integration!**

## 🧰 Building the Support Inbox Copilot with n8n

*This section builds the copilot node by node: a chat to paste emails into, an AI Agent with strict triage instructions, and four ZeroGPU Tools it calls on every message. Every model call behind it runs on herogpu.*

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

```
Paste a customer message ──▶ AI Agent
                               ├─ Chat Model:  ZeroGPU Chat Model (deepseek-v4.1-flash)
                               ├─ Memory:      Simple Memory
                               └─ Tools:       Moderate Text · Classify Team · Redact PII · Summarize Message
                                               (four ZeroGPU Tools)
```

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 **Paste a customer message**. The support lead pastes each email into the editor's chat panel.

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

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

```text System message theme={null}
You help a support lead triage customer messages. For every customer message the user pastes:
1. Call Redact_PII on the original message.
2. Then call Moderate_Text, Classify_Team and Summarize_Message, passing each of them the REDACTED text from step 1, never the original.

Then reply in exactly this Markdown format and nothing else. Put each field on its own line, with an empty line between fields. Use real line breaks - never write the characters "\n".

**Safety:** Safe, or Flagged with the flagged categories and scores

**Team:** the team from Classify_Team

**Summary:** the one-line summary

**Safe to forward:**
> the redacted message
```

These instructions are what make the copilot privacy-safe. The agent picks up the tools on its own, but the instructions fix the order: redaction always comes first, and the other three tools only ever see the redacted text, so no personal data reaches the moderation, classification, or summarization models, or the reply. The fixed format turns every answer into the same four-field card, and the line about `\n` stops the model from writing escaped line breaks into the chat.

### Step 3: 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** on `deepseek-v4.1-flash`, which follows multi-step tool instructions reliably, 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`. The copilot doesn't need earlier emails to triage a new one, but memory lets the support lead ask a follow-up about the last card, such as "Draft a reply to that customer".

### Step 4: Add the Redact PII tool

Under the agent's **Tool** input, click **+**, search for **ZeroGPU**, and choose **ZeroGPU Tool**. Then:

1. Select your credential.

2. Set **Resource** to **Extraction** and **Operation** to **Redact PII**. **Model** stays on `gliner2.5-base-v1`, and **Labels** keeps its eight default types.

3. Set **Text** to this expression, so the agent fills it in on every call:

   ```text Text theme={null}
   {{ $fromAI('text', 'The text to process', 'string') }}
   ```

4. Open the node's **Settings** tab, turn on **Retry On Fail**, and set **Max Tries** to `3` and **Wait Between Tries (ms)** to `2000`.

5. Rename the node **Redact PII**.

The name matters. n8n turns the node name into the tool name the model sees, with spaces replaced by underscores, so this tool reaches the agent as `Redact_PII`, exactly the name the system message uses. Rename the node and the instructions no longer match.

Retry On Fail is there for cold starts. A herogpu model that has sat idle can take a while to answer its first call, and three tries two seconds apart ride that out instead of stopping the run.

### Step 5: Add the Moderate Text tool

Add a second **ZeroGPU Tool** the same way, with the same credential, **Text** expression, and retry settings. Set **Resource** to **Moderation** and **Operation** to **Moderate Text** (model `zlm-v1-moderation-edge`), and rename it **Moderate Text**. The agent sees it as `Moderate_Text`.

### Step 6: Add the Classify Team tool

Add a third **ZeroGPU Tool**. Set **Resource** to **Classification** and **Operation** to **Classify by Schema** (model `gliner2.5-base-v1`), give it the same **Text** expression and retry settings, and paste this into **Schema**:

```json Schema theme={null}
{
  "team": ["billing", "technical issue", "account access", "shipping", "feedback"]
}
```

Rename it **Classify Team**, so the agent sees `Classify_Team`. The model picks exactly one label from the list and returns it as written, which is why the team comes back in lowercase, like `billing`. Edit the list to match your own teams.

### Step 7: Add the Summarize Message tool

Add the fourth **ZeroGPU Tool**. Set **Resource** to **Summarization** and **Operation** to **Summarize Text** (model `llama-3.1-8b-instruct-fast`), give it the same **Text** expression and retry settings, and rename it **Summarize Message**, so the agent sees `Summarize_Message`.

Here's the full tool set. Redact PII and Classify Team run on the same GLiNER model, so every message makes five herogpu calls across four models: the chat model plus three task models.

| Node | Tool name the agent sees | Operation | Model | Price per 1M tokens (input / output) |
| - | - | - | - | - |
| Redact PII | `Redact_PII` | Extraction > Redact PII | `gliner2.5-base-v1` | \$0.02 / \$0.05 |
| Moderate Text | `Moderate_Text` | Moderation > Moderate Text | `zlm-v1-moderation-edge` | \$0.10 / \$0.15 |
| Classify Team | `Classify_Team` | Classification > Classify by Schema | `gliner2.5-base-v1` | \$0.02 / \$0.05 |
| Summarize Message | `Summarize_Message` | Summarization > Summarize Text | `llama-3.1-8b-instruct-fast` | \$0.15 / \$0.28 |

### 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 each of the five ZeroGPU nodes (**ZeroGPU Chat Model**, **Moderate Text**, **Classify Team**, **Redact PII**, and **Summarize Message**). Save the workflow.

### Step 9: Triage a billing email

Click **Fit view** (the first button at the bottom left of the canvas), then **Open chat**. Paste this email and press **Enter**:

```text Message 1 theme={null}
Hi, this is Jessica Miller (jessica.miller@gmail.com, +1 (415) 555-0142). I was charged twice for my Pro plan - once on 3 Nov and again today. I've emailed twice with no answer and I'm really frustrated. Please refund the duplicate charge to my card ending 4242 as soon as possible.
```

Keep your hands off for about 10 seconds. On the canvas, each of the four tools under the agent gets a green tick as it runs, and the **Logs** panel lists them in order: **Redact PII**, then **Moderate Text**, **Classify Team**, and **Summarize Message**. Then the card arrives:

```
Safety: Safe

Team: billing

Summary: [PERSON] was charged twice for the Pro plan (on 3 Nov and again today) and wants the duplicate charge refunded to the card ending [CREDIT_CARD_NUMBER].

Safe to forward:
> Hi, this is [PERSON] ([EMAIL], [PHONE_NUMBER]). I was charged twice for my Pro plan - once on 3 Nov and again today. I've emailed twice with no answer and I'm really frustrated. Please refund the duplicate charge to my card ending [CREDIT_CARD_NUMBER] as soon as possible.
```

Every field came from a ZeroGPU Tool: the safety verdict from Moderate Text, the team from Classify Team, the summary from Summarize Message, and the forwardable copy from Redact PII. Because the summary was written from the redacted text, it carries `[PERSON]` and `[CREDIT_CARD_NUMBER]` instead of the name and card. No personal data reached the reply.

### Step 10: Triage a threatening message

Now an angry one. Paste this and press **Enter**:

```text Message 2 theme={null}
Your app crashed again and wiped the report I spent all week on. If this happens one more time I will find your office and make you regret it. - Mark Davis, mark.davis@outlook.com
```

```
Safety: Flagged - harassment (1.00), harassment/threatening (1.00)

Team: technical issue

Summary: The app crashed again and wiped a report the customer spent a week on, and they threaten to come to the office if it happens again.

Safe to forward:
> Your app crashed again and wiped the report I spent all week on. If this happens one more time I will find your office and make you regret it. - [PERSON], [EMAIL]
```

Moderate Text flagged the threat before anyone forwards it, while Classify Team still routed the underlying problem, a crash, to the technical team. In the last test, both scores were 1.0; in an earlier one they were 0.99 and 0.96. Scores and wording vary slightly between runs, but the labels (Safe or Flagged, `billing` or `technical issue`) were the same in every test. If a take ever adds extra notes under the card, run it again.

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

In the final tests, the two messages were triaged in 10.7 and 9.7 seconds, and four earlier runs of the same workflow took 8 to 10 seconds per message. Each message cost about \$0.0015 to \$0.0023, almost all of it the chat model: the agent calls DeepSeek V4.1 Flash several times per message, to plan the tool calls, read their results, and write the card. The four tool calls work on a few hundred tokens of text between them, at \$0.02 to \$0.28 per 1M tokens, so together they cost well under a hundredth of a cent.

Click any row in **Logs** to see its time and tokens. One first message, sent after the models had sat idle, took 35 seconds because Redact PII was starting up. Before a live demo, send one message a few minutes ahead to warm the models up; in production, Retry On Fail keeps a cold start from failing the run.

### Step 12: Connect it to a real inbox (optional)

The chat is the easiest way to try the copilot, but the agent doesn't care where messages come from. Swap **Paste a customer message** for a **Gmail Trigger** or **Webhook** node and map the email body into the agent's prompt. Then branch on the card: send `Flagged` messages to a moderators' Slack channel, and route the rest by team with a **Switch** node. For a fixed pipeline with no agent at all, chain regular ZeroGPU nodes in the same order, as in the [patterns section](https://docs.herogpu.com/integrations/n8n.md#patterns-and-recipes) of the integration guide.

🎉 With four ZeroGPU Tools and one agent, every customer email becomes a privacy-safe triage card in about 10 seconds: personal data removed first, threats flagged before anyone forwards them, the right team picked, and a one-line summary, for about a fifth of a cent per message.

## 🌟 Highlights

This notebook has guided you through setting up and running an n8n workflow with herogpu for triaging a support inbox with ZeroGPU Tools. You can adapt and expand this example for various other scenarios requiring privacy-safe triage, moderation, and routing of incoming messages.

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, and the four tools it can call.
* **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, also available to agents as ZeroGPU Tool. Here the ZeroGPU Chat Model runs the agent, and four ZeroGPU Tools do the redaction, moderation, classification, and summarization.

This comprehensive setup allows you to adapt and expand the example for various scenarios requiring privacy-safe triage, moderation, and routing of incoming messages.


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