{
  "name": "Automate support ticket classification & routing from HubSpot to Jira with GPT",
  "nodes": [
    {
      "id": "dbd0b5f4-bb55-4a33-b03e-3cabd5a7b840",
      "name": "Get many tickets",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        128,
        96
      ]
    },
    {
      "id": "492b2964-330d-46c2-b667-7a0ceaabaec1",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1824,
        384
      ]
    },
    {
      "id": "fbf725e8-9fc3-4efa-abf3-1722d742af7e",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -96,
        544
      ]
    },
    {
      "id": "8d6628a5-4bca-47d6-a24c-25738e28b832",
      "name": "Sentinel",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        928,
        320
      ]
    },
    {
      "id": "f3dd6fb6-bf9d-4abf-bb28-f6a8a600d6c7",
      "name": "Profiler",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        1056,
        320
      ]
    },
    {
      "id": "14a177f5-093b-4e0f-93dd-1ff41a04bd1c",
      "name": "Profiler_agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        352,
        688
      ]
    },
    {
      "id": "df816db0-6ab1-47d5-bd7f-43f18db908d3",
      "name": "Sentinel_agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        352,
        384
      ]
    },
    {
      "id": "0c8813a0-b865-4126-a263-defd06d803c7",
      "name": "Search contacts",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        416,
        96
      ]
    },
    {
      "id": "9937e184-d03a-4688-b4d2-c4143e5d3d08",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1184,
        320
      ]
    },
    {
      "id": "366d8b7d-57aa-4716-8c92-7e736157929b",
      "name": "Orchestrator",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        992,
        96
      ]
    },
    {
      "id": "3299144b-a36a-4ae1-8269-599c2a98cb59",
      "name": "Set the variables",
      "type": "n8n-nodes-base.set",
      "position": [
        704,
        96
      ]
    },
    {
      "id": "c3031469-f7aa-4a76-8828-b5de0350c65e",
      "name": "Create an issue in Jira",
      "type": "n8n-nodes-base.jira",
      "position": [
        2112,
        128
      ]
    },
    {
      "id": "97c36385-a37b-4877-a3d3-6ae4a16433b7",
      "name": "Router",
      "type": "n8n-nodes-base.switch",
      "position": [
        128,
        544
      ]
    },
    {
      "id": "048caf93-771a-4a11-b54f-e58bab648b86",
      "name": "from_crm",
      "type": "n8n-nodes-base.hubspotTool",
      "position": [
        432,
        912
      ]
    },
    {
      "id": "beab4322-2f47-40e7-af70-d99986877bd1",
      "name": "Cateogory Classifier",
      "type": "@n8n/n8n-nodes-langchain.textClassifier",
      "position": [
        1744,
        96
      ]
    },
    {
      "id": "e1f92d13-5c4a-4078-ab18-b8a77462ecff",
      "name": "generate ticket title",
      "type": "@n8n/n8n-nodes-langchain.chainSummarization",
      "position": [
        1392,
        96
      ]
    },
    {
      "id": "11414136-f230-48eb-91dd-411ea79e85e4",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        352
      ],
      "parameters": {
        "width": 832,
        "height": 688,
        "content": "## Sub-worflows for agents\nHere eyou can add any agent that you need"
      }
    },
    {
      "id": "41d01ec4-fdf0-43d1-8ec1-2075280ab5d4",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1680,
        0
      ],
      "parameters": {
        "width": 656,
        "height": 288,
        "content": "## Ticket router\nSet here the repoonsible team for each category output"
      }
    },
    {
      "id": "332c214a-3ac9-435b-b3a5-108756744a49",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        0
      ],
      "parameters": {
        "width": 752,
        "height": 464,
        "content": "## Ticket generation\nModify the prompt to suit your needs"
      }
    },
    {
      "id": "540c7fa8-4de4-4e28-9c78-fdef19450154",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        16
      ],
      "parameters": {
        "width": 576,
        "height": 272,
        "content": "## Get tickets from Hubspot\nSet here your CRM retrieving system"
      }
    },
    {
      "id": "a38ef7cf-89ce-423c-bda2-10063ac9f3dc",
      "name": "For testing",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -96,
        0
      ]
    },
    {
      "id": "2a389272-0f90-41e7-afca-24b194985732",
      "name": "Set the running interval",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -96,
        192
      ]
    },
    {
      "id": "073896f5-d6cf-4be5-a57e-40673b394b55",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        -128
      ],
      "parameters": {
        "width": 768,
        "height": 100,
        "content": "## Contact me\n### If you need some help with this workflow: Write to me: [thomas@pollup.net](mailto:thomas@pollup.net)\n"
      }
    }
  ],
  "connections": {
    "Router": {
      "main": [
        [
          {
            "node": "Sentinel_agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Profiler_agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Profiler": {
      "ai_tool": [
        [
          {
            "node": "Orchestrator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Sentinel": {
      "ai_tool": [
        [
          {
            "node": "Orchestrator",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "from_crm": {
      "ai_tool": [
        [
          {
            "node": "Profiler_agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "For testing": {
      "main": [
        [
          {
            "node": "Get many tickets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Orchestrator": {
      "main": [
        [
          {
            "node": "generate ticket title",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search contacts": {
      "main": [
        [
          {
            "node": "Set the variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many tickets": {
      "main": [
        [
          {
            "node": "Search contacts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Orchestrator",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Sentinel_agent",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Profiler_agent",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "generate ticket title",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Cateogory Classifier",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Set the variables": {
      "main": [
        [
          {
            "node": "Orchestrator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cateogory Classifier": {
      "main": [
        [
          {
            "node": "Create an issue in Jira",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create an issue in Jira",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create an issue in Jira",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create an issue in Jira",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "generate ticket title": {
      "main": [
        [
          {
            "node": "Cateogory Classifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set the running interval": {
      "main": [
        [
          {
            "node": "Get many tickets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Orchestrator",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Router",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}