Here’s a clean, English-only template description you can paste into the n8n “Description” field.
Overview
This workflow analyzes customer survey responses, groups them by sentiment (positive / neutral / negative), generates themes and insights with an AI agent, and delivers a consolidated report to your destinations (Google Sheets, Slack). It runs on a daily schedule and uses batch-based AI analysis for accuracy.
Flow: Schedule → Fetch from Sheets → Group & batch (Code) → AI analysis → Aggregate → Save/Notify (Sheets, Slack)
What You’ll Need
- A survey data source (Google Sheets recommended)
- AI model credentials (e.g., OpenAI or OpenRouter)
- Optional destinations: Google Sheets (summary sheet), Slack channel
Setup
-
Data source (Google Sheets)
- In Get Survey Responses, replace
YOUR_SHEET_ID
and YOUR_SHEET_NAME
with your sheet details.
- Ensure the sheet includes columns like:
満足度 (Rating)
, 自由記述コメント (Comment)
, 回答日時 (Timestamp)
.
-
AI model
- Add credentials to your preferred LLM node (OpenAI/OpenRouter).
- Keep the prompt’s JSON-only requirement so the structured parser can consume it reliably.
-
Destinations
- Save to Sheet: set your output
documentId
/ sheetName
.
- Slack: set the target
channelId
on the Slack node.
How It Works
- Daily Schedule Trigger — starts the workflow at your chosen time.
- Get Survey Responses (Sheets) — reads survey data.
- Group & Prepare Data (Code) — classifies by rating (
>=4: positive
, =3: neutral
, <3: negative
) and creates batches (max 50 per batch).
- Loop Over Batches — feeds each sentiment batch to the AI separately for cleaner signals.
- Analyze Survey Batch (AI Agent) — returns structured JSON: themes, insights, recommendations.
- Add Metadata (Code) — attaches original sentiment and item counts to each AI result.
- Aggregate Results (Code) — merges all batches; outputs Top Themes, Key Insights, Priority Recommendations, and an Executive Summary.
- Save to Sheet / Slack — appends the summary to a sheet and posts highlights to Slack.
Data Assumptions (Columns)
Your source should include at least:
満足度 (Rating)
— integer 1–5
自由記述コメント (Comment)
— string
回答日時 (Timestamp)
— ISO string or date
Outputs
Customize
- Adjust sentiment thresholds (e.g., require
>=5
for positive) or batch size (default 50) in the Code node.
- Tailor the AI prompt or the output JSON schema to your domain.
- Add more outputs (CSV export, database insert, additional channels) in parallel after the Aggregate step.
Before You Run (Checklist)
- [ ] Add credentials for Sheets / AI / Slack in Credentials
- [ ] Update
documentId
, sheetName
, and Slack channelId
- [ ] Confirm your column names match the Code node references
- [ ] Verify schedule time and timezone (e.g., Asia/Tokyo)
Troubleshooting
- Parser errors on AI output: ensure the model response is JSON-only; reduce temperature or simplify schema if needed.
- Only some batches run: check batch size in Loop and ensure each sentiment bucket actually contains responses.
- No output to Sheets/Slack: verify credentials, IDs, and required fields; confirm permissions.
Security & Template Notes
- Do not include credentials in the template file. Users add their own after import.
- Use Sticky Notes to document Overview, Setup, Processing Logic, and Output choices. This template already includes guideline-friendly notes.