{
  "id": "qe52pIYq3o37sFft",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Email Summariser",
  "tags": [],
  "nodes": [
    {
      "id": "a021c340-eef0-4a3c-8df0-f8cd6e68ecfa",
      "name": "Email Trigger (IMAP)",
      "type": "n8n-nodes-base.emailReadImap",
      "position": [
        0,
        0
      ],
      "parameters": {},
      "typeVersion": 2.1
    },
    {
      "id": "3b6077d0-c6f7-4042-bd92-4cbb527c59a4",
      "name": "Get row(s) in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        224,
        0
      ],
      "parameters": {},
      "typeVersion": 4.6,
      "alwaysOutputData": true
    },
    {
      "id": "1783b0f3-a0b6-4b35-87ef-c4d68b9d4a47",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        448,
        0
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 2.1
    },
    {
      "id": "5e070553-76aa-44f0-8c46-e0e123e8b9a7",
      "name": "Find Category",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        848,
        0
      ],
      "parameters": {},
      "typeVersion": 4.6,
      "alwaysOutputData": true
    },
    {
      "id": "b7364f49-c255-447c-b72d-47109c60a142",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        1072,
        0
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "d1543da0-190c-40a1-8898-64dbbe2a5a1d",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1296,
        -96
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "2f4f885a-37fc-41e9-b128-edb50fdb3450",
      "name": "Update Request Count",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1520,
        -96
      ],
      "parameters": {},
      "typeVersion": 4.6
    },
    {
      "id": "9e707831-5249-4995-b5f1-9d84842b46ac",
      "name": "Append row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1296,
        96
      ],
      "parameters": {},
      "typeVersion": 4.6
    },
    {
      "id": "e0651f0d-9045-42a9-8983-7b20578d600b",
      "name": "oAI OSS",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        416,
        224
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9d51f552-3d31-4f71-82b7-dca150e65c94",
      "name": "Category & Request",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        688,
        224
      ],
      "parameters": {},
      "typeVersion": 1.3
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "d7a7c964-d0b3-4dd9-a8c0-dfbb494baae2",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "oAI OSS": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Find Category",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Update Request Count",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Category": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Category & Request": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Trigger (IMAP)": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}