{"product_id":"telegram-ai-reply-n8n-workflow-ollama-openai-anthropic","title":"Telegram AI Reply n8n Workflow: Ollama, OpenAI, Anthropic","description":"\u003ch3\u003eInstant Telegram AI replies—powered by Ollama, OpenAI, or Anthropic (with safe fallbacks)\u003c\/h3\u003e\n\u003cp\u003eThis \u003cstrong\u003en8n workflow\u003c\/strong\u003e automatically responds to your \u003cstrong\u003eTelegram bot\u003c\/strong\u003e messages using your chosen AI provider (Ollama, OpenAI, or Anthropic). It injects your business notes and conversation history for context, and when the AI can’t answer—or an AI request fails—it sends a predefined fallback message so customers always get a response.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eTriggers on new Telegram messages\u003c\/strong\u003e received by your bot.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLoads recent conversation turns\u003c\/strong\u003e for the Telegram chat from n8n workflow static data, building context over time.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCreates a provider-specific JSON-only prompt\u003c\/strong\u003e containing your \u003cem\u003ebusiness_name\u003c\/em\u003e, \u003cem\u003eknowledge\u003c\/em\u003e (one fact per line), conversation history, and the new user message.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSends the request via HTTP\u003c\/strong\u003e to the selected AI endpoint (Ollama, OpenAI, or Anthropic).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eParses the AI response as JSON\u003c\/strong\u003e and only uses the model’s reply when it marks the question as answerable; otherwise it uses \u003cem\u003ecannot_answer_message\u003c\/em\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSends the chosen reply back to Telegram\u003c\/strong\u003e and \u003cstrong\u003eappends both user and bot messages\u003c\/strong\u003e to the stored chat log.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eHandles errors gracefully\u003c\/strong\u003e: if the AI call errors, it sends the fallback message to Telegram.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eAnswering customer questions on Telegram using your internal \u003cstrong\u003ebusiness notes\u003c\/strong\u003e (FAQs, product facts, policies).\u003c\/li\u003e\n  \u003cli\u003eProviding consistent support responses when AI is uncertain or unavailable.\u003c\/li\u003e\n  \u003cli\u003eBuilding an operator-friendly \u003cstrong\u003eSaaS support assistant\u003c\/strong\u003e with conversation context across multiple messages.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eTriggers\/communication:\u003c\/strong\u003e Telegram Trigger, Telegram send-message\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eWorkflow logic \u0026amp; data:\u003c\/strong\u003e set, code, sticky note, and n8n workflow static data for chat history\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAI integration:\u003c\/strong\u003e HTTP request to \u003cstrong\u003eOllama\u003c\/strong\u003e, \u003cstrong\u003eOpenAI\u003c\/strong\u003e, or \u003cstrong\u003eAnthropic\u003c\/strong\u003e endpoints\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSetup:\u003c\/strong\u003e configure business_name and knowledge in the Settings node; for Ollama ensure Ollama is reachable at \u003cem\u003eollama_url\u003c\/em\u003e and the model is pulled locally; optionally set ai_provider, ai_model, and cannot_answer_message.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46123160436915,"sku":"N8N-20109","price":67.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/V3UTtuZ_nTY7K0ErkHYMp_od5oqla7.png?v=1790673200","url":"https:\/\/buyflowscripts.com\/products\/telegram-ai-reply-n8n-workflow-ollama-openai-anthropic","provider":"N8N Commerce","version":"1.0","type":"link"}