Back to Alchemy
Alchemy RecipeIntermediatestack

Build an AI-powered customer support chatbot with ticket triage and auto-response drafting

Your support inbox hits 50 unread messages before 9am. Half of them are password resets. Another quarter are billing questions you've answered a hundred times. By the time you get to genuine problems, your team is already burnt out. The real kicker: you're losing customers not because your product is bad, but because nobody's responding. This is where most small businesses give up on automation. They assume it requires thousands of pounds per month in enterprise software, or worse, hiring a full-time support person just to sort the mess. Neither option is realistic when you're still finding product-market fit. The good news is you can build a working support chatbot in an afternoon using off-the-shelf AI tools and a workflow orchestrator. It won't replace your team, but it'll triage incoming tickets, draft responses for common issues, and flag urgent problems automatically. Your team only touches the tickets that actually matter.

The Automated Workflow

We're going to chain together three tools: Freed AI for understanding ticket intent and summarising problems, TheB.AI for generating response drafts, and Payman AI for assigning tasks to your team when human review is needed. The orchestration happens in n8n, which gives you full control over the data flow without hitting vendor lock-in. Here's the flow: 1. Customer emails support@yourcompany.com 2. n8n catches the email via webhook 3. Freed AI reads the ticket and categorises it (billing, technical, feature request, etc.) 4. Based on category, either auto-send a response or create a task in Payman AI for your team 5. TheB.AI generates a draft response for your team to review and send 6. Your team uses Payman to mark the task complete once they've sent it

Setting up the n8n workflow

Create a new workflow in n8n and start with an Email Trigger node. You'll need to connect your Gmail or custom email account. Configure it to poll every 5 minutes:

Trigger: Email (Gmail)
Settings:
- Mailbox: support@yourcompany.com
- Polling interval: 5 minutes
- Mark as read: false (we'll do this conditionally)
- Only get unread emails: true

Next, add an HTTP Request node to call the Freed AI API and analyse the ticket content:

POST https://api.freedai.com/v1/classify
Headers: Authorization: Bearer YOUR_FREED_AI_KEY Content-Type: application/json Body:
{ "text": "{{ $node.EmailTrigger.json.body }}", "categories": ["billing", "technical", "feature_request", "account", "other"]
}

Freed AI returns a confidence score for each category. Add a Set node to extract the top match:

new_field: category
value: {{ $node.FreedAI.json.predictions[0].label }}
confidence: {{ $node.FreedAI.json.predictions[0].score }}

Now add a Switch node to route the ticket. High-confidence billing questions (score > 0.85) can be auto-responded. Everything else needs human review:

Switch conditions:
- If category == "billing" AND confidence > 0.85: Send auto-response
- Else: Create task in Payman AI

For auto-responses, use TheB.AI's API to draft a response. Add an HTTP Request node:

POST https://api.theb.ai/v1/chat/completions
Headers: Authorization: Bearer YOUR_THEB_AI_KEY Content-Type: application/json Body:
{ "model": "gpt-4o-mini", "messages": [ { "role": "system", "content": "You are a helpful support agent. Draft a professional response to this support ticket. Keep it under 200 words. Do not make promises about refunds or changes." }, { "role": "user", "content": "{{ $node.EmailTrigger.json.body }}" } ], "temperature": 0.7, "max_tokens": 300
}

Extract the response text into a new field:

draft_response: {{ $node.TheBAI.json.choices[0].message.content }}

For auto-responses with high confidence, you can send directly via the Gmail node:

Send Email node:
- To: {{ $node.EmailTrigger.json.from }}
- Subject: "Re: {{ $node.EmailTrigger.json.subject }}"
- Body: {{ $node.draft_response }}

For everything else (medium or low confidence), create a task in Payman AI. This keeps your team in the loop and lets them review before sending:

POST https://api.paymanai.com/v1/tasks
Headers: Authorization: Bearer YOUR_PAYMAN_KEY Content-Type: application/json Body:
{ "title": "Support ticket: {{ $node.EmailTrigger.json.subject }}", "description": "Category: {{ $node.category }} ({{ $node.confidence * 100 }}% confidence)\n\nCustomer message:\n{{ $node.EmailTrigger.json.body }}\n\nDraft response:\n{{ $node.draft_response }}", "priority": "{{ $node.category == 'technical' ? 'high' : 'normal' }}", "assignee": "support@yourcompany.com"
}

Finally, mark the email as read once it's been processed:

Update Email node:
- Email ID: {{ $node.EmailTrigger.json.id }}
- Mark as read: true

Add error handling by connecting all nodes to a Catch node that logs failures to Slack or a spreadsheet. This matters because a failed email means a customer doesn't get support.

Catch node → Slack message:
"Support workflow failed for: {{ $node.EmailTrigger.json.from }}\nError: {{ error }}"

Test the whole workflow by sending yourself a test email asking something like "Can I get a refund?" Your workflow should automatically draft a response and decide whether to send it or create a Payman task.

The Manual Alternative

If you prefer more control before anything goes out, skip the auto-send step entirely. Instead, send every ticket to Payman AI for your team to review. This takes longer but means no drafted responses go out without human eyes on them. Alternatively, use TheB.AI's chatbot interface directly on your website. Route customers to the chatbot for common questions (password reset, account info, basic troubleshooting) and only hand off complex issues to your team. You can embed it in minutes without code.

Pro Tips

Rate limits matter.

Both Freed AI and TheB.AI have per-minute request limits on free or starter plans.

If you're expecting more than 20 support emails per hour, move to a paid plan immediately. It's cheaper than missing customer replies.

Draft responses need disclaimers.

When you auto-generate text with Claude Opus 4.6 or GPT-4o, always add a flag that tells your team "this is a draft, not ready to send." Some teams add a bold red header to Payman tasks. Others prepend "[DRAFT]" to the response. Pick one and enforce it.

Cold start the categories.

Your first week of Freed AI classifications will be noisy. Review every ticket manually during this period and adjust your confidence thresholds. If billing questions are getting miscategorised, raise the threshold from 0.85 to 0.92. If technical issues are being missed, create a custom category for common keywords like "crash," "error," or "slow."

Separate urgent from automatable.

Technical support tickets almost always need human review; billing refund requests can sometimes be auto-handled with a "we'll process this within 48 hours" message. Build separate rules for each category in your Switch node.

Monitor token usage.

TheB.AI charges per token, not per request. A 500-word support ticket might use 150 tokens just for input. If you're running this for 100 tickets a day, watch your token burn rate and set spending alerts in your TheB.AI dashboard.

Cost Breakdown

ToolPlan NeededMonthly CostNotes
Freed AIStarter£2910,000 classifications/month; upgrade to Pro (£99) if you exceed this
TheB.AIProfessional£49Includes 100k tokens; extra tokens at £0.0015 per 1k
Payman AIStandard£39Up to 500 tasks/month; includes basic analytics
n8nCloud Pro£40200 workflow executions/month; unlimited workflows
Gmail APIFree£0Included with your domain; no additional cost
Total£157/monthSupports ~1,000 support tickets/month with human review on ~60%