{
  "nodes": [
    {
      "id": "1cbc8229-217e-448a-883e-39d5a75b4f6b",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        120,
        20
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {
          "download": true
        },
        "credentials": {
          "telegramApi": {
            "id": "credential-id",
            "name": "telegramApi Credential"
          }
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "fc51ac2b-72f0-479e-b012-a089007bf816",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        340,
        20
      ],
      "parameters": {
        "text": "={{ $('Telegram Trigger').item.json.message.text }}",
        "options": {
          "systemMessage": "=# ROLE\n\nYou are an AI agent for sales automation. Your job is to orchestrate the activities between different agents and then formulate a friendly response back to the user.\n\nThe tools are:\n- CRM for managing leads\n- Email for communication\n- Calendar for scheduling meetings\n\n# ADDITIONAL INFORMATION\n- You are talking to a sales representative\n- The current date and time is {{ $now.toString() }}\n- Time zone is EST (Ottawa)"
        },
        "promptType": "define"
      },
      "typeVersion": 1.8
    },
    {
      "id": "853f816a-05a1-4af5-8bb8-a6a8a44c5c3a",
      "name": "Email",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        660,
        360
      ],
      "parameters": {
        "name": "Email",
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "mh7GGdzmesTrHGxU",
          "cachedResultName": "🤖 Email Agent"
        },
        "description": "Use this tool for any email related actions.",
        "workflowInputs": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "64593c21-7a6a-4404-8188-4718002db01f",
      "name": "Calendar",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        560,
        360
      ],
      "parameters": {
        "name": "Calendar",
        "workflowId": {
          "__rl": true,
          "mode": "list",
          "value": "tC8OSGmmiBE9kvnt",
          "cachedResultName": "🤖 Calendar Agent"
        },
        "description": "Use this tool for any Calendar related actions.",
        "workflowInputs": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "91c2a746-3071-4624-9f84-ff5d57929778",
      "name": "Response",
      "type": "n8n-nodes-base.telegram",
      "position": [
        820,
        20
      ],
      "parameters": {
        "text": "={{ $json.output }}",
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false
        },
        "credentials": {
          "telegramApi": {
            "id": "credential-id",
            "name": "telegramApi Credential"
          }
        }
      },
      "typeVersion": 1.2
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Calendar": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}