{
  "id": "qCkUvj4OOWU2xYJL",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "The Feedback Sorter",
  "tags": [],
  "nodes": [
    {
      "id": "f4e83430-9431-49c6-8b8f-ad81ed27ba4d",
      "name": "03 | Filter only where status is new",
      "type": "n8n-nodes-base.filter",
      "position": [
        16,
        -224
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "dbb899f6-4038-4507-9a25-d9b99986a45e",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.Status.toLowerCase() }}",
              "rightValue": "new"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "cc3375bd-c4d0-4ad4-b839-1302e5077901",
      "name": "04 | Rating wise Routing",
      "type": "n8n-nodes-base.switch",
      "position": [
        240,
        -240
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Positive Rating",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "af33e875-effd-42dd-a554-336441dff639",
                    "operator": {
                      "type": "number",
                      "operation": "gte"
                    },
                    "leftValue": "={{ $json['Rating'] }}",
                    "rightValue": 4
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Neutral Rating",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "059133eb-0107-4385-9161-4e5c0c1df066",
                    "operator": {
                      "type": "number",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json['Rating'] }}",
                    "rightValue": 3
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Negative Rating",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "60e11b7d-9a51-4599-a29d-2d058142af73",
                    "operator": {
                      "type": "number",
                      "operation": "lte"
                    },
                    "leftValue": "={{ $json['Rating'] }}",
                    "rightValue": 2
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.4
    },
    {
      "id": "aa1e9a3e-a9cc-43dd-b19d-74f5e43ab1ec",
      "name": "05 | Add in Testimonial sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        464,
        -368
      ],
      "parameters": {
        "columns": {
          "value": {
            "Name": "={{ $json.Name }}",
            "Email": "={{ $json.Email }}",
            "Rating": "={{ $json['Rating'] }}",
            "Feedback": "={{ $json.Feedback }}"
          },
          "schema": [
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Feedback",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Feedback",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Rating",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Rating",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1672786444,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ypc-2vZL-xqD3L93EVwsalvBMxsEA9v9K6vRB2qt0s0/edit#gid=1672786444",
          "cachedResultName": "testimoniels"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ypc-2vZL-xqD3L93EVwsalvBMxsEA9v9K6vRB2qt0s0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ypc-2vZL-xqD3L93EVwsalvBMxsEA9v9K6vRB2qt0s0/edit?usp=drivesdk",
          "cachedResultName": "Feedback"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "6c945990-e524-4657-9745-43860965adad",
      "name": "07 | Update status is processed",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        576,
        -224
      ],
      "parameters": {
        "columns": {
          "value": {
            "Name": "={{ $json.Name }}",
            "Status": "Processed"
          },
          "schema": [
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Feedback",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Feedback",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Rating",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Rating",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Name"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ypc-2vZL-xqD3L93EVwsalvBMxsEA9v9K6vRB2qt0s0/edit#gid=0",
          "cachedResultName": "feedback"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ypc-2vZL-xqD3L93EVwsalvBMxsEA9v9K6vRB2qt0s0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ypc-2vZL-xqD3L93EVwsalvBMxsEA9v9K6vRB2qt0s0/edit?usp=drivesdk",
          "cachedResultName": "Feedback"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "3995dacc-ba4f-4f2c-8dd2-7c0e09236f02",
      "name": "02 | Get row from sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -208,
        -224
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ypc-2vZL-xqD3L93EVwsalvBMxsEA9v9K6vRB2qt0s0/edit#gid=0",
          "cachedResultName": "feedback"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ypc-2vZL-xqD3L93EVwsalvBMxsEA9v9K6vRB2qt0s0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ypc-2vZL-xqD3L93EVwsalvBMxsEA9v9K6vRB2qt0s0/edit?usp=drivesdk",
          "cachedResultName": "Feedback"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "0504083e-3dfb-42fc-9015-d827acc9fdc8",
      "name": "06 | Update status is processed",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        688,
        -368
      ],
      "parameters": {
        "columns": {
          "value": {
            "Name": "={{ $json.Name }}",
            "Status": "Processed"
          },
          "schema": [
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Feedback",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Feedback",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Rating",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Rating",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Name"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ypc-2vZL-xqD3L93EVwsalvBMxsEA9v9K6vRB2qt0s0/edit#gid=0",
          "cachedResultName": "feedback"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ypc-2vZL-xqD3L93EVwsalvBMxsEA9v9K6vRB2qt0s0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ypc-2vZL-xqD3L93EVwsalvBMxsEA9v9K6vRB2qt0s0/edit?usp=drivesdk",
          "cachedResultName": "Feedback"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "f9215d46-fbd8-46d9-b252-b0e78316054e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -992,
        -704
      ],
      "parameters": {
        "width": 672,
        "height": 320,
        "content": "## Overview\nThe Feedback Sorter is an automated workflow that processes user feedback from a Google Sheet, categorizes it based on rating, and takes appropriate actions such as storing positive testimonials, notifying support teams for negative feedback, and updating processing status.\n\n### Setup steps \n1. Add your **Google sheets credentials**  and choose appropriate sheet that contain Column like **Name, Email, Feedback, Rating, Status**.\n2. Add your **Slack credentials**  and select appropriate channel.\n3. Activate the workflow  "
      },
      "typeVersion": 1
    },
    {
      "id": "75299c14-39aa-4ae4-ad00-90f94fc0bf4e",
      "name": "01 | Click to Execute workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -432,
        -224
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c0704cf4-ac7e-42ac-8bbc-355059986295",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -560
      ],
      "parameters": {
        "color": 7,
        "width": 496,
        "height": 528,
        "content": "## Handle Positive & Neutral Rating \n- Positive feedback is stored in a testimonial sheet for future use.\n- Helps build social proof and improve brand credibility.\n- After storing, the system updates the original record\u2019s status to \"processed\".\n- Ensures no duplicate processing and maintains clean tracking.\n- Neutral feedback status is directly updated to \u201cProcessed.\u201d"
      },
      "typeVersion": 1
    },
    {
      "id": "4b6da71f-7a4a-494d-aea0-83400570a1e7",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -272,
        -368
      ],
      "parameters": {
        "color": 7,
        "width": 448,
        "height": 320,
        "content": "## Data collection & Filter\nThis section is responsible for fetching feedback data for processing. it reads user feedback entries from the google sheet and filters only those records that are marked as \"new\" status. "
      },
      "typeVersion": 1
    },
    {
      "id": "755503aa-cde0-4554-8163-56a6c3406462",
      "name": "09 | Send to support channel",
      "type": "n8n-nodes-base.slack",
      "position": [
        688,
        112
      ],
      "parameters": {
        "text": "=Negative review by : {{ $json.Name }}\nEmail : {{ $json.Email }}\nRating : {{ $json['Rating'] }}\nFeedback : {{ $json.Feedback }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C0APDQMMZUL",
          "cachedResultName": "support"
        },
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.4
    },
    {
      "id": "9211d74d-044e-42d0-8542-49bf40e35054",
      "name": "10 | Update status is processed",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        912,
        112
      ],
      "parameters": {
        "columns": {
          "value": {
            "Name": "={{ $('04 | Rating wise Routing').item.json.Name }}",
            "Status": "Processed"
          },
          "schema": [
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Feedback",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Feedback",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Rating",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Rating",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Name"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ypc-2vZL-xqD3L93EVwsalvBMxsEA9v9K6vRB2qt0s0/edit#gid=0",
          "cachedResultName": "feedback"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ypc-2vZL-xqD3L93EVwsalvBMxsEA9v9K6vRB2qt0s0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ypc-2vZL-xqD3L93EVwsalvBMxsEA9v9K6vRB2qt0s0/edit?usp=drivesdk",
          "cachedResultName": "Feedback"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "08869745-e957-43a7-b6b1-f4e7d9b5d5bf",
      "name": "08 | Required field for slack message",
      "type": "n8n-nodes-base.set",
      "position": [
        448,
        112
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "bf801e32-3da1-4316-8875-f490143b6189",
              "name": "Name",
              "type": "string",
              "value": "={{ $json.Name }}"
            },
            {
              "id": "a016d6c1-10f3-4f8c-8ea7-875eb919e7bf",
              "name": "Email",
              "type": "string",
              "value": "={{ $json.Email }}"
            },
            {
              "id": "19fcea70-2ff3-4637-a2cf-41953a0cae6a",
              "name": "Feedback",
              "type": "string",
              "value": "={{ $json.Feedback }}"
            },
            {
              "id": "916e2f34-5a3d-4639-b253-64ee921a77a0",
              "name": "Rating",
              "type": "number",
              "value": "={{ $json['Rating'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "222554da-2e44-47dc-88b5-452c954f524a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 672,
        "height": 304,
        "content": "## Handle Negative Rating\n- A message is prepared and sent to the support team via Slack.\n- After sending the  message, the feedback entry is marked as \"processed\" in the sheet."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "8c2a77b4-b95c-43e6-b6c2-a698ce2ee9e7",
  "connections": {
    "02 | Get row from sheet": {
      "main": [
        [
          {
            "node": "03 | Filter only where status is new",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "04 | Rating wise Routing": {
      "main": [
        [
          {
            "node": "05 | Add in Testimonial sheet",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "07 | Update status is processed",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "08 | Required field for slack message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "09 | Send to support channel": {
      "main": [
        [
          {
            "node": "10 | Update status is processed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "05 | Add in Testimonial sheet": {
      "main": [
        [
          {
            "node": "06 | Update status is processed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "01 | Click to Execute workflow": {
      "main": [
        [
          {
            "node": "02 | Get row from sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "03 | Filter only where status is new": {
      "main": [
        [
          {
            "node": "04 | Rating wise Routing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "08 | Required field for slack message": {
      "main": [
        [
          {
            "node": "09 | Send to support channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}