CSAT Analyzer
Analyze customer satisfaction surveys to identify trends, root causes, and actionable insights.
This workflow processes CSAT responses, categorizes feedback, and generates executive summaries with recommendations.
Implementation
1import { relay } from "@relayplane/workflows";23const result = await relay4 .workflow("csat-analyzer")56 // Step 1: Categorize feedback themes7 .step("categorize")8 .with("openai:gpt-4o")9 .prompt(`Analyze these CSAT responses and categorize feedback:1011Responses (CSV format):12{{csvResponses}}1314Categories to detect:15- Product bugs/issues16- Feature requests17- Onboarding experience18- Support quality19- Performance/speed20- Pricing concerns21- Documentation quality2223Return JSON array:24[{25 "response_id": "id",26 "score": 1-5,27 "primary_theme": "category",28 "sentiment": "positive|neutral|negative",29 "actionable": boolean,30 "urgency": "low|medium|high"31}]`)3233 // Step 2: Identify root causes for low scores34 .step("root-cause-analysis")35 .with("anthropic:claude-3.5-sonnet")36 .depends("categorize")37 .prompt(`Analyze patterns in low-scoring responses (1-2 stars):3839Categorized Data: {{categorize.output}}4041Identify:42- Most common complaints (with frequency)43- Specific features/flows causing friction44- Support interaction issues45- Any critical bugs mentioned multiple times4647Group by theme and rank by impact.`)4849 // Step 3: Extract feature requests50 .step("extract-requests")51 .with("openai:gpt-4o")52 .depends("categorize")53 .prompt(`Extract feature requests from this CSAT data:5455{{categorize.output}}5657For each feature request, return:58- Feature description59- How many users requested it60- User pain point it solves61- Potential impact (low/med/high)6263Format as prioritized list.`)6465 // Step 4: Generate executive summary66 .step("executive-summary")67 .with("anthropic:claude-3.5-sonnet")68 .depends("categorize", "root-cause-analysis", "extract-requests")69 .prompt(`Create an executive summary for this CSAT analysis:7071Overall Data: {{categorize.output}}72Root Causes: {{root-cause-analysis.output}}73Feature Requests: {{extract-requests.output}}7475Include:761. Overall satisfaction score and trend772. Top 3 areas of concern783. Top 3 feature requests794. Immediate action items805. 30-day improvement plan8182Target audience: Product & Engineering leadership83Keep under 500 words.`)8485 .run({86 csvResponses: surveyResponses,87 });8889console.log("Summary:", result.steps["executive-summary"].output);90console.log("Root Causes:", result.steps["root-cause-analysis"].output);Automated Reporting
Schedule this workflow to run weekly and auto-send reports:
1// Schedule weekly CSAT analysis2import { relay } from "@relayplane/workflows";3import { sendEmail } from "./notifications";45async function weeklyCSATReport() {6 // Fetch last 7 days of responses7 const responses = await fetchCSATResponses({8 startDate: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),9 });1011 const result = await relay12 .workflow("csat-analyzer")13 .run({14 csvResponses: convertToCSV(responses),15 });1617 // Email to leadership18 await sendEmail({19 to: ["product@company.com", "eng@company.com"],20 subject: `Weekly CSAT Analysis - ${new Date().toLocaleDateString()}`,21 body: result.steps["executive-summary"].output,22 attachments: [{23 filename: "root-causes.txt",24 content: result.steps["root-cause-analysis"].output,25 }],26 });27}1# Schedule with cron2relayplane schedules create weekly-csat \3 --workflow csat-analyzer \4 --cron "0 9 * * MON" \5 --timezone "America/New_York"Sample Output
Root Cause Example:
- Onboarding Complexity (23 mentions): Users struggle with API key setup. Average time-to-first-success: 47 minutes vs target of 10.
- Mobile App Performance (18 mentions): 78% of 1-star reviews mention slow load times on Android.
- Documentation Gaps (15 mentions): No examples for Python integration, most requested language.
Integration with Product Tools
- Auto-create Jira tickets for high-urgency issues
- Send Slack alerts when CSAT drops below threshold
- Update product roadmap based on feature request frequency
- Trigger customer success outreach for detractors