{
  "name": "Customer Feedback Handler",
  "nodes": [
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "documentId": {
          "__rl": true,
          "value": "1GNQIPkvCxuyiPsDWpinSQnr1RLc5IDUZELdVFX7czmw",
          "mode": "list",
          "cachedResultName": "CAFE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1GNQIPkvCxuyiPsDWpinSQnr1RLc5IDUZELdVFX7czmw/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1346769250,
          "mode": "list",
          "cachedResultName": "Customer Feedback",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1GNQIPkvCxuyiPsDWpinSQnr1RLc5IDUZELdVFX7czmw/edit#gid=1346769250"
        },
        "event": "rowAdded",
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "id": "15210a69-0d62-4d55-b616-6fcf0818180a",
      "name": "Google Sheets Trigger",
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "f315f18c-0c95-40cd-ab71-83668c8da036",
              "leftValue": "={{ $json['How would you rate your visit? '] }}",
              "rightValue": 2,
              "operator": {
                "type": "number",
                "operation": "lte"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        208,
        0
      ],
      "id": "cd9bde7b-5dbe-4077-95e3-bdaebf3d5381",
      "name": "Rating Is Negative?"
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "C0BKV5YBFH6",
          "mode": "id"
        },
        "text": "=\u26a0\ufe0f New negative feedback received Rating: {{ $json['How would you rate your visit? '] }}/5 \nComment: {{ $json['  Anything you\\'d like to share? (optional)  '] }} \nTime: {{ $json['Timestamp'] }}",
        "otherOptions": {}
      },
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.5,
      "position": [
        416,
        -96
      ],
      "id": "27d231eb-5486-4441-b6fe-2415b86a5d2d",
      "name": "Send a message",
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1GNQIPkvCxuyiPsDWpinSQnr1RLc5IDUZELdVFX7czmw",
          "mode": "list",
          "cachedResultName": "CAFE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1GNQIPkvCxuyiPsDWpinSQnr1RLc5IDUZELdVFX7czmw/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1346769250,
          "mode": "list",
          "cachedResultName": "Customer Feedback",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1GNQIPkvCxuyiPsDWpinSQnr1RLc5IDUZELdVFX7czmw/edit#gid=1346769250"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Timestamp": "={{ $('Google Sheets Trigger').item.json.Timestamp }}",
            "Alert sent": "YES"
          },
          "matchingColumns": [
            "Timestamp"
          ],
          "schema": [
            {
              "id": "Timestamp",
              "displayName": "Timestamp",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "How would you rate your visit? ",
              "displayName": "How would you rate your visit? ",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "  Anything you'd like to share? (optional)  ",
              "displayName": "  Anything you'd like to share? (optional)  ",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Alert sent",
              "displayName": "Alert sent",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        624,
        -96
      ],
      "id": "1a89f636-beb4-4897-ac20-ce3c403b27e2",
      "name": "Update row in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Google Sheets Trigger": {
      "main": [
        [
          {
            "node": "Rating Is Negative?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rating Is Negative?": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message": {
      "main": [
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false
  },
  "versionId": "883b46ab-3da9-4100-93b5-21f9ed4dc6ba",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodeGroups": [],
  "id": "MPwBI8lqYk1YdMtt",
  "tags": []
}