{
  "name": "Evaluation metric example: categorization",
  "nodes": [
    {
      "id": "88b3ca67-d7d6-4e6d-9529-d81377315c05",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        180,
        -20
      ],
      "parameters": {
        "width": 180,
        "height": 260,
        "content": "Check whether the category/priority matches the expected one in the dataset"
      }
    },
    {
      "id": "25d9ced2-d91c-486a-bbc9-481258c716e5",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1200,
        40
      ],
      "parameters": {
        "width": 200,
        "height": 500,
        "content": "## How it works\nThis template shows how to calculate a workflow evaluation metric: **whether a category matches the expected one**.\n\nThe workflow takes support tickets and generates a category and pri"
      }
    },
    {
      "id": "c1f452ac-31e6-4a8c-9558-92ba83a34464",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        280
      ],
      "parameters": {
        "width": 220,
        "height": 220,
        "content": "Read in [this test dataset](https://docs.google.com/spreadsheets/d/1uuPS5cHtSNZ6HNLOi75A2m8nVWZrdBZ_Ivf58osDAS8/edit?gid=294497137#gid=294497137) of support tickets"
      }
    },
    {
      "id": "79375ec3-713a-4d07-8701-2c8d3392d6c5",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -420,
        200
      ]
    },
    {
      "id": "93932809-9b1e-47a2-a50d-0b0978d0b881",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -440,
        420
      ]
    },
    {
      "id": "5d8383f2-e0ea-4fd9-bdcb-0f04e1872896",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -240,
        420
      ]
    },
    {
      "id": "e0d259ea-a9b7-45db-a4fb-fa2a2e5769b3",
      "name": "Check categorization",
      "type": "n8n-nodes-base.set",
      "position": [
        220,
        80
      ]
    },
    {
      "id": "1ffc9841-a146-4127-a957-69cb73f7e6f8",
      "name": "Match webhook format",
      "type": "n8n-nodes-base.set",
      "position": [
        -680,
        340
      ]
    },
    {
      "id": "7505b06e-0179-4e8a-a830-8631be7a9ca9",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -900,
        40
      ]
    },
    {
      "id": "5090592c-b883-4644-a8d5-74ada2c4863e",
      "name": "When fetching a dataset row",
      "type": "n8n-nodes-base.evaluationTrigger",
      "position": [
        -900,
        340
      ]
    },
    {
      "id": "30ecf24a-2012-4751-a7fd-712fa498ac46",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        220,
        320
      ]
    },
    {
      "id": "a6293ef9-fd50-439e-a906-c9e03e97d0bc",
      "name": "Evaluating?",
      "type": "n8n-nodes-base.evaluation",
      "position": [
        -60,
        200
      ]
    },
    {
      "id": "db1b0fac-0268-44c3-87ce-af552bb6c42d",
      "name": "Set metrics",
      "type": "n8n-nodes-base.evaluation",
      "position": [
        440,
        80
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Evaluating?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Evaluating?": {
      "main": [
        [
          {
            "node": "Check categorization",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Check categorization": {
      "main": [
        [
          {
            "node": "Set metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Match webhook format": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "When fetching a dataset row": {
      "main": [
        [
          {
            "node": "Match webhook format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}