Set up the AI Customer Support Agent
About 15 minutes on n8n Cloud (longer on self-hosted n8n, where you first create your own Google OAuth client). Everything you need to go from download to the first drafts, in order. Ticks are saved in this browser so you can come back later.
Before you start
- n8n (Cloud or self-hosted)
- Google account: Gmail + Sheets
- OpenAI API key
- A knowledge base: one row per question and answer
1. Pick where it runs
n8n Cloud
- Log in to your n8n Cloud workspace.
- Workflows → Import from file.
- Pick the file(s) in
workflow/.
n8n self-hosted
- Open your n8n (Docker or npm, v1.x/2.x).
- Workflows → Import from file.
- Same files; nothing else changes.
ChatGPT or Claude
- Create a Custom GPT or Claude Project.
- Paste
gpt/INSTRUCTIONS.txt. - Upload your sheet or paste rows in.
2. Setup checklist
3. Connect your tools
| Service | Nodes that use it |
|---|---|
| Google Sheets | Get Knowledge Base, Log Ticket |
| OpenAI | Classify & Draft |
| Gmail | Get Support Emails, Create Reply Draft, Label Processed |
In each node, choose Create new credential and sign in (Google uses OAuth; OpenAI takes an API key). n8n stores credentials in your instance, not with us.
What the statuses mean
| Status | Meaning | Your next step |
|---|---|---|
drafted | Reply draft is in the thread | Review, edit, send |
needs_human | Escalated (see escalation_reason) | Answer yourself; add the answer to the KB so it's covered next time |
error | See the error column | Fix, then remove the plugstaff-processed label from the email so the next run picks it up |
Troubleshooting
| Symptom | Fix |
|---|---|
| Everything is escalated | KB too thin or threshold too high → add Q&A rows, lower `confidence_threshold` to 0.65 and compare |
| Replies include quoted history | Some clients quote differently → the cleaner strips `>` lines; paste a sample in support and we'll extend it |
Guardrails
- Drafts only: a human sends every reply. Keep it that way until you trust the answers on your own data.
- Customer emails are sent to your LLM provider. Mention AI-assisted processing in your privacy policy, and don't put secrets in the KB.
- If you serve EU users and later let it send automatically, tell customers they're talking to an AI (EU AI Act transparency duties for AI that interacts with people). Not legal advice.