{
  "name": "Route AI-powered customer support via email and Slack with PostgreSQL and Google Sheets",
  "nodes": [
    {
      "id": "97c3d1fa-9857-44e2-ae12-170c3fce8b62",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4688,
        1216
      ],
      "parameters": {
        "width": 440,
        "height": 808,
        "content": "## Automate intelligent customer support responses with AI and Slack\n\n### How it works\n1. **Receive request** via webhook with customer question\n2. **Analyze sentiment** and detect urgency using JavaS"
      }
    },
    {
      "id": "d0bd5bbb-8b47-4c11-a3ad-d80d181d7781",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5318,
        1368
      ],
      "parameters": {
        "width": 820,
        "height": 280,
        "content": "## Intake & Analysis\n\nReceives customer requests, extracts data, and analyzes sentiment/urgency to determine handling priority."
      }
    },
    {
      "id": "00089b7e-e250-49e6-b687-e8caa381c7ce",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6160,
        1296
      ],
      "parameters": {
        "width": 500,
        "height": 344,
        "content": "## Urgency Routing\n\nSends immediate Slack alerts for urgent cases (negative sentiment or urgent keywords), then merges paths to continue workflow."
      }
    },
    {
      "id": "649f76b7-3f55-4d4c-bd92-71ad0a2cbe3a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6786,
        1368
      ],
      "parameters": {
        "width": 1020,
        "height": 280,
        "content": "## Context Building & AI Response\n\nFetches conversation history, searches knowledge base, builds AI context, and generates intelligent responses with confidence scoring."
      }
    },
    {
      "id": "4fff7600-8288-423c-b3ff-c31bb7f75182",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        7904,
        1280
      ],
      "parameters": {
        "width": 740,
        "height": 424,
        "content": "## Smart Routing & Delivery\n\nAnalyzes response quality and decides: auto-respond via email OR escalate to support team via Slack based on confidence score and priority."
      }
    },
    {
      "id": "81fd500f-b6a3-4181-a423-27b2ffab280d",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        8656,
        1360
      ],
      "parameters": {
        "width": 760,
        "height": 280,
        "content": "## Logging & Response\n\nLogs all interactions to Google Sheets and PostgreSQL for analytics, then sends structured API response with metadata."
      }
    },
    {
      "id": "8ade0c3c-2940-4057-8e66-b4c68bb357c0",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "position": [
        5344,
        1488
      ]
    },
    {
      "id": "519c4d0c-3d9b-49b1-aeff-80533846c928",
      "name": "Extract & Enrich Data",
      "type": "n8n-nodes-base.set",
      "position": [
        5568,
        1488
      ]
    },
    {
      "id": "ff46a5c0-4f3a-4a82-8166-9c0d07bcd879",
      "name": "Sentiment & Context Analysis",
      "type": "n8n-nodes-base.code",
      "position": [
        5792,
        1488
      ]
    },
    {
      "id": "d4f0a17e-a39a-4aa0-ba3a-b966e4daf621",
      "name": "Urgency Check",
      "type": "n8n-nodes-base.if",
      "position": [
        6016,
        1488
      ]
    },
    {
      "id": "be626954-1b67-4949-853b-7895a97435d4",
      "name": "Send Urgent Alert",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        6240,
        1416
      ]
    },
    {
      "id": "748e4c16-6c42-4a24-8159-e9d0ca4c08c5",
      "name": "Merge After Urgency",
      "type": "n8n-nodes-base.merge",
      "position": [
        6464,
        1488
      ]
    },
    {
      "id": "b70fd79f-6445-4978-9482-4712533f0c1e",
      "name": "Fetch Conversation History",
      "type": "n8n-nodes-base.postgres",
      "position": [
        6688,
        1488
      ]
    },
    {
      "id": "b556035b-feeb-4cd4-8ff6-30d816abb61f",
      "name": "Search Knowledge Base",
      "type": "n8n-nodes-base.code",
      "position": [
        6912,
        1488
      ]
    },
    {
      "id": "b5132f09-072b-46e8-98a9-e28ff3eeebaa",
      "name": "Build AI Context",
      "type": "n8n-nodes-base.code",
      "position": [
        7136,
        1488
      ]
    },
    {
      "id": "c8f42c73-bd2a-4f19-99bf-bb9d19961549",
      "name": "AI Response Generator",
      "type": "n8n-nodes-base.code",
      "position": [
        7360,
        1488
      ]
    },
    {
      "id": "9a826727-8466-4099-b8dd-dd7e4130bd84",
      "name": "Process & Analyze Response",
      "type": "n8n-nodes-base.code",
      "position": [
        7584,
        1488
      ]
    },
    {
      "id": "0afc78ac-509f-4a9b-a183-bf97fdebab25",
      "name": "Routing Decision",
      "type": "n8n-nodes-base.if",
      "position": [
        7808,
        1488
      ]
    },
    {
      "id": "6c741000-e1d9-46bb-8148-9e688517f69a",
      "name": "Slack Escalation",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        8032,
        1392
      ]
    },
    {
      "id": "58bb256c-d358-4c2e-b3f1-a1f2c8cfd878",
      "name": "Send Auto Response",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        8032,
        1584
      ]
    },
    {
      "id": "07f7566e-2222-4202-b77e-eb37a9aa42e8",
      "name": "Merge After Routing",
      "type": "n8n-nodes-base.merge",
      "position": [
        8256,
        1488
      ]
    },
    {
      "id": "2cf2d1e3-b1bc-4985-a85a-52470963dd0c",
      "name": "Log to Analytics Dashboard",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        8480,
        1488
      ]
    },
    {
      "id": "11f74c26-387e-4510-8691-047eeb7d87cc",
      "name": "Save to Database",
      "type": "n8n-nodes-base.postgres",
      "position": [
        8704,
        1488
      ]
    },
    {
      "id": "239c977d-4942-4b8e-88ab-d4beabc04c75",
      "name": "Send API Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        8928,
        1488
      ]
    }
  ],
  "connections": {
    "Urgency Check": {
      "main": [
        [
          {
            "node": "Send Urgent Alert",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge After Urgency",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "Extract & Enrich Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build AI Context": {
      "main": [
        [
          {
            "node": "AI Response Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Routing Decision": {
      "main": [
        [
          {
            "node": "Slack Escalation",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Auto Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save to Database": {
      "main": [
        [
          {
            "node": "Send API Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Slack Escalation": {
      "main": [
        [
          {
            "node": "Merge After Routing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Urgent Alert": {
      "main": [
        [
          {
            "node": "Merge After Urgency",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Auto Response": {
      "main": [
        [
          {
            "node": "Merge After Routing",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge After Routing": {
      "main": [
        [
          {
            "node": "Log to Analytics Dashboard",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge After Urgency": {
      "main": [
        [
          {
            "node": "Fetch Conversation History",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Response Generator": {
      "main": [
        [
          {
            "node": "Process & Analyze Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract & Enrich Data": {
      "main": [
        [
          {
            "node": "Sentiment & Context Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Knowledge Base": {
      "main": [
        [
          {
            "node": "Build AI Context",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Conversation History": {
      "main": [
        [
          {
            "node": "Search Knowledge Base",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log to Analytics Dashboard": {
      "main": [
        [
          {
            "node": "Save to Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process & Analyze Response": {
      "main": [
        [
          {
            "node": "Routing Decision",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sentiment & Context Analysis": {
      "main": [
        [
          {
            "node": "Urgency Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}