Generate Empathetic Customer Replies with Claude AI and Auto-Escalation
🧠 Overview
Generate empathetic, professional reply drafts for customer or user messages.
The workflow detects sentiment, tone, and risk level, drafts a concise response, sanitizes PII/links/emojis, and auto-escalates risky or low-confidence cases to human review.
⚙️ How It Works
Input — Manual Test or Webhook Trigger
AI Agent (Empathy) — returns { sentiment, tone, reply, confidence, needs_handover }
Post-Process & Sanitize — removes URLs/hashtags, masks PII, caps length
Risk & Handover Rules — checks confidence threshold, risk words, and negativity
Routing — auto-send safe replies or flag to Needs Review
🧩 Setup Instructions (3–5 min) Open Set Config1 and adjust: MAX_LEN (default 600) ADD_FOLLOWUP_QUESTION (true/false) FORMALITY (auto | casual | polite) EMOJI_ALLOWED (true/false), BLOCK_LINKS (true/false) RISK_WORDS (e.g., refund, lawsuit, self-harm) Connect Anthropic credential to Anthropic Chat Model (Optional) Replace Manual Trigger with Webhook Trigger for real-time use
> Tip: If you need to show literal angle brackets in messages, use backticks like <example> (no HTML entities needed).
📚 Use Cases
-
SaaS Billing Complaints Input:** “I was billed after canceling. This is unacceptable.”
Output:** Calm, apologetic reply with refund steps; escalates if refund is in RISK_WORDS or confidence < 0.45. -
Product Bug Reports Input:** “Upload fails on large files since yesterday.”
Output:** Acknowledges impact, requests logs, offers workaround; routes to auto-send if low risk and high confidence. -
Delivery/Logistics Delays Input:** “My order is late again. Should I file a complaint?”
Output:** Empathetic apology, ETA guidance, partial credit policy note; escalates if language indicates legal action. -
Community Moderation / Abuse Input:** “Support is useless—you’re all scammers.”
Output:** De-escalating, policy-aligned response; auto-flags due to negative sentiment + risk keyword match. -
Safety / Self-harm Mentions Input:** “I feel like hurting myself if this isn’t fixed.”
Output:* Immediate escalation*, inserts approved resources; never auto-sends.
🚨 Auto-Escalation Rules (defaults) Negative** sentiment Message matches any RISK_WORDS confidence < 0.45 Mentions of legal, harassment, or self-harm context
🧪 Notes & Best Practices 🔐 No hardcoded API keys — use n8n Credentials 🧭 Tune thresholds and RISK_WORDS to your org policy 🧩 Works on self-hosted or cloud n8n ✅ Treat outputs as drafts; ship after human/policy review
🔗 Resources GitHub (template JSON):** https://github.com/yskmtb0714/n8n-workflows/blob/main/empathy-reply-assistant.json
Related Templates
Restore your workflows from GitHub
This workflow restores all n8n instance workflows from GitHub backups using the n8n API node. It complements the Backup ...
Verify Linkedin Company Page by Domain with Airtop
Automating LinkedIn Company URL Verification Use Case This automation verifies that a given LinkedIn URL actually belo...
USDT And TRC20 Wallet Tracker API Workflow for n8n
Overview This n8n workflow is specifically designed to monitor USDT TRC20 transactions within a specified wallet. It u...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments