{
  "name": "AI agent : Google calendar assistant using OpenAI",
  "nodes": [
    {
      "id": "2e670a54-f789-4c8b-abba-ae35c458f5ed",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -280,
        0
      ]
    },
    {
      "id": "96bf895f-a18c-4a4c-bc26-3ec5d2372de5",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        160,
        820
      ]
    },
    {
      "id": "270176df-9c2d-4f1a-b017-9349cb249341",
      "name": "Window Buffer Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        580,
        820
      ]
    },
    {
      "id": "5cdece35-bd69-4c77-b240-963df8781d64",
      "name": "Google Calendar - Get Events",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        960,
        800
      ]
    },
    {
      "id": "634e6472-099c-4f0e-b9eb-67956c4881b8",
      "name": "Google Calendar - Create events",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        1380,
        800
      ]
    },
    {
      "id": "5c93e130-29d5-489b-84ea-3e31f5849b3a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -380,
        -380
      ],
      "parameters": {
        "width": 320,
        "height": 560,
        "content": "## Chat trigger - When a message is received\n\nThis node is the **entry point of the workflow**.  \nIt triggers the workflow whenever a message is sent to the **chat interface**.\n\nOptions with n8n:\n- **"
      }
    },
    {
      "id": "a1e850b4-d0fe-417c-8e1e-13fb4cdbb0a8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        60,
        -380
      ],
      "parameters": {
        "width": 1520,
        "height": 560,
        "content": "## Tools Agent - Calendar AI Agent\n\nThis **node** configures the **AI agent** for interaction with Google Calendar.  \nIt includes the following features:\n\n- A **prompt source**: This is the user messa"
      }
    },
    {
      "id": "9b259245-5fd5-4798-973e-bc6aa15da20f",
      "name": "Calendar AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        580,
        0
      ]
    },
    {
      "id": "b902a7d0-c2ca-4ab9-9f2a-047b9ccb1678",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        60,
        240
      ],
      "parameters": {
        "width": 320,
        "height": 720,
        "content": "## OpenAI chat model\n\nThis node specifies the chat model used by the agent.  \nIn the template, the **default LLM is gpt-4o** for its high relevance.\n\nOther options:\n- You can **try gpt-4o-mini**, whic"
      }
    },
    {
      "id": "c67e1e1b-ef9a-4fec-a860-4ec6b7439df6",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        240
      ],
      "parameters": {
        "width": 320,
        "height": 720,
        "content": "## Window buffer memory\n\nThis node manages the **memory** of the agent, specifically the **context window length** for chat history.  \nThe default is set to 5 messages.\n\nNote:  \nThe **memory** is **te"
      }
    },
    {
      "id": "bf719d53-e21b-4bd5-9443-c24d008f732b",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        860,
        240
      ],
      "parameters": {
        "width": 320,
        "height": 720,
        "content": "## Google Calendar - Get Events\n\nThis sub-node is a tool used by the AI agent.  \nIts purpose is to **retrieve events based on the user input**.  \nFor example: *\"Can you give me the events from last we"
      }
    },
    {
      "id": "e94eb1f8-df42-414b-9bec-9e6991a5a832",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1260,
        240
      ],
      "parameters": {
        "width": 320,
        "height": 720,
        "content": "## Google Calendar - Create Events\n\nThis sub-node is a tool used by the AI agent.  \nIts purpose is to **create events based on the user input**.  \nFor example: \"Can you create an event 'Quarter revenu"
      }
    },
    {
      "id": "707c011c-c822-4922-8ef7-c4368947d179",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        860,
        1000
      ],
      "parameters": {
        "width": 720,
        "height": 380,
        "content": "## Having fun with it ? Here’s how to level up this AI agent !  \n\nThis workflow demonstrates **how easily you can set up an AI agent to call tools** for you using **n8n**.  \nThe tasks here are **usefu"
      }
    }
  ],
  "connections": {
    "Calendar AI Agent": {
      "main": [
        []
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Calendar AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Window Buffer Memory": {
      "ai_memory": [
        [
          {
            "node": "Calendar AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Calendar AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Calendar - Get Events": {
      "ai_tool": [
        [
          {
            "node": "Calendar AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Google Calendar - Create events": {
      "ai_tool": [
        [
          {
            "node": "Calendar AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}