{ "id": "HJwTWtzlhK8Q5SOv", "meta": { "instanceId": "workflow-00616953", "versionId": "1.0.0", "createdAt": "2025-09-29T07:07:57.559351", "updatedAt": "2025-09-29T07:07:57.559366", "owner": "n8n-user", "license": "MIT", "category": "automation", "status": "active", "priority": "high", "environment": "production" }, "name": "Telegram AI multi-format chatbot", "tags": [ "automation", "n8n", "production-ready", "excellent", "optimized" ], "nodes": [ { "id": "65196267-0d57-4af4-9081-962701478146", "name": "OpenAI Chat Model", "type": "n8n-nodes-base.noOp", "position": [ 660, 640 ], "parameters": { "model": "gpt-4o", "options": { "temperature": 0.7, "frequencyPenalty": 0.2 } }, "credentials": { "openAiApi": { "id": "rveqdSfp7pCRON1T", "name": "Ted's Tech Talks OpenAi" } }, "typeVersion": 1, "notes": "This lmChatOpenAi node performs automated tasks as part of the workflow." }, { "id": "fc446ef0-2f15-42e7-a993-7960d76d8876", "name": "Window Buffer Memory", "type": "n8n-nodes-base.noOp", "position": [ 800, 640 ], "parameters": { "sessionKey": "YOUR_CREDENTIAL_HERE", "contextWindowLength": 10 }, "typeVersion": 1, "notes": "This memoryBufferWindow node performs automated tasks as part of the workflow." }, { "id": "51c3cddd-fc21-4fff-b615-ea7080c47947", "name": "Correct errors", "type": "n8n-nodes-base.telegram", "position": [ 1220, 580 ], "parameters": { "text": "={{ $('AI Agent').item.json.output.replace(/&/g, \"&\").replace(/>/g, \">\").replace(/bold, bold\nitalic, italic\nunderline, underline\nstrikethrough, strikethrough, strikethrough\nspoiler, spoiler\nbold italic bold italic bold strikethrough italic bold strikethrough spoiler underline italic bold bold\ninline URL\ninline fixed-width code\n
pre-formatted fixed-width code block
\n2. Any code that you send should be wrapped in these tags:
pre-formatted fixed-width code block written in the Python programming language
\nOther programming languages are supported as well.\n3. All <, > and & symbols that are not a part of a tag or an HTML entity must be replaced with the corresponding HTML entities (< with <, > with > and & with &)\n4. If the user sends you a message starting with / sign, it means this is a Telegram bot command. For example, all users send /start command as their first message. Try to figure out what these commands mean and reply accodringly\n" } }, "typeVersion": 1.1, "notes": "This agent node performs automated tasks as part of the workflow." }, { "id": "2c56536d-1a86-4a49-b495-3e877adb308a", "name": "Determine content type", "type": "n8n-nodes-base.switch", "position": [ -180, 480 ], "parameters": { "rules": { "values": [ { "outputKey": "YOUR_CREDENTIAL_HERE", "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "operator": { "type": "string", "operation": "notEmpty", "singleValue": true }, "leftValue": "={{ $json.message.text }}", "rightValue": "/" } ] }, "renameOutput": true }, { "outputKey": "YOUR_CREDENTIAL_HERE", "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "dd41bbf0-bee0-450b-9160-b769821a4abc", "operator": { "type": "object", "operation": "exists", "singleValue": true }, "leftValue": "={{ $json.message.voice}}", "rightValue": "" } ] }, "renameOutput": true } ] }, "options": { "fallbackOutput": "extra" } }, "typeVersion": 3.2, "notes": "This switch node performs automated tasks as part of the workflow." }, { "id": "error-9523d43e", "name": "Error Handler", "type": "n8n-nodes-base.stopAndError", "typeVersion": 1, "position": [ 1000, 400 ], "parameters": { "message": "Workflow execution error", "options": {} } } ], "active": false, "pinData": {}, "settings": { "executionOrder": "v1", "saveManualExecutions": true, "callerPolicy": "workflowsFromSameOwner", "errorWorkflow": null, "timezone": "UTC", "executionTimeout": 3600, "maxExecutions": 1000, "retryOnFail": true, "retryCount": 3, "retryDelay": 1000 }, "versionId": "15ae799b-6868-4519-b579-3f202e4de5b2", "connections": { "65196267-0d57-4af4-9081-962701478146": { "main": [ [ { "node": "error-handler-65196267-0d57-4af4-9081-962701478146-03fa496a", "type": "main", "index": 0 } ] ] }, "51c3cddd-fc21-4fff-b615-ea7080c47947": { "main": [ [ { "node": "error-handler-51c3cddd-fc21-4fff-b615-ea7080c47947-6e71c294", "type": "main", "index": 0 } ] ] }, "d931b7e1-bc17-431e-ae67-967b6ef79236": { "main": [ [ { "node": "error-handler-d931b7e1-bc17-431e-ae67-967b6ef79236-d40be99e", "type": "main", "index": 0 } ] ] }, "b33335ff-5dea-4fff-8f63-fea2b11b8241": { "main": [ [ { "node": "error-handler-b33335ff-5dea-4fff-8f63-fea2b11b8241-70fbf3b2", "type": "main", "index": 0 } ] ] }, "e18de374-941f-4c2e-ab6c-6c6f68f2ce12": { "main": [ [ { "node": "error-handler-e18de374-941f-4c2e-ab6c-6c6f68f2ce12-de8021ba", "type": "main", "index": 0 } ] ] }, "b47a9583-ce5c-464f-a9e6-153fb42e685f": { "main": [ [ { "node": "error-handler-b47a9583-ce5c-464f-a9e6-153fb42e685f-2aa88f15", "type": "main", "index": 0 } ] ] }, "0196b49e-90a1-4f2f-8b94-492fced37dbf": { "main": [ [ { "node": "error-handler-0196b49e-90a1-4f2f-8b94-492fced37dbf-d266873a", "type": "main", "index": 0 } ] ] }, "89515d80-6efc-40a8-95ce-343d4ff4dbee": { "main": [ [ { "node": "error-handler-89515d80-6efc-40a8-95ce-343d4ff4dbee-05218c7c", "type": "main", "index": 0 } ] ] } }, "description": "Automated workflow: Telegram AI multi-format chatbot. This workflow integrates 10 different services: telegramTrigger, stickyNote, telegram, agent, switch. It contains 23 nodes and follows best practices for error handling and security.", "notes": "Excellent quality workflow: Telegram AI multi-format chatbot. This workflow has been optimized for production use with comprehensive error handling, security, and documentation." }