This workflow follows the Agent → OpenAI Chat recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "Telegram1",
"nodes": [
{
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"type": "n8n-nodes-base.telegramTrigger",
"typeVersion": 1.1,
"position": [
-380,
-140
],
"id": "f22ec3b0-9bf9-49df-a6f8-7ce994c597a0",
"name": "Telegram Trigger",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"promptType": "define",
"text": "={{ $json.message.text }}",
"options": {
"systemMessage": "=You are a helpful assistant\n\n# you have tools:\n\n## search_agent\nuse this tool to search the web, hackernews and wikipedia\n\n## calculator\nuse this tool to do math"
}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 1.7,
"position": [
-160,
-140
],
"id": "dba9d7e6-f700-49cd-9aeb-b7b1fc12dc97",
"name": "AI Agent"
},
{
"parameters": {
"model": {
"__rl": true,
"value": "gpt-4o",
"mode": "list",
"cachedResultName": "gpt-4o"
},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1.2,
"position": [
-300,
140
],
"id": "a1ba09a7-0f71-4ef9-b5cb-18e97c026474",
"name": "OpenAI Chat Model",
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"text": "={{ $json.output }}",
"additionalFields": {
"appendAttribution": false
}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
200,
-140
],
"id": "5dcf2881-5385-4333-80be-3bd5d8bed825",
"name": "Telegram",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"sessionIdType": "customKey",
"sessionKey": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"contextWindowLength": 10
},
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"typeVersion": 1.3,
"position": [
-180,
140
],
"id": "5914e379-0ede-45f8-bd67-ba1dcfc7479d",
"name": "Window Buffer Memory"
},
{
"parameters": {
"name": "search_agent",
"description": "use this tool to surch the web, wikipedia, hackernews and up-to-date info.",
"workflowId": {
"__rl": true,
"value": "wGzfejLZOL2pJrhK",
"mode": "list",
"cachedResultName": "Telgram1 Sub Workflow Surch"
},
"workflowInputs": {
"mappingMode": "defineBelow",
"value": {},
"matchingColumns": [],
"schema": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
}
},
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"typeVersion": 2,
"position": [
140,
160
],
"id": "9cc6d2b1-e238-48b3-970b-112ab2220271",
"name": "search_agent"
},
{
"parameters": {},
"type": "@n8n/n8n-nodes-langchain.toolCalculator",
"typeVersion": 1,
"position": [
0,
160
],
"id": "ccd37989-6022-43a5-aa35-b8c6c56785d4",
"name": "Calculator"
}
],
"connections": {
"Telegram Trigger": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Telegram",
"type": "main",
"index": 0
}
]
]
},
"Window Buffer Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"search_agent": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Calculator": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
}
},
"active": true,
"settings": {
"executionOrder": "v1"
},
"versionId": "5902cdec-947c-4915-9de5-e49f766b7720",
"meta": {
"templateCredsSetupCompleted": true
},
"id": "2td3Jh0u5LkWayxR",
"tags": []
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
openAiApitelegramApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Telegram1. Uses telegramTrigger, agent, lmChatOpenAi, telegram. Event-driven trigger; 7 nodes.
Source: https://github.com/rajaaryan779/n8n-workflows/blob/5e47b43d39b7384aefcb68054ec7a70308bafc52/n8n-workflows/Telegram1.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
QuantumDefender AI is a next-generation intelligent cybersecurity assistant designed to harness the symbolic strength of quantum computing’s promise alongside cutting-edge AI capabilities. This sophis
Telegram AI Langchain bot. Uses lmChatOpenAi, memoryBufferWindow, telegram, executeWorkflowTrigger. Event-driven trigger; 12 nodes.
CoinMarketCap_AI_Data_Analyst_Agent. Uses telegram, agent, lmChatOpenAi, memoryBufferWindow. Event-driven trigger; 12 nodes.
Meet your AI-powered crypto data analyst—fully integrated with CoinMarketCap APIs.
Use cases include email management, scheduling, web search, calculations, and more - all automated through AI coordination.