Quick Overview
This workflow runs every 6 hours to read new NPS responses from Google Sheets, uses OpenAI to draft a personalized reply, sends it via Gmail, routes respondents by NPS segment, logs promoter quotes back to Google Sheets, alerts support on detractors, and marks each row as processed.
How it works
- Runs on a schedule every 6 hours and reads NPS response rows from a Google Sheets document.
- Filters the sheet to keep only rows where Status equals “new” to avoid reprocessing.
- Validates required fields, parses the 0–10 NPS score, and classifies each response as Promoter, Passive, or Detractor.
- Calls the OpenAI Chat Completions API to generate a warm, personalized email body based on the score segment and the customer’s comment.
- Sends the generated reply to the customer via Gmail and then routes the workflow by segment.
- For promoters, appends the customer comment as a quote to a “promoter-quotes” tab in Google Sheets and marks the original row as Processed; for passives, it marks the row as Processed.
- For detractors, sends an alert email to your support team via Gmail and then updates the original Google Sheets row status to Processed.
Setup
- Create credentials for Google Sheets, Gmail, and OpenAI (OpenAI API key) in n8n.
- Replace YOUR_NPS_SHEET_ID with your Google Sheets document ID in all Google Sheets steps used to read, append, and update rows.
- Ensure your spreadsheet has a “nps-responses” tab with a Status column (using values “new” and “Processed”) and a “promoter-quotes” tab with the expected columns.
- Replace YOUR_SUPPORT_TEAM_EMAIL with your team inbox address in the detractor alert email step.