{
  "name": "AI automate UX feedback: Sentiment & emotion analysis in Google Sheets + OpenAI",
  "nodes": [
    {
      "id": "20d919c3-088c-4748-bf11-31a8f1490c24",
      "name": "When clicking 'Execute workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        1616,
        288
      ]
    },
    {
      "id": "d9064168-bf99-4066-89a7-0dbe19c8f3ae",
      "name": "Fetch Allowed Tags",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2464,
        272
      ]
    },
    {
      "id": "7f0ee6a9-cfd1-449d-96c7-5dcd180fc152",
      "name": "Fetch New Feedbacks",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2464,
        1152
      ]
    },
    {
      "id": "dcf3888e-b2f4-4d35-acc2-48798368aee2",
      "name": "Merge Tags & Feedbacks",
      "type": "n8n-nodes-base.merge",
      "position": [
        3136,
        720
      ]
    },
    {
      "id": "086461e1-dc56-412a-a073-740af265b83e",
      "name": "Attach Tags Array",
      "type": "n8n-nodes-base.set",
      "position": [
        3552,
        736
      ]
    },
    {
      "id": "bce8aee5-89f5-423c-89f9-b6b0705a3d50",
      "name": "Tag Feedbacks with AI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        4784,
        880
      ]
    },
    {
      "id": "ac43582f-ba7e-4941-91d1-e48ecb7e1944",
      "name": "Update Google Sheet (Tagged)",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        5760,
        1024
      ]
    },
    {
      "id": "1234a97c-f663-454c-abd7-9e64b3098ef4",
      "name": "Process Feedbacks in Batches",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        3936,
        848
      ]
    },
    {
      "id": "12824491-a5d8-42ba-b602-5ad577d0108c",
      "name": "Aggregate Batch Items",
      "type": "n8n-nodes-base.code",
      "position": [
        4352,
        864
      ]
    },
    {
      "id": "54ebf56d-27ec-411d-9973-10a717921e47",
      "name": "Split Batch Results",
      "type": "n8n-nodes-base.code",
      "position": [
        5312,
        864
      ]
    },
    {
      "id": "3240b804-444e-42ce-b594-166a7f41db4f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        16
      ],
      "parameters": {
        "width": 768,
        "height": 976,
        "content": "## 💬 **Auto-tag customer feedback in Google Sheets with OpenAI sentiment analysis**\n\nThis workflow automatically tags user feedback stored in Google Sheets using OpenAI with sentiment and emotion anal"
      }
    },
    {
      "id": "22e35300-b79f-4b21-b2fb-47ee274141e2",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        1600,
        832
      ]
    },
    {
      "id": "beb9af83-71d0-4cf1-8c33-3d891564d0ba",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2240,
        80
      ],
      "parameters": {
        "width": 560,
        "height": 352,
        "content": "### 🏷️ **Fetch Allowed Tags**\n\nReads the list of available tag names from your **Tags Sheet**.  \nEach tag is stored in an array and later passed to OpenAI as `allowed_tags`.\n\n✅ Make sure your Tags she"
      }
    },
    {
      "id": "cc4985d4-7dfd-4efb-965c-125f3ed881c9",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2256,
        672
      ],
      "parameters": {
        "width": 560,
        "height": 656,
        "content": "## 💬 **Fetch New Feedbacks**\n\nReads feedback entries from **Feedbacks Sheet** where `Status` is empty.\n\n### Expected Columns\n- **Feedbacks:** The feedback text\n- **Status:** Empty = new | \"Updated\" = "
      }
    },
    {
      "id": "f91dc3c9-4fc3-4f78-8cc2-f0e4a777d2e5",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4656,
        544
      ],
      "parameters": {
        "width": 448,
        "height": 480,
        "content": "## 🤖 **Tag Feedbacks with OpenAI**\n\nSends entire batch (10 items) as ONE OpenAI request. 🚀\n\n**Output per feedback:**\n- Up to 3 tags from allowed_tags (preferred)\n- Up to 2 AI-generated tags (fallback "
      }
    },
    {
      "id": "a8f0f7a3-2c1a-4e8f-a2f0-295cf7332b24",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5648,
        656
      ],
      "parameters": {
        "width": 336,
        "height": 576,
        "content": "## 📊 **Update Google Sheet (Tagged)**\n\nUpdates **Feedbacks Sheet** with:\n- `Tag 1-3` (from allowed list)\n- `AI Tag 1-2` (fallback tags)\n- `Sentiment`\n- `Primary Emotion` & `Secondary Emotion`\n- `Statu"
      }
    },
    {
      "id": "1a484a39-d4ad-4bb5-8a91-81aea0b218f1",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3840,
        544
      ],
      "parameters": {
        "width": 320,
        "height": 480,
        "content": "## 🔁 **Split In Batches**\n\nBreaks large feedback lists into smaller batches to avoid API rate limits.  \nAfter each batch is processed, the loop continues automatically until all rows are tagged.\n\n💡 De"
      }
    },
    {
      "id": "e97af0f1-1446-4c9a-9363-cb2674a1d211",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3040,
        368
      ],
      "parameters": {
        "width": 320,
        "height": 512,
        "content": "## 🔗 **Merge Tags & Feedbacks**\n\nThis node combines two input streams:\n- **Input 1:** Feedback items fetched from the Feedbacks Sheet  \n- **Input 2:** Allowed tag list fetched from the Tags Sheet  \n\nM"
      }
    },
    {
      "id": "20a6d6be-273c-48db-9a53-6dab6a0d6318",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3440,
        544
      ],
      "parameters": {
        "width": 320,
        "height": 336,
        "content": "## 🧩 **Attach Tags Array**\n\nAdds the list of tags from the Tags Sheet to each feedback item.  \nThe result includes a field named `tags`, used by OpenAI for tagging."
      }
    },
    {
      "id": "640e7cd5-b2a8-4b5e-9b38-4b0e6f7f583a",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1488,
        80
      ],
      "parameters": {
        "width": 352,
        "height": 368,
        "content": "## 🖱️ **Manual Trigger**\n\nRuns the workflow manually when you click **\"Execute Workflow\"** inside n8n.  \nUse this for quick testing or when setting up new credentials and connections.\n\n💡 Best for test"
      }
    },
    {
      "id": "d9ac75a8-f4e1-463b-83ce-2c41519f38c3",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1488,
        656
      ],
      "parameters": {
        "width": 352,
        "height": 336,
        "content": "## ⏰ **Schedule Trigger**\n\nRuns every **60 minutes** automatically.\n\nProcesses all feedback where Status = empty/blank."
      }
    },
    {
      "id": "9a24cb7c-fd3b-4e74-ab5c-95457d2658c3",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6032,
        1152
      ],
      "parameters": {
        "width": 336,
        "height": 80,
        "content": "**Created by:** [Parhum Khoshbakht](https://www.linkedin.com/in/parhumm/)\nProduct Manager & Leadership Coach"
      }
    },
    {
      "id": "fe170993-5489-4cbf-9489-bd622ca646a3",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4224,
        544
      ],
      "parameters": {
        "width": 336,
        "height": 480,
        "content": "## 📦 **Aggregate Batch Items**\n\n**Collects all feedback items in the current batch and combines them into a single item.**\n\nThis allows us to send all 10 feedbacks (or configured batch size) as ONE re"
      }
    },
    {
      "id": "0ba2d396-07e4-45b5-aebd-7b2b23758630",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5200,
        560
      ],
      "parameters": {
        "width": 336,
        "height": 448,
        "content": "## 🔀 **Split Batch Results**\n\n**Parses the OpenAI response and splits it back into individual feedback items.**\n\nEach item contains:\n- `row_number`: To match with the original Google Sheet row\n- `tags"
      }
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Fetch Allowed Tags",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch New Feedbacks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Attach Tags Array": {
      "main": [
        [
          {
            "node": "Process Feedbacks in Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Allowed Tags": {
      "main": [
        [
          {
            "node": "Merge Tags & Feedbacks",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Fetch New Feedbacks": {
      "main": [
        [
          {
            "node": "Merge Tags & Feedbacks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Batch Results": {
      "main": [
        [
          {
            "node": "Update Google Sheet (Tagged)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Batch Items": {
      "main": [
        [
          {
            "node": "Tag Feedbacks with AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tag Feedbacks with AI": {
      "main": [
        [
          {
            "node": "Split Batch Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Tags & Feedbacks": {
      "main": [
        [
          {
            "node": "Attach Tags Array",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Feedbacks in Batches": {
      "main": [
        [],
        [
          {
            "node": "Aggregate Batch Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Google Sheet (Tagged)": {
      "main": [
        [
          {
            "node": "Process Feedbacks in Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking 'Execute workflow'": {
      "main": [
        [
          {
            "node": "Fetch Allowed Tags",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch New Feedbacks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}