LOW / CODEBlueprints
customer-supportai

AI Support Sentiment Detector & Escalator

Claude AI analyzes the tone and sentiment of incoming customer messages. Frustrated or angry messages are automatically escalated to senior support via Slack with full context, while positive messages are logged for team morale.

Advanced~30 minn8nMake.com 671 downloads 1302 views

Setup Instructions

1. In your automation platform, add a Gmail trigger that watches for new customer emails (e.g., labeled "Support" or sent to support@yourcompany.com). 2. Add a Set/Function node to extract the email body, subject, sender name, and email address. 3. Add an HTTP Request node to call the Claude API (POST https://api.anthropic.com/v1/messages). Set headers: x-api-key: {{YOUR_ANTHROPIC_API_KEY}}, anthropic-version: 2023-06-01, Content-Type: application/json. Use model claude-sonnet-4-20250514. 4. In the request body, instruct Claude to analyze the message sentiment and return JSON: {"sentiment": "angry|frustrated|neutral|satisfied|positive", "confidence": 0.0-1.0, "escalation_reason": "brief explanation if negative", "customer_emotion_summary": "1-sentence summary of how the customer feels"}. 5. Add a Router/Switch node based on the sentiment value. Route angry/frustrated messages to an escalation branch and positive messages to a wins branch. 6. For escalations: add a Slack node that posts to #escalations with @here mention, customer name, sentiment score, escalation reason, and the original message excerpt. Include a link to the email thread. 7. For positive messages: add a Google Sheets node to log to a "Customer Wins" sheet for team morale and review. 8. Add a master Google Sheets logging node that captures ALL messages: Timestamp, Customer, Subject, Sentiment, Confidence, Escalated (Y/N), Resolution Status.
Troubleshooting
**Claude misclassifying sarcasm as positive:** Sarcasm is notoriously difficult for sentiment analysis. Add explicit instructions: "Be aware of sarcasm — phrases like 'Great, another broken feature' should be classified as frustrated, not positive." Include sarcastic examples in your prompt. **Too many escalations overwhelming the team:** Adjust your routing threshold — only escalate when sentiment is "angry" AND confidence > 0.85. Route "frustrated" to a separate triage channel instead of the urgent escalation channel. **Email context insufficient for accurate sentiment:** Some customer threads span multiple emails. Fetch the full thread (not just the latest message) using the Gmail thread ID, and send the last 3-5 messages to Claude for better context. **Slack notifications too noisy:** Batch non-urgent sentiment alerts into a daily digest instead of real-time notifications. Only send immediate Slack alerts for angry sentiment with high confidence. Use a scheduled aggregation node for the daily summary.

Need a custom version?

We can build a tailored automation workflow for your specific needs.

New blueprints weekly

Get notified when we publish new automation workflows.