{
 "name": "AgentsCPA — Telegram AI bot with offers",
 "nodes": [
  {
   "parameters": {
    "updates": [
     "message"
    ]
   },
   "name": "Telegram Trigger",
   "type": "n8n-nodes-base.telegramTrigger",
   "typeVersion": 1.1,
   "position": [
    0,
    0
   ]
  },
  {
   "parameters": {
    "promptType": "define",
    "text": "={{ $json.message.text }}",
    "options": {
     "systemMessage": "You are a helpful assistant. Answer in the user's language. When you recommend or name specific products, brands, stores or services, first call search_offers to get current offers available in the user's country, and mention 1-2 that fit in natural words. Never do it in sensitive or purely informational conversations."
    }
   },
   "name": "AI Agent",
   "type": "@n8n/n8n-nodes-langchain.agent",
   "typeVersion": 1.7,
   "position": [
    260,
    0
   ]
  },
  {
   "parameters": {
    "model": {
     "__rl": true,
     "mode": "list",
     "value": "gpt-4.1-mini"
    },
    "options": {}
   },
   "name": "OpenAI Chat Model",
   "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
   "typeVersion": 1.2,
   "position": [
    200,
    220
   ]
  },
  {
   "parameters": {
    "endpointUrl": "https://mcp.agentscpa.com/k/YOUR_AGENT_KEY/mcp",
    "serverTransport": "httpStreamable"
   },
   "name": "AgentsCPA MCP",
   "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
   "typeVersion": 1.1,
   "position": [
    420,
    220
   ]
  },
  {
   "parameters": {
    "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
    "text": "={{ $json.output }}",
    "additionalFields": {
     "parse_mode": "Markdown"
    }
   },
   "name": "Send reply",
   "type": "n8n-nodes-base.telegram",
   "typeVersion": 1.2,
   "position": [
    560,
    0
   ]
  }
 ],
 "connections": {
  "Telegram Trigger": {
   "main": [
    [
     {
      "node": "AI Agent",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "OpenAI Chat Model": {
   "ai_languageModel": [
    [
     {
      "node": "AI Agent",
      "type": "ai_languageModel",
      "index": 0
     }
    ]
   ]
  },
  "AgentsCPA MCP": {
   "ai_tool": [
    [
     {
      "node": "AI Agent",
      "type": "ai_tool",
      "index": 0
     }
    ]
   ]
  },
  "AI Agent": {
   "main": [
    [
     {
      "node": "Send reply",
      "type": "main",
      "index": 0
     }
    ]
   ]
  }
 },
 "settings": {}
}