{
  "name": "Video 2 - Setup meeting",
  "nodes": [
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ],
      "id": "16237c8c-ff32-450c-b55e-88eb0b98f0e6",
      "name": "Telegram Trigger",
      "webhookId": "3a0def38-b6de-4d2d-a448-ef9e56b945b7",
      "credentials": {
        "telegramApi": {
          "id": "qj1RsfCOZ7pqPJbr",
          "name": "PurpleBird"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.message.text }}",
        "options": {
          "systemMessage": "=You are a agent that helps to set appointments using the add_meeting tool. You base the meetings on the input you get. \n\nIf the user sends multiple meetings you set up multiple meetings in the calendar. \n\n#tools \n##add_meeting \nuse this tool to set one or multiple meetings in the calendar. \n\ndate/time **{{ $now }}**"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        220,
        0
      ],
      "id": "f64b9f3d-966f-44ce-b597-4b1df1f5c0cd",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        120,
        200
      ],
      "id": "5f9febfd-2103-46b4-98d4-079cf5baebe8",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "u1bLnJN956uhy6iQ",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.message.chat.id }}"
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        240,
        200
      ],
      "id": "4c698e5f-af31-4a20-96c4-6af3a4edba60",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "calendar": {
          "__rl": true,
          "value": "marketing@purplebird.nl",
          "mode": "list",
          "cachedResultName": "marketing@purplebird.nl"
        },
        "start": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Start', `The start time of the event `, 'string') }}",
        "end": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('End', `The end time of the event `, 'string') }}",
        "additionalFields": {
          "summary": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Summary', `The titel of the meeting `, 'string') }}"
        }
      },
      "type": "n8n-nodes-base.googleCalendarTool",
      "typeVersion": 1.3,
      "position": [
        380,
        200
      ],
      "id": "9aef5985-d3f6-41c5-b3f5-c977a50c07ba",
      "name": "Add_meeting",
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "Nut0IJsheHQPMCxS",
          "name": "Marketing_purplebird"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "text": "={{ $json.output }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        580,
        0
      ],
      "id": "4374fa02-c571-4353-bb69-2ecc384ed715",
      "name": "Send a text message",
      "webhookId": "ad0dac54-8ef7-4617-9a3b-312be9e82d95",
      "credentials": {
        "telegramApi": {
          "id": "qj1RsfCOZ7pqPJbr",
          "name": "PurpleBird"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Add_meeting": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": "AzU2J0S2o3jCHC3E"
  },
  "versionId": "29e837b7-1766-4ae1-a1aa-902840e27486",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "8a498a77f0596e9134e2f6a081c09846c70c40ace04485912cf65c18b39c9551"
  },
  "id": "w2jnUZv24QXoRJlY",
  "tags": [
    {
      "createdAt": "2025-08-02T13:46:57.313Z",
      "updatedAt": "2025-08-02T13:46:57.313Z",
      "id": "GiS01lDfVY3QkRA3",
      "name": "videos"
    }
  ]
}