This workflow corresponds to n8n.io template #15237 — we link there as the canonical source.
This workflow follows the Gmail → Google Sheets recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "P36DBaKbzK4jaZYb",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Post-Delivery CSAT Survey Automation",
"tags": [],
"nodes": [
{
"id": "5ceafd6d-63c1-44de-bff3-6aca5f07d3cb",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
336,
-32
],
"parameters": {
"color": 7,
"width": 704,
"height": 432,
"content": "## Webhook Intake & Validation\nThis section receives delivery status updates from the webhook and filters only valid \u201cdelivered\u201d events with a valid email. It ensures that only completed deliveries proceed further in the workflow, preventing unnecessary processing and reducing invalid API calls or duplicate survey triggers."
},
"typeVersion": 1
},
{
"id": "a6bec05d-a8f2-4d60-a685-2383c7947f95",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
1072,
-32
],
"parameters": {
"color": 7,
"width": 608,
"height": 432,
"content": "## Customer & Order Verification\nThis section ensures the event contains a valid email and extracts structured order details. It prepares clean data for downstream processing and ensures only meaningful customer records continue. This helps avoid sending surveys for incomplete or invalid customer data."
},
"typeVersion": 1
},
{
"id": "cf099287-f88e-42ad-9d52-5672727743dd",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1712,
-32
],
"parameters": {
"color": 7,
"width": 528,
"height": 432,
"content": "## Duplicate Prevention & Decision Logic\nThis section checks whether a survey has already been sent for the given order. It prevents duplicate survey emails by comparing existing Google Sheet records with incoming order IDs and sets a flag to decide whether the workflow should proceed."
},
"typeVersion": 1
},
{
"id": "b9ab702c-c7ee-4ed5-acb2-6566f07ebb1d",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
2272,
-32
],
"parameters": {
"color": 7,
"width": 368,
"height": 432,
"content": "## Delay & Timing Control \nThis section introduces a controlled delay of 4 hours after delivery before sending the survey email. This improves customer experience by ensuring users receive the survey at an appropriate time rather than immediately after delivery confirmation.\n"
},
"typeVersion": 1
},
{
"id": "edb5c08b-6f35-4908-9618-6adfa6c72483",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
2672,
-32
],
"parameters": {
"color": 7,
"width": 560,
"height": 432,
"content": "## Email Preparation & Delivery\nThis section constructs a personalized survey email message including order-based tracking and a unique Typeform link. It then sends the email to the customer using Gmail, ensuring consistent communication and tracking-ready feedback collection."
},
"typeVersion": 1
},
{
"id": "7c66dfc7-ced6-4de5-a955-38fc0eb53ae7",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
3264,
-32
],
"parameters": {
"color": 7,
"width": 432,
"height": 432,
"content": "## Logging & Tracking\nThis section records every sent survey into Google Sheets for tracking and analytics. It stores order ID, email, timestamp and survey link to prevent duplicates and maintain a reliable audit trail of all customer feedback requests."
},
"typeVersion": 1
},
{
"id": "bd8faa9b-5c69-42a6-89b8-0e2dc88feab4",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
336,
-528
],
"parameters": {
"width": 1104,
"height": 432,
"content": "## Workflow Overview & Setup Guide \n\nThe **Post-Delivery CSAT Survey Automation system** is a complete two-part customer experience pipeline built in n8n. The first workflow triggers when a delivery webhook receives a \u201cdelivered\u201d event. It validates customer data, checks for duplicates in Google Sheets and schedules a CSAT survey email after a controlled delay. A personalized email is then sent with a unique survey link and the transaction is logged for tracking and analytics.\n\nThe second workflow processes incoming CSAT responses from customers. It validates feedback submissions, maps them to existing orders and updates Google Sheets in real time. The system then classifies CSAT scores into low, neutral and high satisfaction categories. Based on this classification, low scores trigger immediate alerts to internal teams for rapid response, while other responses are stored for reporting and insights.\n\n**Setup Steps:**\n**1.** Configure both webhooks (delivery + CSAT response) in n8n.\n**2.** Connect Google Sheets with proper column structure (order_id, email, csat_score, feedback).\n**3.** Set up Gmail OAuth credentials for sending emails and alerts.\n**4.** Ensure CSAT form sends correct payload format.\n**5.** Verify Typeform survey link generation logic.\n**6.** Activate both workflows and test with sample delivery + CSAT events.\n\nThis system creates a **closed-loop customer experience engine**, connecting delivery events, feedback collection and real-time issue escalation into one automated pipeline."
},
"typeVersion": 1
},
{
"id": "a57967ff-34e7-4934-ac18-daf0da766f99",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
336,
480
],
"parameters": {
"color": 7,
"width": 496,
"height": 496,
"content": "## CSAT Response Intake & Validation \nThis section receives customer CSAT submissions via webhook and validates required fields such as order ID and CSAT score. It ensures only complete and valid feedback data enters the system, preventing corrupted or partial responses from affecting analytics or business decisions.\n"
},
"typeVersion": 1
},
{
"id": "5c6a7bc7-a148-4676-ac02-1b18e4dbe26d",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
864,
480
],
"parameters": {
"color": 7,
"width": 448,
"height": 496,
"content": "## Order Mapping & Data Sync\nThis section maps incoming CSAT responses to existing orders in Google Sheets. It retrieves the correct order row and updates it with the latest customer feedback. This ensures real-time synchronization between delivery records and customer satisfaction data.\n"
},
"typeVersion": 1
},
{
"id": "c5baa0dc-c177-4c3a-a347-962e657ef6b4",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
1344,
480
],
"parameters": {
"color": 7,
"width": 416,
"height": 496,
"content": "## Data Normalization & Enrichment\nThis section standardizes CSAT data into a structured format and enriches it with calculated fields. It ensures consistency in score handling and prepares the data for classification logic used in sentiment segmentation and automation rules."
},
"typeVersion": 1
},
{
"id": "b4073c42-048d-4379-a470-a13065da029b",
"name": "Sticky Note10",
"type": "n8n-nodes-base.stickyNote",
"position": [
1792,
480
],
"parameters": {
"color": 7,
"width": 368,
"height": 496,
"content": "## CSAT Intelligence Engine\nThis section analyzes CSAT scores and classifies customers into Low, Neutral or High satisfaction segments. It generates boolean flags that drive automated decision-making for escalation, reporting or customer appreciation workflows."
},
"typeVersion": 1
},
{
"id": "95763e5a-d274-452f-8ead-245219c6012e",
"name": "Sticky Note11",
"type": "n8n-nodes-base.stickyNote",
"position": [
2192,
480
],
"parameters": {
"color": 7,
"width": 416,
"height": 496,
"content": "## Decision Routing System\nThis section routes CSAT responses based on satisfaction level using a switch node. It ensures low satisfaction cases are prioritized for immediate escalation while other responses follow appropriate handling paths."
},
"typeVersion": 1
},
{
"id": "04886af0-98b9-4a0e-95b7-5cb11eb0aea3",
"name": "Sticky Note12",
"type": "n8n-nodes-base.stickyNote",
"position": [
2656,
480
],
"parameters": {
"color": 7,
"width": 480,
"height": 496,
"content": "## Low CSAT Alert System\nThis section triggers real-time alerts for low CSAT scores. It sends an email notification to internal teams containing order details, score and customer feedback, enabling fast response and issue resolution."
},
"typeVersion": 1
},
{
"id": "2bdfa547-c0af-49b1-8f92-9d5b9ff3f3b3",
"name": "Send Low CSAT Alert (Gmail)",
"type": "n8n-nodes-base.gmail",
"position": [
2816,
688
],
"parameters": {
"sendTo": "={{ $json.email }}",
"message": "=\ud83d\udea8 LOW CSAT ALERT\n\nOrder ID: {{ $json.order_id }}\nCustomer: {{ $json.email }}\nScore: {{ $json.csat_score }}\nFeedback: {{ $json.feedback }}",
"options": {},
"subject": "\ud83d\udea8 Low CSAT Alert - Order {{$json.order_id}}",
"emailType": "text"
},
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "a8ada358-4612-488c-a41f-44ce7b4a6ee9",
"name": "Incoming Delivery Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
416,
224
],
"parameters": {
"path": "delivery-webhook",
"options": {},
"httpMethod": "POST"
},
"typeVersion": 1
},
{
"id": "5d86dbb1-fb3a-4a2f-92ef-8285798b0b3a",
"name": "Validate Delivered Event",
"type": "n8n-nodes-base.if",
"position": [
640,
224
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "3afe54a4-3215-4d56-9cd5-c425d5506226",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.body.status }}",
"rightValue": "delivered"
},
{
"id": "63b1a905-2ac4-4eaa-8c1b-088bf0a9f04a",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.body.email }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2
},
{
"id": "dcc2cb7f-857a-49dc-9803-a66797981872",
"name": "Extract Order Data",
"type": "n8n-nodes-base.set",
"position": [
880,
208
],
"parameters": {
"values": {
"string": [
{
"name": "order_id",
"value": "={{ $json.body.order_id }}"
},
{
"name": "email",
"value": "={{ $json.body.email }}"
},
{
"name": "name",
"value": "={{ $json.body.name }}"
}
]
},
"options": {},
"keepOnlySet": true
},
"typeVersion": 2
},
{
"id": "8b497296-3263-4f0d-976b-457311176dc7",
"name": "Validate Customer Email",
"type": "n8n-nodes-base.if",
"position": [
1184,
208
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "31d0bf1b-9e65-427c-8e10-1bb7ae532cd9",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.email }}",
"rightValue": ""
},
{
"id": "d32583be-f430-479f-bab1-5609b2e218c1",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Incoming Delivery Webhook').item.json.body.status }}",
"rightValue": "delivered"
}
]
}
},
"typeVersion": 2
},
{
"id": "15eb4dce-dca8-40d0-9526-7f07e87a189a",
"name": "Fetch Sent Survey Records",
"type": "n8n-nodes-base.googleSheets",
"position": [
1488,
192
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "={{ $('Extract Order Data').item.json.order_id }}",
"lookupColumn": "order_id"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 84606666,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1b4XQG0yh1s3ZrnYTsKBlnSMNdlYzQt42zJ8DUneVTS8/edit#gid=84606666",
"cachedResultName": "Post-Delivery CSAT Survey"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1b4XQG0yh1s3ZrnYTsKBlnSMNdlYzQt42zJ8DUneVTS8",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1b4XQG0yh1s3ZrnYTsKBlnSMNdlYzQt42zJ8DUneVTS8/edit?usp=drivesdk",
"cachedResultName": "LinkedIn Profile Monitor"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"executeOnce": false,
"typeVersion": 4,
"alwaysOutputData": true
},
{
"id": "7411b292-79c2-4daa-a1ca-41b8540f13e4",
"name": "Determine Survey Eligibility",
"type": "n8n-nodes-base.code",
"position": [
1824,
192
],
"parameters": {
"jsCode": "const rows = $input.all();\n\nconst data = $('Extract Order Data').first().json;\n\nconst found = rows.some(r => r.json.order_id === data.order_id);\n\nreturn [\n {\n json: {\n shouldSend: !found,\n order_id: data.order_id,\n email: data.email,\n name: data.name,\n survey_link: `https://form.typeform.com/to/abc123?order_id=${data.order_id}`\n }\n }\n];"
},
"typeVersion": 2
},
{
"id": "24ad8831-5541-4503-9fef-6e8109e9bbd5",
"name": "Should Send Survey?",
"type": "n8n-nodes-base.if",
"position": [
2016,
192
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "bc18583d-b8bd-42d5-9569-7e5362b8bd6c",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.shouldSend }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "f277d3bd-90ac-4b48-8099-dc5dc3c06e86",
"name": "Delay Before Survey Send",
"type": "n8n-nodes-base.wait",
"position": [
2432,
176
],
"parameters": {
"unit": "hours",
"amount": 4
},
"typeVersion": 1.1
},
{
"id": "33701e25-d409-4353-95ab-27e2868750ee",
"name": "Build Survey Email Content",
"type": "n8n-nodes-base.set",
"position": [
2800,
176
],
"parameters": {
"values": {
"string": [
{
"name": "message",
"value": "=<p>Hi {{$json.name}},</p>\n\n<p>We hope your order arrived safely \ud83c\udf89</p>\n\n<p>Could you take 20 seconds to share your experience?</p>\n\n<p>\n<a href=\"{{ $('Determine Survey Eligibility').item.json.survey_link }}\">\ud83d\udc49 Give Feedback</a>\n</p>\n\n<p>Thanks,<br>Webline India</p>"
},
{
"name": "subject",
"value": "How was your delivery experience?"
},
{
"name": "survey_link",
"value": "={{ $('Determine Survey Eligibility').item.json.survey_link }}"
}
]
},
"options": {}
},
"typeVersion": 2
},
{
"id": "84cdcf66-b906-4b04-95bb-cbe94d7cbac4",
"name": "Send Survey Email (Gmail)",
"type": "n8n-nodes-base.gmail",
"position": [
3024,
176
],
"parameters": {
"sendTo": "={{ $json.email }}",
"message": "={{ $json.message }}",
"options": {},
"subject": "={{ $json.subject }}"
},
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "5e010ecf-0e91-40cd-8814-3e7c89453fdd",
"name": "Save Survey Log to Google Sheets",
"type": "n8n-nodes-base.googleSheets",
"position": [
3424,
176
],
"parameters": {
"columns": {
"value": {
"email": "={{ $('Validate Customer Email').item.json.email }}",
"sent_at": "={{ $now }}",
"order_id": "={{ $('Validate Customer Email').item.json.order_id }}",
"survey_link": "={{ $('Build Survey Email Content').item.json.survey_link }}"
},
"schema": [
{
"id": "order_id",
"type": "string",
"display": true,
"required": false,
"displayName": "order_id",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "email",
"type": "string",
"display": true,
"required": false,
"displayName": "email",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "sent_at",
"type": "string",
"display": true,
"required": false,
"displayName": "sent_at",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "survey_link",
"type": "string",
"display": true,
"required": false,
"displayName": "survey_link",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 84606666,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1b4XQG0yh1s3ZrnYTsKBlnSMNdlYzQt42zJ8DUneVTS8/edit#gid=84606666",
"cachedResultName": "Post-Delivery CSAT Survey"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1b4XQG0yh1s3ZrnYTsKBlnSMNdlYzQt42zJ8DUneVTS8",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1b4XQG0yh1s3ZrnYTsKBlnSMNdlYzQt42zJ8DUneVTS8/edit?usp=drivesdk",
"cachedResultName": "LinkedIn Profile Monitor"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4
},
{
"id": "cf54366a-2d52-46d2-a52a-145fdb6978a1",
"name": "CSAT Response Intake Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
400,
736
],
"parameters": {
"path": "csat-response",
"options": {},
"httpMethod": "POST"
},
"typeVersion": 1
},
{
"id": "f8916d3a-78d8-4fa1-83a9-fda682651eac",
"name": "Validate CSAT Submission",
"type": "n8n-nodes-base.if",
"position": [
624,
736
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "60cb67ce-a008-4fd8-b38d-d2d5115a5395",
"operator": {
"type": "string",
"operation": "exists"
},
"leftValue": "={{ $json.body.order_id }}"
},
{
"id": "e49a56f0-e8ad-42f7-9e26-322d3b133c58",
"operator": {
"type": "number",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json.body.csat_score }}"
}
]
}
},
"typeVersion": 2
},
{
"id": "b98ea872-87e0-4c8a-ae6f-af1dea31a658",
"name": "Locate Order in CSAT Sheet",
"type": "n8n-nodes-base.googleSheets",
"position": [
944,
720
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "={{ $json.body.order_id }}",
"lookupColumn": "order_id"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 84606666,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1b4XQG0yh1s3ZrnYTsKBlnSMNdlYzQt42zJ8DUneVTS8/edit#gid=84606666",
"cachedResultName": "Post-Delivery CSAT Survey"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1b4XQG0yh1s3ZrnYTsKBlnSMNdlYzQt42zJ8DUneVTS8",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1b4XQG0yh1s3ZrnYTsKBlnSMNdlYzQt42zJ8DUneVTS8/edit?usp=drivesdk",
"cachedResultName": "LinkedIn Profile Monitor"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4
},
{
"id": "15644fdc-5804-45a8-bb18-f684da7d692d",
"name": "Update CSAT Record",
"type": "n8n-nodes-base.googleSheets",
"position": [
1152,
720
],
"parameters": {
"columns": {
"value": {
"feedback": "={{ $('Validate CSAT Submission').item.json.body.feedback }}",
"order_id": "={{ $json.order_id }}",
"csat_score": "={{ $('Validate CSAT Submission').item.json.body.csat_score }}",
"row_number": 0
},
"schema": [
{
"id": "order_id",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "order_id",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "email",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "email",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "sent_at",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "sent_at",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "survey_link",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "survey_link",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "csat_score",
"type": "string",
"display": true,
"required": false,
"displayName": "csat_score",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "feedback",
"type": "string",
"display": true,
"required": false,
"displayName": "feedback",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "number",
"display": true,
"removed": false,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"order_id"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 84606666,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1b4XQG0yh1s3ZrnYTsKBlnSMNdlYzQt42zJ8DUneVTS8/edit#gid=84606666",
"cachedResultName": "Post-Delivery CSAT Survey"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1b4XQG0yh1s3ZrnYTsKBlnSMNdlYzQt42zJ8DUneVTS8",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1b4XQG0yh1s3ZrnYTsKBlnSMNdlYzQt42zJ8DUneVTS8/edit?usp=drivesdk",
"cachedResultName": "LinkedIn Profile Monitor"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4
},
{
"id": "22e42e15-e46f-4e9e-a91d-0345615a5098",
"name": "Standardize CSAT Payload",
"type": "n8n-nodes-base.set",
"position": [
1504,
720
],
"parameters": {
"values": {
"number": [
{
"name": "csat_score",
"value": "={{ $('Validate CSAT Submission').item.json.body.csat_score }}"
}
],
"string": [
{
"name": "order_id",
"value": "={{ $json.order_id }}"
},
{
"name": "email",
"value": "={{ $('Validate CSAT Submission').item.json.body.email }}"
},
{
"name": "feedback",
"value": "={{ $('Validate CSAT Submission').item.json.body.feedback }}"
}
]
},
"options": {},
"keepOnlySet": true
},
"typeVersion": 2
},
{
"id": "3fd5fa6f-535b-4f92-9b88-4589f2e7bbdd",
"name": "CSAT Classification Engine",
"type": "n8n-nodes-base.code",
"position": [
1920,
720
],
"parameters": {
"jsCode": "const body = $json.body ?? $json;\n\nconst score = Number(body.csat_score ?? 0);\n\nreturn [\n {\n json: {\n order_id: body.order_id,\n email: body.email,\n feedback: body.feedback || \"\",\n csat_score: score,\n\n // CX intelligence flags\n isLowCSAT: score <= 2,\n isNeutralCSAT: score === 3,\n isHighCSAT: score >= 4,\n\n timestamp: new Date().toISOString()\n }\n }\n];"
},
"typeVersion": 2
},
{
"id": "7b21e666-8353-491c-8995-d6aca5637df4",
"name": "CSAT Routing Switch",
"type": "n8n-nodes-base.switch",
"position": [
2352,
704
],
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "8abede3a-023f-43d2-9fdb-ac74124b3f46",
"operator": {
"type": "boolean",
"operation": "equals"
},
"leftValue": "={{ $json.isLowCSAT }}",
"rightValue": true
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "ab1665bf-c16d-4c0d-92a8-fcf1a715f663",
"operator": {
"type": "boolean",
"operation": "equals"
},
"leftValue": "={{ $json.isNeutralCSAT }}",
"rightValue": true
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "450bbb48-5a46-4f5a-868b-f905cafba999",
"operator": {
"type": "boolean",
"operation": "equals"
},
"leftValue": "={{ $json.isHighCSAT }}",
"rightValue": true
}
]
}
}
]
},
"options": {}
},
"typeVersion": 3.3
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "05a32077-f6af-4dc7-9a74-53665f52381b",
"connections": {
"Extract Order Data": {
"main": [
[
{
"node": "Validate Customer Email",
"type": "main",
"index": 0
}
]
]
},
"Update CSAT Record": {
"main": [
[
{
"node": "Standardize CSAT Payload",
"type": "main",
"index": 0
}
]
]
},
"CSAT Routing Switch": {
"main": [
[
{
"node": "Send Low CSAT Alert (Gmail)",
"type": "main",
"index": 0
}
]
]
},
"Should Send Survey?": {
"main": [
[
{
"node": "Delay Before Survey Send",
"type": "main",
"index": 0
}
]
]
},
"Validate Customer Email": {
"main": [
[
{
"node": "Fetch Sent Survey Records",
"type": "main",
"index": 0
}
]
]
},
"Delay Before Survey Send": {
"main": [
[
{
"node": "Build Survey Email Content",
"type": "main",
"index": 0
}
]
]
},
"Standardize CSAT Payload": {
"main": [
[
{
"node": "CSAT Classification Engine",
"type": "main",
"index": 0
}
]
]
},
"Validate CSAT Submission": {
"main": [
[
{
"node": "Locate Order in CSAT Sheet",
"type": "main",
"index": 0
}
]
]
},
"Validate Delivered Event": {
"main": [
[
{
"node": "Extract Order Data",
"type": "main",
"index": 0
}
]
]
},
"Fetch Sent Survey Records": {
"main": [
[
{
"node": "Determine Survey Eligibility",
"type": "main",
"index": 0
}
]
]
},
"Incoming Delivery Webhook": {
"main": [
[
{
"node": "Validate Delivered Event",
"type": "main",
"index": 0
}
]
]
},
"Send Survey Email (Gmail)": {
"main": [
[
{
"node": "Save Survey Log to Google Sheets",
"type": "main",
"index": 0
}
]
]
},
"Build Survey Email Content": {
"main": [
[
{
"node": "Send Survey Email (Gmail)",
"type": "main",
"index": 0
}
]
]
},
"CSAT Classification Engine": {
"main": [
[
{
"node": "CSAT Routing Switch",
"type": "main",
"index": 0
}
]
]
},
"Locate Order in CSAT Sheet": {
"main": [
[
{
"node": "Update CSAT Record",
"type": "main",
"index": 0
}
]
]
},
"CSAT Response Intake Webhook": {
"main": [
[
{
"node": "Validate CSAT Submission",
"type": "main",
"index": 0
}
]
]
},
"Determine Survey Eligibility": {
"main": [
[
{
"node": "Should Send Survey?",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
gmailOAuth2googleSheetsOAuth2Api
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
> n8n + Gmail + Google Sheets + Typeform
Source: https://n8n.io/workflows/15237/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Automate WhatsApp communication for recruitment agencies with an interactive, structured customer experience. This workflow handles pricing inquiries, request submissions, tracking, complaints, and hu
Code. Uses googleSheets, gmail, supabase, stickyNote. Webhook trigger; 51 nodes.
This template turns Podium's conversation inbox into a full sales CRM with a custom funnel, AI message classification, automated drip follow-ups, daily admin reports, and a live Kanban dashboard. Six
Ticketing Backend automates registration, QR-ticket generation, email delivery, and check-in validation using Google Sheets, Gmail, and a webhook scanner — reducing manual ticket prep from ~3 hours to
Complete Calendly automation that handles confirmations, cancellations and reschedules in a single workflow. WHAT IT DOES: