{
  "name": "AI agent with charts capabilities using OpenAI structured output and Quickchart",
  "nodes": [
    {
      "id": "4b7c314a-d7c5-46cb-af6f-b3ff02a182b7",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        980,
        600
      ]
    },
    {
      "id": "cf4ffa49-8830-4db2-9a7d-b8931e806947",
      "name": "Window Buffer Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1120,
        600
      ]
    },
    {
      "id": "22d36226-ca37-4ccc-a2d6-826b78c2f1f3",
      "name": "Generate a chart",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        1260,
        600
      ]
    },
    {
      "id": "d9ea85d7-3a56-4a95-88c8-60e5c95014e7",
      "name": "Execute \"Generate a chart\" tool",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        580,
        1100
      ]
    },
    {
      "id": "68d538f7-acce-447f-9ab1-6975639e05f7",
      "name": "OpenAI - Generate Chart definition with Structured Output",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        880,
        1100
      ]
    },
    {
      "id": "0fd4ad08-ad85-4d0b-b75f-0e59f789cbfd",
      "name": "Set response",
      "type": "n8n-nodes-base.set",
      "position": [
        1120,
        1100
      ]
    },
    {
      "id": "6785cadb-4875-47ac-9b57-29b583c53937",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        20,
        260
      ],
      "parameters": {
        "width": 680.7609104727082,
        "height": 619.3187860363884,
        "content": "## Workflow: AI Agent with charts capabilities using OpenAI Structured Output\n\n**Overview**\n- This workflow is a experiment to integrate charts into an AI Agent\n- The AI Agent has normal AI conversati"
      }
    },
    {
      "id": "fd507ff6-2d16-4498-ba2b-d91b02079311",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        740,
        800
      ],
      "parameters": {
        "width": 768.8586342909368,
        "height": 503,
        "content": "## Generate a Quickchart definition\n\n**HTTP Request node**\n- Send the chart query to OpenAI, with a defined JSON response format - *using HTTP Request node as it has not yet been implemented in the Op"
      }
    },
    {
      "id": "7f14532a-75ee-40f8-a45b-0f037af7cb05",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        740,
        260
      ],
      "parameters": {
        "width": 768,
        "height": 485.8165429718969,
        "content": "### Chat Agent\n- This is agent is mostly here to demonstrate how to use the sub workflow.\n- This is a basic agent with a tool \"generate a chart\"\n- The tool calls the sub-workflow\n- The sub-workflow re"
      }
    },
    {
      "id": "7793a567-c4d4-4745-83c9-adf5397755e9",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1020,
        400
      ]
    },
    {
      "id": "71bd2cb5-7b20-4d83-adba-c1fd57511155",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        840,
        400
      ]
    }
  ],
  "connections": {
    "Generate a chart": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Window Buffer Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute \"Generate a chart\" tool": {
      "main": [
        [
          {
            "node": "OpenAI - Generate Chart definition with Structured Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI - Generate Chart definition with Structured Output": {
      "main": [
        [
          {
            "node": "Set response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}