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";
2
3const result = await relay
4 .workflow("csat-analyzer")
5
6 // Step 1: Categorize feedback themes
7 .step("categorize")
8 .with("openai:gpt-4o")
9 .prompt(`Analyze these CSAT responses and categorize feedback:
10
11Responses (CSV format):
12{{csvResponses}}
13
14Categories to detect:
15- Product bugs/issues
16- Feature requests
17- Onboarding experience
18- Support quality
19- Performance/speed
20- Pricing concerns
21- Documentation quality
22
23Return 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}]`)
32
33 // Step 2: Identify root causes for low scores
34 .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):
38
39Categorized Data: {{categorize.output}}
40
41Identify:
42- Most common complaints (with frequency)
43- Specific features/flows causing friction
44- Support interaction issues
45- Any critical bugs mentioned multiple times
46
47Group by theme and rank by impact.`)
48
49 // Step 3: Extract feature requests
50 .step("extract-requests")
51 .with("openai:gpt-4o")
52 .depends("categorize")
53 .prompt(`Extract feature requests from this CSAT data:
54
55{{categorize.output}}
56
57For each feature request, return:
58- Feature description
59- How many users requested it
60- User pain point it solves
61- Potential impact (low/med/high)
62
63Format as prioritized list.`)
64
65 // Step 4: Generate executive summary
66 .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:
70
71Overall Data: {{categorize.output}}
72Root Causes: {{root-cause-analysis.output}}
73Feature Requests: {{extract-requests.output}}
74
75Include:
761. Overall satisfaction score and trend
772. Top 3 areas of concern
783. Top 3 feature requests
794. Immediate action items
805. 30-day improvement plan
81
82Target audience: Product & Engineering leadership
83Keep under 500 words.`)
84
85 .run({
86 csvResponses: surveyResponses,
87 });
88
89console.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 analysis
2import { relay } from "@relayplane/workflows";
3import { sendEmail } from "./notifications";
4
5async function weeklyCSATReport() {
6 // Fetch last 7 days of responses
7 const responses = await fetchCSATResponses({
8 startDate: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
9 });
10
11 const result = await relay
12 .workflow("csat-analyzer")
13 .run({
14 csvResponses: convertToCSV(responses),
15 });
16
17 // Email to leadership
18 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 cron
2relayplane 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