{
  "name": "🤖 Calendar Agent",
  "nodes": [
    {
      "parameters": {
        "inputSource": "passthrough"
      },
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1.1,
      "position": [
        -380,
        40
      ],
      "id": "95eb8173-1126-4b9a-9d20-84b222af319b",
      "name": "When Executed by Another Workflow"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.query }}",
        "options": {
          "systemMessage": "=Important context:\nCurrent date and time is {{ $now.toString() }}"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [
        -160,
        40
      ],
      "id": "4d30beec-fc07-43d2-8210-023364d12654",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        -280,
        320
      ],
      "id": "02bd41c0-4afd-4763-bce3-27e70e96386d",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "nrDrI8MUFREwh9aM",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "calendar": {
          "__rl": true,
          "value": "leonvanzyldev@gmail.com",
          "mode": "list",
          "cachedResultName": "leonvanzyldev@gmail.com"
        },
        "start": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Start', ``, 'string') }}",
        "end": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('End', ``, 'string') }}",
        "additionalFields": {
          "summary": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Summary', ``, 'string') }}"
        }
      },
      "type": "n8n-nodes-base.googleCalendarTool",
      "typeVersion": 1.3,
      "position": [
        -40,
        320
      ],
      "id": "ab235f3c-65d4-4a6d-a792-d06948025a31",
      "name": "Create Event",
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "mUGDvBWFm3l5TPgU",
          "name": "Google Calendar account"
        }
      }
    },
    {
      "parameters": {
        "operation": "getAll",
        "calendar": {
          "__rl": true,
          "value": "leonvanzyldev@gmail.com",
          "mode": "list",
          "cachedResultName": "leonvanzyldev@gmail.com"
        },
        "limit": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Limit', ``, 'number') }}",
        "timeMin": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('After', ``, 'string') }}",
        "timeMax": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Before', ``, 'string') }}",
        "options": {}
      },
      "type": "n8n-nodes-base.googleCalendarTool",
      "typeVersion": 1.3,
      "position": [
        80,
        320
      ],
      "id": "ac2af861-b8f4-4350-a8ee-8ab38f41c389",
      "name": "Get Events",
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "mUGDvBWFm3l5TPgU",
          "name": "Google Calendar account"
        }
      }
    }
  ],
  "pinData": {
    "When Executed by Another Workflow": [
      {
        "json": {
          "query": "Please get my calendar events for 1 March"
        }
      }
    ]
  },
  "connections": {
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Create Event": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get Events": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "timezone": "Africa/Johannesburg",
    "callerPolicy": "workflowsFromSameOwner"
  },
  "versionId": "89302a2f-046c-49fa-9523-808419ba46de",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "cd8f3260f4f840103c2ad768fc0a1d92f91d8588e163407d3747cc2f7c516a5a"
  },
  "id": "MLn87xEu4fgL9LP7",
  "tags": []
}