Automate enquiry routing
The problem
You've got a classification prompt that works well (see 'Classify enquiries using AI'), but you're still copying and pasting each enquiry manually. With hundreds coming in daily, you need the classification to happen automatically as enquiries arrive.
The solution
Connect your enquiry source (email inbox, web form) to an AI API using Zapier, Make, or similar automation tools. Each new enquiry gets classified automatically and tagged with service category, urgency, and any flags. Results go to a spreadsheet, your CRM, or directly to the right team's queue.
What you get
Enquiries automatically tagged and routed as they arrive. Straightforward ones go to the right queue. Flagged ones (safeguarding, complaints, low confidence) go to a human review queue. You can see at a glance what's come in and where it went.
Before you start
- A working classification prompt (see "Classify enquiries using AI" recipe first)
- An OpenAI or Anthropic API key
- A Zapier, Make, or Power Automate account
- Access to your email inbox or web form system
- A destination for results (spreadsheet, CRM, or ticketing system)
When to use this
- You're processing more than 50 enquiries a day and manual triage is a bottleneck
- You've already tested your classification prompt and trust it
- Speed of initial response matters to your service users
- You want staff to focus on complex cases, not sorting
When not to use this
- You haven't tested your classification prompt thoroughly yet
- You're not ready to trust automation for any part of the process
- Your enquiry volume is low enough that manual classification is fine
- You don't have technical support to maintain the automation
Steps
- 1
Get your API key
Sign up for OpenAI or Anthropic and get an API key. Add some credit (£10 is plenty for testing). Keep your API key secure - treat it like a password.
- 2
Adapt your prompt for the API
Your conversational prompt needs adjusting for the API. Tell it to return structured JSON with specific fields: service, urgency, red_flags, summary, confidence. Test this in the API playground before connecting to automation.
- 3
Set up the trigger
In Zapier or Make, create a new automation triggered by your enquiry source. This might be 'New email in inbox', 'New form submission', or 'New row in spreadsheet'. Test that the trigger fires correctly.
- 4
Add the AI classification step
Add an OpenAI or Claude action to your automation. Paste your adapted prompt, inserting the enquiry text from the trigger. Set the response format to JSON. Test with a sample enquiry.
- 5
Route based on results
Add conditional logic: if red_flags is not empty, send to human review queue. If confidence is low, send to human review. Otherwise, route to the appropriate service queue based on the category. Start conservative - more human review is better than missed issues.
- 6
Start with suggestions, not auto-routing
Initially, have the automation add tags/labels but don't auto-move enquiries. Let humans verify the classifications for a week. Track accuracy. Only switch to auto-routing once you trust it.
- 7
Monitor and improve(optional)
Track what gets overridden by humans. Are certain enquiry types consistently misclassified? Update your prompt. Are new types appearing that the system doesn't handle? Add them. Review weekly at first, then monthly.
Example code
API classification function
If you're building custom automation rather than using Zapier, here's how to call the API. This returns structured JSON you can parse and route.
from openai import OpenAI
import json
client = OpenAI()
# Your services and criteria (adapt these)
services = {
"housing": "Help with housing issues, homelessness, tenancy problems",
"benefits": "Benefits advice, appeals, form filling",
"debt": "Debt management, creditor issues, budgeting",
"employment": "Job seeking, workplace issues, redundancy",
"general": "Anything that doesn't fit the above"
}
red_flags = [
"suicide", "self-harm", "domestic abuse", "safeguarding",
"child protection", "threat", "court deadline tomorrow"
]
def classify_enquiry(enquiry_text):
prompt = f"""Classify this enquiry for a charity advice service.
Services:
{json.dumps(services, indent=2)}
Return JSON with:
- service: which service this is for
- urgency: "urgent" (needs response today), "normal" (within 3 days), or "low" (when available)
- red_flags: list any safeguarding or escalation concerns found
- summary: one sentence summary of what they need
- confidence: "high", "medium", or "low"
Red flag keywords to watch for: {', '.join(red_flags)}
Enquiry:
{enquiry_text}
Return only valid JSON."""
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": prompt}],
response_format={"type": "json_object"}
)
return json.loads(response.choices[0].message.content)
# Example usage
result = classify_enquiry("I've just received an eviction notice...")
print(json.dumps(result, indent=2))
# Route based on results
if result.get('red_flags'):
print("-> Send to human review (red flags)")
elif result.get('confidence') == 'low':
print("-> Send to human review (low confidence)")
else:
print(f"-> Route to {result['service']} queue")Tools
Resources
At a glance
- Time to implement
- days
- Setup cost
- low
- Ongoing cost
- low
- Cost trend
- decreasing
- Organisation size
- medium, large
- Target audience
- operations-manager, it-technical
API costs are ~£0.001-0.01 per enquiry depending on length. Zapier/Make have free tiers for low volumes (100-1000 tasks/month). Main cost is setup time.