Templates / Telegram AI Chatbot Powered by GPT

Telegram AI Chatbot Powered by GPT

Intermediate   Apps: Telegram, OpenAI  ·  Setup: 15 minutes

Chatbot platforms charge $30-100/month to connect an LLM to a messaging app. With n8n you wire Telegram to an AI model directly: a bot that answers questions in your own style, with your own system prompt, for pennies of API usage.

Download workflow JSON (free) Setup guide

What this workflow does

  1. A Telegram Trigger fires whenever someone messages your bot.
  2. An AI node sends the message to GPT with a system prompt you control (support agent, tutor, sarcastic friend - your call).
  3. A Telegram node sends the AI's answer back to the same chat.
  4. Replies land in a couple of seconds and each exchange costs a fraction of a cent.

Setup guide

  1. Create a bot with @BotFather in Telegram (send /newbot, copy the token).
  2. Import the JSON into n8n and paste the bot token into the Telegram credentials.
  3. Add your OpenAI API credential to the AI node - or swap in the Anthropic or Google node.
  4. Edit the system prompt in the AI node to define your bot's personality and rules.
  5. Activate the workflow and message your bot on Telegram.

Want this running 24/7?

Self-host n8n on a cheap VPS and this workflow runs around the clock for less than a coffee a month.

Get an n8n VPS from $5/month

FAQ

Does the bot remember the conversation?This template is stateless - each message stands alone. For memory, add the AI Agent node with a Window Buffer Memory keyed on the Telegram chat ID.
Can I restrict who can use the bot?Yes. Add an IF node after the trigger that checks {{ $json.message.from.id }} against your own Telegram user ID and only continues for allowed users.
Can it use Claude or Gemini instead of GPT?Yes - swap the OpenAI node for the Anthropic or Google Gemini node. The rest of the workflow is unchanged.

Want the workflows this one is a warm-up for?

The Mega Bundle packs both WorkflowForge Pro volumes — 32 production-grade workflows: automations (cart recovery, lead scoring, invoice extraction) and AI agents (support agent, calendar assistant, research agent), each with a setup guide. $39 for both, instant download.

Get the Mega Bundle →

Need it customized for your exact process?

I build custom n8n automations and AI agents professionally: your tools, your edge cases, tested and documented.

Hire me on Fiverr →