{
  "name": "LLM usage tracker & cost monitor with node-level analytics (v2)",
  "nodes": [
    {
      "id": "7e87063c-72a7-4c33-a5d4-9f5ef550da21",
      "name": "Get an execution",
      "type": "n8n-nodes-base.n8n",
      "position": [
        -688,
        320
      ]
    },
    {
      "id": "fdc6c95b-361d-445b-8306-1712e7235eaf",
      "name": "When Exc.",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -880,
        416
      ]
    },
    {
      "id": "bce95431-c1be-47bc-96f3-99b318e78af8",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        -80
      ],
      "parameters": {
        "width": 352,
        "height": 304,
        "content": "### Defined by User\n- Define the model name and standard name, even if you want to use same name. (Why? because we will use the standard name to find the cost of this model)\n- Model prices are per mil"
      }
    },
    {
      "id": "a1f0416a-723c-4724-a8f5-7ff3dbb6b829",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        128
      ],
      "parameters": {
        "width": 416,
        "height": 240,
        "content": "### Check all model names are correctly defined"
      }
    },
    {
      "id": "e55084c1-e2b6-4788-9f6e-1cfaeef59165",
      "name": "model prices",
      "type": "n8n-nodes-base.set",
      "position": [
        -32,
        96
      ]
    },
    {
      "id": "19971fb6-2456-4629-ba2b-8bcacbeda97f",
      "name": "Standardize names",
      "type": "n8n-nodes-base.set",
      "position": [
        -208,
        96
      ]
    },
    {
      "id": "fe9bde19-e1d5-40a9-9219-d79668d7a8c1",
      "name": "Check correctly defined",
      "type": "n8n-nodes-base.code",
      "position": [
        640,
        192
      ]
    },
    {
      "id": "57480286-a52e-4e57-a85f-b588b8b3c74e",
      "name": "Stop and Error",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        1024,
        144
      ]
    },
    {
      "id": "fbfa0f9b-ae78-4051-a878-a4ef4861c057",
      "name": "If not passed",
      "type": "n8n-nodes-base.if",
      "position": [
        832,
        192
      ]
    },
    {
      "id": "e1692a9d-fcb3-431b-aa32-17fdb888e749",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1024,
        368
      ]
    },
    {
      "id": "884153b3-4920-45e3-9266-f6f151e96f6f",
      "name": "Calculate cost",
      "type": "n8n-nodes-base.code",
      "position": [
        1216,
        368
      ]
    },
    {
      "id": "cfb7c844-4921-4d27-828d-e5792e457943",
      "name": "Test id",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -880,
        208
      ]
    },
    {
      "id": "765452b4-d9d7-463d-b465-11296af1fc73",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1136,
        80
      ],
      "parameters": {
        "width": 368,
        "height": 240,
        "content": "### Test with execution id\n\n"
      }
    },
    {
      "id": "102aa26e-b208-44f2-a4a8-11a56046b546",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1120,
        144
      ],
      "parameters": {
        "width": 214,
        "height": null,
        "content": "Where is the execution ID?\nIn your workflow at the top center, you can see \"Executions,\" and you can select any execution to see the ID, which is a number like 323.\n"
      }
    },
    {
      "id": "eab0b1f1-3cb4-4b0b-913e-6c5639b17b26",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        784,
        128
      ],
      "parameters": {
        "width": 214,
        "height": 80,
        "content": "In case you did something incorrectly, you can see what models you missed to add and define"
      }
    },
    {
      "id": "e275b913-ea04-4c43-b799-d5fa4f31ee65",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1456,
        352
      ],
      "parameters": {
        "width": 246,
        "height": 144,
        "content": "You can do anything with this info:\n- Send a follow-up message with cost\n- Send another request to continue a process ..."
      }
    },
    {
      "id": "481d382a-cfc8-47cc-9ac2-89a9c3118419",
      "name": "Find Nodes with LLM Use",
      "type": "n8n-nodes-base.code",
      "position": [
        -400,
        384
      ]
    },
    {
      "id": "86e71222-0e8c-4b07-9b10-63de24aa5335",
      "name": "create models_used list",
      "type": "n8n-nodes-base.code",
      "position": [
        -416,
        144
      ]
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Calculate cost",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Test id": {
      "main": [
        [
          {
            "node": "Get an execution",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Exc.": {
      "main": [
        [
          {
            "node": "Get an execution",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "model prices": {
      "main": [
        [
          {
            "node": "Check correctly defined",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If not passed": {
      "main": [
        [
          {
            "node": "Stop and Error",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get an execution": {
      "main": [
        [
          {
            "node": "Find Nodes with LLM Use",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Standardize names": {
      "main": [
        [
          {
            "node": "model prices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check correctly defined": {
      "main": [
        [
          {
            "node": "If not passed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Nodes with LLM Use": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          },
          {
            "node": "create models_used list",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create models_used list": {
      "main": [
        [
          {
            "node": "Standardize names",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}