{
  "name": "Form Response Sentiment Scoring",
  "nodes": [
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "documentId": {
          "__rl": true,
          "value": "1SteLTI7BsgS8f3XcOIS6m7VJrsqdfMsHDsk0G5F_SdI",
          "mode": "list",
          "cachedResultName": "Customer Feedback"
        },
        "sheetName": {
          "__rl": true,
          "value": 70574972,
          "mode": "list",
          "cachedResultName": "Form Responses 3"
        },
        "event": "rowAdded",
        "options": {}
      },
      "id": "64abf855-b568-41d3-8628-58b7d0f7e69c",
      "name": "Google Sheet Trigger",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "typeVersion": 1,
      "position": [
        -80,
        80
      ],
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "id": "n9Gd4hxRGTalH4em",
          "name": "Google Sheets Trigger account"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1SteLTI7BsgS8f3XcOIS6m7VJrsqdfMsHDsk0G5F_SdI",
          "mode": "list",
          "cachedResultName": "Customer Feedback"
        },
        "sheetName": {
          "__rl": true,
          "value": 70574972,
          "mode": "list",
          "cachedResultName": "Form Responses 3"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Email": "={{ $('Google Sheet Trigger').item.json.Email }}",
            "Sentiment": "={{ $json.message.content }}"
          },
          "matchingColumns": [
            "Email"
          ],
          "schema": [
            {
              "id": "Timestamp",
              "displayName": "Timestamp",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Name",
              "displayName": "Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Email",
              "displayName": "Email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "feedback",
              "displayName": "feedback",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "Sentiment",
              "displayName": "Sentiment",
              "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": "string",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        480,
        80
      ],
      "id": "3631ab59-a710-426d-b812-3047330e1e9e",
      "name": "Update Sentiment",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "Pjxuoti0ywJ2OIzZ",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list",
          "cachedResultName": "GPT-4O-MINI"
        },
        "messages": {
          "values": [
            {
              "content": "=You are a helpful AI assistant. A user submitted the following feedback: \"{{ $json.feedback }}\". Please analyze the sentiment of this feedback and tell me in one word it is positive, neutral or negative."
            }
          ]
        },
        "options": {}
      },
      "id": "edaa2d09-9040-4374-a8af-c8c0941d3f28",
      "name": "Sentiment Analysis from OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        120,
        80
      ],
      "credentials": {
        "openAiApi": {
          "id": "xYObejx0eIkwMS86",
          "name": "OpenAI account"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "Google Sheet Trigger": {
      "main": [
        [
          {
            "node": "Sentiment Analysis from OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sentiment Analysis from OpenAI": {
      "main": [
        [
          {
            "node": "Update Sentiment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "aecd558a-62ac-4207-8fa1-90ed237d5e0e",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "f1c26778ec36097a9722a22c47c5e9c01f00b8862dadd0121ec118026a370fa6"
  },
  "id": "6kXAnAZztjC75MVZ"
}