{
  "name": "Automate customer support with Mintlify documentation & Zendesk AI agent",
  "nodes": [
    {
      "id": "79ff2d59-8fac-42cd-a61b-0f87723af80a",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        3256,
        420
      ]
    },
    {
      "id": "1322e147-e25f-476e-9823-1898c5ec0e82",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        3344,
        640
      ]
    },
    {
      "id": "9769ad77-a395-4251-b45e-aa817482d821",
      "name": "Message router",
      "type": "n8n-nodes-base.switch",
      "position": [
        1496,
        99
      ]
    },
    {
      "id": "ccc9a63b-d5ed-460f-be44-0bb62a8439d0",
      "name": "New ticket?",
      "type": "n8n-nodes-base.switch",
      "position": [
        1936,
        420
      ]
    },
    {
      "id": "1a448d28-8c30-4aaf-b6c2-6c15ac7a1544",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -640,
        120
      ]
    },
    {
      "id": "2db01f51-b260-4dbb-ab88-9745612f774b",
      "name": "Parse conversation",
      "type": "n8n-nodes-base.code",
      "position": [
        240,
        220
      ]
    },
    {
      "id": "4d7ab1c4-73fc-4894-ab8c-3b27a4e3ec28",
      "name": "Look for Mintlify topicId",
      "type": "n8n-nodes-base.code",
      "position": [
        1716,
        420
      ]
    },
    {
      "id": "70fd61ed-65a2-4d80-b419-c8dac980649c",
      "name": "Add Mintlify topicID to ticket",
      "type": "n8n-nodes-base.code",
      "position": [
        2596,
        320
      ]
    },
    {
      "id": "059f2573-2a5c-464e-8114-cb08cd7b11b3",
      "name": "Create Mintlify Chat Topic",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2156,
        320
      ]
    },
    {
      "id": "7b561eb4-add1-43d2-8957-8fe684e257e2",
      "name": "Add Mintlify topicId to ticket tags",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2376,
        320
      ]
    },
    {
      "id": "d499662f-be7a-4319-bbae-5a5e5477cc54",
      "name": "Delete ticket",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1716,
        20
      ]
    },
    {
      "id": "f0d52e9e-034a-452d-81a9-7904d62f6114",
      "name": "Check if human agent is assigned",
      "type": "n8n-nodes-base.switch",
      "position": [
        -200,
        120
      ]
    },
    {
      "id": "d2ebc6e6-f164-40ee-8910-6a1c3bc85f70",
      "name": "If human assigned, don't reply",
      "type": "n8n-nodes-base.noOp",
      "position": [
        20,
        20
      ]
    },
    {
      "id": "439d7ac6-5335-4660-a94f-b4f5f616f335",
      "name": "OpenRouter Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        3940,
        640
      ]
    },
    {
      "id": "d8a6bb45-beaf-41dc-b615-34e58d22f447",
      "name": "Check uncertainty",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        3852,
        420
      ]
    },
    {
      "id": "78d023f3-71b4-49a4-885a-197862b29c9b",
      "name": "If more that x replies, don't reply",
      "type": "n8n-nodes-base.noOp",
      "position": [
        900,
        320
      ]
    },
    {
      "id": "aad3ff45-fc88-4400-90f2-6a46972da86d",
      "name": "If uncertain, don't reply",
      "type": "n8n-nodes-base.noOp",
      "position": [
        4448,
        320
      ]
    },
    {
      "id": "ee1525fc-e2b3-4a0f-a5eb-3347e48c0f08",
      "name": "OpenRouter Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1208,
        340
      ]
    },
    {
      "id": "65e03e7e-e86f-495e-9b2e-04ac4e33a40a",
      "name": "Message classifier",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1120,
        120
      ]
    },
    {
      "id": "02612319-2fdf-4c2e-801b-8e374baa9ccf",
      "name": "Uncertainty router",
      "type": "n8n-nodes-base.switch",
      "position": [
        4228,
        420
      ]
    },
    {
      "id": "9b04c360-cb9c-4614-b0ab-15bd936d9243",
      "name": "Billing suspected - escalate",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1716,
        -180
      ]
    },
    {
      "id": "8c3bb2e4-76d6-4be9-b1d7-4d1f9738f682",
      "name": "Fraud suspected - escalate",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1716,
        220
      ]
    },
    {
      "id": "b5292f27-97a5-4e57-a082-6a74f2b31ec0",
      "name": "Mintlify generated response (new)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2816,
        320
      ]
    },
    {
      "id": "c7f53efc-7513-48ba-9ad5-e5a977a181bd",
      "name": "Mintlify generated response (existing)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2816,
        520
      ]
    },
    {
      "id": "e1aa2510-f473-4e23-8d9e-f36d889c97ff",
      "name": "Check how many times the AI replied",
      "type": "n8n-nodes-base.switch",
      "position": [
        680,
        220
      ]
    },
    {
      "id": "9e5a90c0-4a7e-4745-bef2-6f6b8dad3c50",
      "name": "Fetch Zendesk ticket",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -420,
        120
      ]
    },
    {
      "id": "1188f26f-3a37-40aa-b6b8-01dede339b39",
      "name": "Fetch ticket conversation",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        20,
        220
      ]
    },
    {
      "id": "63f16b5d-6ca2-40ca-b4c8-4b5a33b2ef1c",
      "name": "Count AI replies",
      "type": "n8n-nodes-base.code",
      "position": [
        460,
        220
      ]
    },
    {
      "id": "ced12732-e0ba-4787-a8ea-0b5673567f80",
      "name": "Flip conversation to get the last message",
      "type": "n8n-nodes-base.code",
      "position": [
        900,
        120
      ]
    },
    {
      "id": "c7994f00-1ef5-4c40-abff-c277d4fa0047",
      "name": "Parse mintlify response",
      "type": "n8n-nodes-base.code",
      "position": [
        3036,
        420
      ]
    },
    {
      "id": "bd74c61c-eea7-480e-ab1d-a84fa564fbaa",
      "name": "Parse AI response",
      "type": "n8n-nodes-base.code",
      "position": [
        3632,
        420
      ]
    },
    {
      "id": "ad38d9c9-d7c4-4ef1-bcc4-3547dc0eef21",
      "name": "Reply ticket and put on pending",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4448,
        520
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Fetch Zendesk ticket",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Parse AI response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New ticket?": {
      "main": [
        [
          {
            "node": "Create Mintlify Chat Topic",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Mintlify generated response (existing)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete ticket": {
      "main": [
        []
      ]
    },
    "Message router": {
      "main": [
        [
          {
            "node": "Billing suspected - escalate",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Delete ticket",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Fraud suspected - escalate",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Look for Mintlify topicId",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Count AI replies": {
      "main": [
        [
          {
            "node": "Check how many times the AI replied",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check uncertainty": {
      "main": [
        [
          {
            "node": "Uncertainty router",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI response": {
      "main": [
        [
          {
            "node": "Check uncertainty",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message classifier": {
      "main": [
        [
          {
            "node": "Message router",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse conversation": {
      "main": [
        [
          {
            "node": "Count AI replies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Uncertainty router": {
      "main": [
        [
          {
            "node": "If uncertain, don't reply",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Reply ticket and put on pending",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Zendesk ticket": {
      "main": [
        [
          {
            "node": "Check if human agent is assigned",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Check uncertainty",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Message classifier",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Parse mintlify response": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch ticket conversation": {
      "main": [
        [
          {
            "node": "Parse conversation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Look for Mintlify topicId": {
      "main": [
        [
          {
            "node": "New ticket?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Mintlify Chat Topic": {
      "main": [
        [
          {
            "node": "Add Mintlify topicId to ticket tags",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Mintlify topicID to ticket": {
      "main": [
        [
          {
            "node": "Mintlify generated response (new)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if human agent is assigned": {
      "main": [
        [
          {
            "node": "If human assigned, don't reply",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Fetch ticket conversation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mintlify generated response (new)": {
      "main": [
        [
          {
            "node": "Parse mintlify response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Mintlify topicId to ticket tags": {
      "main": [
        [
          {
            "node": "Add Mintlify topicID to ticket",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check how many times the AI replied": {
      "main": [
        [
          {
            "node": "Flip conversation to get the last message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If more that x replies, don't reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mintlify generated response (existing)": {
      "main": [
        [
          {
            "node": "Parse mintlify response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Flip conversation to get the last message": {
      "main": [
        [
          {
            "node": "Message classifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}