{
  "name": "Analyze customer feedback and send AI-written replies with GPT-4 and Gmail",
  "nodes": [
    {
      "id": "2c6ee587-863e-4b52-881a-1703d0e92781",
      "name": "Event Ingestion Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1264,
        368
      ]
    },
    {
      "id": "e4555d99-a196-49cc-8785-336c28d6d744",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -1088,
        368
      ]
    },
    {
      "id": "66c08b6c-e81f-4abf-8545-a179d9ce210d",
      "name": "Event Normalization",
      "type": "n8n-nodes-base.code",
      "position": [
        -896,
        368
      ]
    },
    {
      "id": "3c85abc9-3a50-422e-ad34-9fbd88b8c4ec",
      "name": "Check Deduplication Cache",
      "type": "n8n-nodes-base.redis",
      "position": [
        -672,
        368
      ]
    },
    {
      "id": "0845f236-cb60-4e52-abcd-96b3d7c07469",
      "name": "Is Duplicate Event?",
      "type": "n8n-nodes-base.if",
      "position": [
        -448,
        368
      ]
    },
    {
      "id": "866988d6-95b3-4ff8-839b-77065b7f89df",
      "name": "Store Event in Cache",
      "type": "n8n-nodes-base.redis",
      "position": [
        -224,
        368
      ]
    },
    {
      "id": "cbc5fb5c-4cae-44ad-8be0-db8646832454",
      "name": "Fetch Historical Interactions",
      "type": "n8n-nodes-base.postgres",
      "position": [
        16,
        224
      ]
    },
    {
      "id": "00d90391-0b48-4bfc-a5ca-09c761267d25",
      "name": "Fetch Feature Store Data",
      "type": "n8n-nodes-base.postgres",
      "position": [
        16,
        512
      ]
    },
    {
      "id": "148e99ff-3b6e-4ea2-a0d6-13df10c58098",
      "name": "Fetch Segmentation Rules",
      "type": "n8n-nodes-base.postgres",
      "position": [
        16,
        704
      ]
    },
    {
      "id": "56d38ece-fe18-41c4-8ec0-90219548b7bf",
      "name": "Merge Enrichment Data",
      "type": "n8n-nodes-base.merge",
      "position": [
        240,
        288
      ]
    },
    {
      "id": "92566206-09f8-459a-b0c6-6760fc2bf155",
      "name": "Intent & Sentiment Analysis Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        464,
        288
      ]
    },
    {
      "id": "a862a15b-572f-4ef1-9ad0-82b8b1bc16dc",
      "name": "OpenAI GPT-4 Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        480,
        512
      ]
    },
    {
      "id": "d5c4c02c-3c81-47f9-8ef4-b7de5e6be7b9",
      "name": "Analysis Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        608,
        512
      ]
    },
    {
      "id": "c763e1ec-afb3-4e04-bbe2-d673ba45493e",
      "name": "Calculate Priority Score",
      "type": "n8n-nodes-base.code",
      "position": [
        816,
        288
      ]
    },
    {
      "id": "2f7e9bad-ad72-4afc-aacf-e21bc975536b",
      "name": "Route by Priority & Intent",
      "type": "n8n-nodes-base.switch",
      "position": [
        1040,
        240
      ]
    },
    {
      "id": "f8ebc0aa-486d-4fbd-8af5-82e9c2f979c2",
      "name": "Check Rate Limit",
      "type": "n8n-nodes-base.redis",
      "position": [
        1264,
        288
      ]
    },
    {
      "id": "a7728ed0-fb0a-4ba9-86f1-6e8b3977b801",
      "name": "Rate Limit Exceeded?",
      "type": "n8n-nodes-base.if",
      "position": [
        1488,
        288
      ]
    },
    {
      "id": "1021d7e9-d34b-4368-90b8-c7866c025702",
      "name": "Check Cross-Channel Suppression",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1712,
        288
      ]
    },
    {
      "id": "e707a13f-f0e1-4439-884f-62656d42d166",
      "name": "Is Suppressed?",
      "type": "n8n-nodes-base.if",
      "position": [
        1936,
        288
      ]
    },
    {
      "id": "87e222ac-2e4a-4b3f-9f10-c903d9deb319",
      "name": "Decision Policy Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2160,
        288
      ]
    },
    {
      "id": "5dfb979d-19bf-42e5-a564-4e6450960a7f",
      "name": "OpenAI GPT-4 Decision Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2176,
        512
      ]
    },
    {
      "id": "ad687107-02dc-456f-ac53-428ead7914ce",
      "name": "Decision Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        2304,
        512
      ]
    },
    {
      "id": "df1f3a30-5875-4b0b-8cb4-1402c042f283",
      "name": "Route by Action Type",
      "type": "n8n-nodes-base.switch",
      "position": [
        2512,
        256
      ]
    },
    {
      "id": "61b317ce-8c42-4ec6-90b8-568c701c3cde",
      "name": "Send Marketing Email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        2736,
        0
      ]
    },
    {
      "id": "5ed62f6c-5103-4dbe-a131-6e777332febe",
      "name": "Create Salesforce Lead",
      "type": "n8n-nodes-base.salesforce",
      "position": [
        2736,
        192
      ]
    },
    {
      "id": "d6374482-0ae6-4f69-b3da-4ee252a3994a",
      "name": "Update HubSpot Contact",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        2736,
        384
      ]
    },
    {
      "id": "094a7e1e-dbae-4df3-8986-24cd8bda4bbc",
      "name": "Send Support Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        2736,
        576
      ]
    },
    {
      "id": "2a6cc13d-dba7-401d-8066-6b9367b400f9",
      "name": "Aggregate Action Results",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2960,
        192
      ]
    },
    {
      "id": "08cad6d0-577a-4dd4-aa73-66bb4d7c3de8",
      "name": "Log Decision Provenance",
      "type": "n8n-nodes-base.postgres",
      "position": [
        3184,
        192
      ]
    },
    {
      "id": "17a8790b-b773-4efe-adb1-5cc58f0c193e",
      "name": "Store Outcome for Feedback Loop",
      "type": "n8n-nodes-base.postgres",
      "position": [
        3408,
        192
      ]
    },
    {
      "id": "0556b703-ae3b-42dc-9a32-78a23677bd62",
      "name": "Update Analytics Dashboard",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3632,
        192
      ]
    },
    {
      "id": "4a26850d-5231-4767-b2bd-b52d8d3415d6",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        -272
      ],
      "parameters": {
        "width": 496,
        "height": 336,
        "content": "## Prerequisites\nOpenAI API key, Anthropic Claude API key (optional), Google Workspace account (Sheets, Gmail)\n## Use Cases\nProduct feedback management, customer support automation\n## Customization\nAd"
      }
    },
    {
      "id": "201501f0-c974-4f14-9ed1-de784fd2b819",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        -224
      ],
      "parameters": {
        "width": 486,
        "height": 304,
        "content": "## Setup Steps\n1. Configure webhook trigger URL for feedback form integration or email parsing\n2. Add OpenAI API key for sentiment analysis and response generation\n3. Connect Anthropic Claude API for "
      }
    },
    {
      "id": "0a61d913-edfd-4ed0-ae75-a8f3ef2e218f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1184,
        -144
      ],
      "parameters": {
        "width": 800,
        "height": 208,
        "content": "## How It Works\nThis workflow automates customer feedback processing by analyzing sentiment, identifying key issues, generating personalized responses, and escalating critical cases to support teams w"
      }
    },
    {
      "id": "8c88245a-0ea5-4e06-8947-ad801f0e1e5c",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2112,
        96
      ],
      "parameters": {
        "width": 368,
        "height": 768,
        "content": "## Contextual AI Response Generation\n**Why:** Creates personalized, empathetic responses using customer history and feedback context, maintaining brand voice while addressing specific concerns raised "
      }
    },
    {
      "id": "a83c1f53-1b6a-40d4-aa56-79e8a0c85f27",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        432,
        96
      ],
      "parameters": {
        "width": 1664,
        "height": 784,
        "content": "## Parallel Sentiment & Topic Analysis\n**Why:** Simultaneously evaluates emotional tone, identifies key themes, and assesses urgency using AI models, enabling intelligent routing and response prioriti"
      }
    },
    {
      "id": "7d687871-574a-41ae-91e6-7348a4a5f7a4",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        96
      ],
      "parameters": {
        "width": 1744,
        "height": 832,
        "content": "## Feedback Ingestion & Data Normalization\n**Why:** Captures feedback from multiple sources (forms, emails, surveys), standardizes data structure, and enriches with metadata for consistent downstream "
      }
    },
    {
      "id": "e7b964fb-bb89-49e6-bf1b-e7669e13c851",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2496,
        -128
      ],
      "parameters": {
        "width": 1376,
        "height": 1040,
        "content": "\n## Smart Escalation & Automated Distribution\n**Why:** Routes negative sentiment or complex issues to human agents via support tickets while sending standard responses automatically, optimizing resour"
      }
    }
  ],
  "connections": {
    "Is Suppressed?": {
      "main": [
        [],
        [
          {
            "node": "Decision Policy Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Rate Limit": {
      "main": [
        [
          {
            "node": "Rate Limit Exceeded?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI GPT-4 Model": {
      "ai_languageModel": [
        [
          {
            "node": "Intent & Sentiment Analysis Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Send Support Alert": {
      "main": [
        [
          {
            "node": "Aggregate Action Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Event Normalization": {
      "main": [
        [
          {
            "node": "Check Deduplication Cache",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Duplicate Event?": {
      "main": [
        [],
        [
          {
            "node": "Store Event in Cache",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rate Limit Exceeded?": {
      "main": [
        [],
        [
          {
            "node": "Check Cross-Channel Suppression",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Action Type": {
      "main": [
        [
          {
            "node": "Send Marketing Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create Salesforce Lead",
            "type": "main",
            "index": 0
          },
          {
            "node": "Update HubSpot Contact",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Support Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Marketing Email": {
      "main": [
        [
          {
            "node": "Aggregate Action Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store Event in Cache": {
      "main": [
        [
          {
            "node": "Merge Enrichment Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Historical Interactions",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Feature Store Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Segmentation Rules",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Decision Policy Agent": {
      "main": [
        [
          {
            "node": "Route by Action Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Enrichment Data": {
      "main": [
        [
          {
            "node": "Intent & Sentiment Analysis Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analysis Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Intent & Sentiment Analysis Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Create Salesforce Lead": {
      "main": [
        [
          {
            "node": "Aggregate Action Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Decision Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Decision Policy Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Update HubSpot Contact": {
      "main": [
        [
          {
            "node": "Aggregate Action Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Event Normalization",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Event Ingestion Webhook": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Decision Provenance": {
      "main": [
        [
          {
            "node": "Store Outcome for Feedback Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Action Results": {
      "main": [
        [
          {
            "node": "Log Decision Provenance",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Priority Score": {
      "main": [
        [
          {
            "node": "Route by Priority & Intent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Deduplication Cache": {
      "main": [
        [
          {
            "node": "Is Duplicate Event?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Priority & Intent": {
      "main": [
        [
          {
            "node": "Check Rate Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI GPT-4 Decision Model": {
      "ai_languageModel": [
        [
          {
            "node": "Decision Policy Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Historical Interactions": {
      "main": [
        [
          {
            "node": "Merge Enrichment Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Check Cross-Channel Suppression": {
      "main": [
        [
          {
            "node": "Is Suppressed?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store Outcome for Feedback Loop": {
      "main": [
        [
          {
            "node": "Update Analytics Dashboard",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Intent & Sentiment Analysis Agent": {
      "main": [
        [
          {
            "node": "Calculate Priority Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}