So I have a workflow template json file, I am trying to create programatically. I created it manually on the UI, then downloaded its json and plan to be duplicating via API. Now creating the workflow via API and the telegram trigger part doesn’t seem to be listening for messages even when the workflow is set to active. Upon futher inspection, I notice that the telegram trigger node created via the UI has a property called webhook Id while mine created via the API doesn’t and I suspect this to be the issue. How do I fix
The workflow json is below
{
“name”: “Tg bot”,
“nodes”: [
{
“parameters”: {
“updates”: [“message”],
“additionalFields”: {}
},
“type”: “n8n-nodes-base.telegramTrigger”,
“typeVersion”: 1.2,
“position”: [0, 0],
“id”: “27c7ef01-fc69-4614-9ff8-03ac0bd528bd”,
“name”: “Telegram Trigger”,
“credentials”: {
“telegramApi”: {
“id”: “gAs1XrdasOkqOVsY”,
“name”: “Telegram account”
}
}
},
{
“parameters”: {
“jsCode”: “const msg = $input.first().json;\n\nlet inputData;\n\nif (msg.document) {\n inputData = msg.document; // Only send document\n} else if (msg.message.photo) {\n inputData = msg.photo; // Only send photo\n} else if (msg.message.sticker) {\n inputData = msg.message.sticker; // Only send photo\n} else {\n inputData = msg.message.chat || \”\“; // Only text$input.first().json.message.chat\n}\n\nreturn [\n {\n input: inputData,\n chatId: msg.message.message_id ?? msg.message.chat.id,\n username: $input.first().json.message.from.username\n },\n];\n”
},
“type”: “n8n-nodes-base.code”,
“typeVersion”: 2,
“position”: [208, 0],
“id”: “3ee3c5d7-fe67-4de5-a02d-0fa7b764dda4”,
“name”: “Code in JavaScript”
},
{
“parameters”: {
“chatId”: “={{ $(‘Telegram Trigger’).item.json.message.chat.id }}”,
“text”: “={{ $json.output }}”,
“additionalFields”: {
“appendAttribution”: false
}
},
“type”: “n8n-nodes-base.telegram”,
“typeVersion”: 1.2,
“position”: [1232, 0],
“id”: “76f53988-86cc-4a7a-8f32-fee9d542e7cc”,
“name”: “Send a text message”,
“credentials”: {
“telegramApi”: {
“id”: “gAs1XrdasOkqOVsY”,
“name”: “Telegram account”
}
}
},
{
“parameters”: {
“promptType”: “define”,
“text”: “={{ $(‘Telegram Trigger’).item.json.message }}”,
“options”: {
“systemMessage”: “=You are a helpful assistant chatting on Telegram.\n\nChat ID:\n{{ $json.chatId }}\n\nUsername:\n{{ $json.username }}\n\nYou have access to a vector database (Pinecone) that contains your CV and career details.\n\nRules:\n1. When a user’s message relates to your work experience, skills, education, or background → use the “Answer questions with a vector store” tool to fetch relevant context.\n2. If the message is not about your CV, respond normally.\n3. Always store conversation memory by chatId.\n4. Be concise, natural, and friendly.\n\nNever enter reasoning loops — call the tool once if needed, then answer directly.\n”
}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 2.2,
“position”: [416, 0],
“id”: “8ddbe9f8-6a40-4d74-92fd-1cca9c381661”,
“name”: “AI Agent”,
“alwaysOutputData”: true
},
{
“parameters”: {
“model”: {
“__rl”: true,
“value”: “gpt-5-nano”,
“mode”: “list”,
“cachedResultName”: “gpt-5-nano”
},
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,
“typeVersion”: 1.2,
“position”: [240, 176],
“id”: “1fbaca6e-6bab-44af-969a-0960e586edda”,
“name”: “OpenAI Chat Model”,
“credentials”: {
“openAiApi”: {
“id”: “Oh570nAYLaXPg0gM”,
“name”: “OpenAi account”
}
}
},
{
“parameters”: {
“sessionIdType”: “customKey”,
“sessionKey”: “={{ $json.chatId }}”
},
“type”: “@n8n/n8n-nodes-langchain.memoryBufferWindow”,
“typeVersion”: 1.3,
“position”: [432, 208],
“id”: “f13d8c7d-0cbc-482a-b9d7-42bedde3a1bf”,
“name”: “Simple Memory”
},
{
“parameters”: {
“description”: “Use this tool to answer questions from the user about the cv.”
},
“type”: “@n8n/n8n-nodes-langchain.toolVectorStore”,
“typeVersion”: 1.1,
“position”: [592, 256],
“id”: “a8d644a8-5c13-4bf7-896b-cb95ab71cb7d”,
“name”: “Answer questions with a vector store”
},
{
“parameters”: {
“model”: {
“__rl”: true,
“value”: “gpt-5-nano”,
“mode”: “list”,
“cachedResultName”: “gpt-5-nano”
},
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,
“typeVersion”: 1.2,
“position”: [688, 640],
“id”: “3f8e4b7f-6ce7-4b97-812f-15b3165995c5”,
“name”: “OpenAI Chat Model1”,
“credentials”: {
“openAiApi”: {
“id”: “Oh570nAYLaXPg0gM”,
“name”: “OpenAi account”
}
}
},
{
“parameters”: {
“pineconeIndex”: {
“__rl”: true,
“value”: “n8n-workflow”,
“mode”: “list”,
“cachedResultName”: “n8n-workflow”
},
“options”: {
“pineconeNamespace”: “femi_cv”
}
},
“type”: “@n8n/n8n-nodes-langchain.vectorStorePinecone”,
“typeVersion”: 1.3,
“position”: [400, 464],
“id”: “a5b331ea-c1ad-4cc9-a1fc-a6e4a44465b6”,
“name”: “Pinecone Vector Store1”,
“credentials”: {
“pineconeApi”: {
“id”: “XhI9rGNcEHFkmoLy”,
“name”: “PineconeApi account”
}
}
},
{
“parameters”: {
“model”: “text-embedding-3-large”,
“options”: {
“dimensions”: “={{ 1024 }}”
}
},
“type”: “@n8n/n8n-nodes-langchain.embeddingsOpenAi”,
“typeVersion”: 1.2,
“position”: [464, 624],
“id”: “62bb717d-39d8-417a-b0e1-6c22e7fd3130”,
“name”: “Embeddings OpenAI1”,
“credentials”: {
“openAiApi”: {
“id”: “Oh570nAYLaXPg0gM”,
“name”: “OpenAi account”
}
}
},
{
“parameters”: {
“inputText”: “={{ $json.output }}”,
“categories”: {
“categories”: [
{
“category”: “GOOD_RESPONSE”,
“description”: “This means the agent responded in a good way”
},
{
“category”: “BAD_RESPONSE”,
“description”: “This means the agent responded in a bad way, beacuse it doesn’t have informatipn or crashed”
}
]
},
“options”: {
“systemPromptTemplate”: “=🧩 *Action Required:*\nPlease review this interaction and determine if the issue is model-related, data-related, or requires manual review.”
}
},
“type”: “@n8n/n8n-nodes-langchain.textClassifier”,
“typeVersion”: 1.1,
“position”: [752, 0],
“id”: “4de78f88-d907-45d5-89a3-a7e580d6c015”,
“name”: “Text Classifier”
},
{
“parameters”: {
“model”: {
“__rl”: true,
“value”: “gpt-5-nano”,
“mode”: “list”,
“cachedResultName”: “gpt-5-nano”
},
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,
“typeVersion”: 1.2,
“position”: [864, 304],
“id”: “f1749dc8-5e6b-4631-9dc0-75063b1783de”,
“name”: “OpenAI Chat Model2”,
“credentials”: {
“openAiApi”: {
“id”: “Oh570nAYLaXPg0gM”,
“name”: “OpenAi account”
}
}
},
{
“parameters”: {
“sendTo”: “[email protected],[email protected]”,
“subject”: “Escalated Issue from customer”,
“message”: “=
AI Workflow Escalation Notice
\n\nThe AI workflow encountered a low-quality or failed response.
\n\n\n\n
User Message:
AI Agent Response:
\n\n
Action Required:
\nPlease review this interaction and determine if the issue is model-related, data-related, or requires manual review.
“options”: {}
},
“type”: “n8n-nodes-base.gmail”,
“typeVersion”: 2.1,
“position”: [1536, 336],
“id”: “447b1c71-851e-4d03-ab5a-b732c9016401”,
“name”: “Send a message”,
“credentials”: {
“gmailOAuth2”: {
“id”: “dbFiNcdSPBm65N74”,
“name”: “Gmail account”
}
}
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “cc994756-3cf4-405f-9b9e-a2055a6ae32f”,
“name”: “escalation_type”,
“value”: “email”,
“type”: “string”
},
{
“id”: “df74892c-2266-41f5-9414-90ebb57b7d14”,
“name”: “”,
“value”: “”,
“type”: “string”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [1056, 240],
“id”: “4055b87d-f999-4dca-a643-ae50d37e44e1”,
“name”: “Edit Fields”
},
{
“parameters”: {
“rules”: {
“values”: [
{
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “0a0b1b9e-c088-4209-90d9-badf155a30d9”,
“leftValue”: “={{ $json.escalation_type }}”,
“rightValue”: “=email”,
“operator”: {
“type”: “string”,
“operation”: “equals”,
“name”: “filter.operator.equals”
}
}
],
“combinator”: “and”
}
},
{
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “8696afcb-ba84-41d5-85e0-d5a18e5a6fc5”,
“leftValue”: “={{ $json.escalation_type }}”,
“rightValue”: “telegram”,
“operator”: {
“type”: “string”,
“operation”: “equals”,
“name”: “filter.operator.equals”
}
}
],
“combinator”: “and”
}
},
{
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “45c86963-4de1-41e6-af0d-f9897cea6b0a”,
“leftValue”: “={{ $json.escalation_type }}”,
“rightValue”: “slack”,
“operator”: {
“type”: “string”,
“operation”: “equals”,
“name”: “filter.operator.equals”
}
}
],
“combinator”: “and”
}
}
]
},
“options”: {
“fallbackOutput”: 0
}
},
“type”: “n8n-nodes-base.switch”,
“typeVersion”: 3.3,
“position”: [1248, 480],
“id”: “59eabd88-8df4-4b80-b239-8922ffabff0b”,
“name”: “Switch”
},
{
“parameters”: {
“chatId”: “=1093248308”,
“text”: “=⚠️ *AI Workflow Escalation Notice*\n\nThe AI workflow encountered a _low-quality_ or _failed_ response.\n\n🗣️ *User Message:*\n{{ JSON.stringify($(‘Telegram Trigger’).item.json.message, null, 2) }}\n\n🤖 *AI Agent Response:*\n{{ $(‘AI Agent’).item.json.output }}\n\n🧩 *Action Required:*\nPlease review this interaction and determine if the issue is model-related, data-related, or requires manual review.”,
“additionalFields”: {
“appendAttribution”: false
}
},
“type”: “n8n-nodes-base.telegram”,
“typeVersion”: 1.2,
“position”: [1536, 496],
“id”: “3c349cf8-9d72-4f2a-93ce-843ad00d59d1”,
“name”: “Send a text message1”,
“credentials”: {
“telegramApi”: {
“id”: “gAs1XrdasOkqOVsY”,
“name”: “Telegram account”
}
}
}
],
“pinData”: {},
“connections”: {
“Telegram Trigger”: {
“main”: [
[
{
“node”: “Code in JavaScript”,
“type”: “main”,
“index”: 0
}
]
]
},
“Code in JavaScript”: {
“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
}
]
]
},
“AI Agent”: {
“main”: [
[
{
“node”: “Text Classifier”,
“type”: “main”,
“index”: 0
}
]
]
},
“OpenAI Chat Model1”: {
“ai_languageModel”: [
[
{
“node”: “Answer questions with a vector store”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“Pinecone Vector Store1”: {
“ai_vectorStore”: [
[
{
“node”: “Answer questions with a vector store”,
“type”: “ai_vectorStore”,
“index”: 0
}
]
]
},
“Embeddings OpenAI1”: {
“ai_embedding”: [
[
{
“node”: “Pinecone Vector Store1”,
“type”: “ai_embedding”,
“index”: 0
}
]
]
},
“Answer questions with a vector store”: {
“ai_tool”: [
[
{
“node”: “AI Agent”,
“type”: “ai_tool”,
“index”: 0
}
]
]
},
“OpenAI Chat Model2”: {
“ai_languageModel”: [
[
{
“node”: “Text Classifier”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“Text Classifier”: {
“main”: [
[
{
“node”: “Send a text message”,
“type”: “main”,
“index”: 0
}
],
[
{
“node”: “Edit Fields”,
“type”: “main”,
“index”: 0
}
]
]
},
“Send a message”: {
“main”: []
},
“Edit Fields”: {
“main”: [
[
{
“node”: “Switch”,
“type”: “main”,
“index”: 0
}
]
]
},
“Switch”: {
“main”: [
[
{
“node”: “Send a message”,
“type”: “main”,
“index”: 0
}
],
[
{
“node”: “Send a text message1”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“active”: false,
“settings”: {
“executionOrder”: “v1”
},
“versionId”: “2419c97e-af86-4476-a2fb-24c6e0898466”,
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “e249fdb042df33af8ebcd83a51eb714cb6513ba759a62e5d8c16343fa04a2918”
},
“id”: “vXLsFnnQQYMIvDHH”,
“tags”:
}

