n8n

How to Automate Telegram AI Customer Engagement?

Turn your Telegram channel into a smart assistant that replies to messages, welcomes new users, and makes images on demand. It supports community chats, brand engagement, and product questions. Teams can reply faster without watching the chat all day.

When a message arrives in Telegram, the bot sends a typing signal and routes the text with a command check. Free text triggers AI chat using a system prompt, temperature, and token limits that you control. The command start sends a warm welcome in the user language, and image builds a picture from the prompt and posts it back. Unknown commands get a helpful error reply, and messages use Markdown for clear formatting. A merge step coordinates the typing action and routing so messages flow smoothly.

To run it, you need a Telegram bot token and an OpenAI API key. After setup, most replies are instant, manual replies drop by a large margin, and chat volume can scale without extra staff. You can tune temperature and token length to match your brand tone and keep costs in check. Use it for product Q and A, campaign teasers with quick images, or community engagement that stays active around the clock.

What are the key features?

  • Telegram trigger listens to every incoming message
  • Command router checks for start, image, and default chat paths
  • AI chat replies using OpenAI GPT 4 with a custom system prompt
  • Image generation from text and delivery back to the same chat
  • Typing action shows real time feedback while the AI thinks
  • Central settings for temperature and token limit to control tone and length
  • Markdown formatting for clean and readable responses
  • Error fallback sends clear help for unsupported commands
  • Branch merge coordinates typing and routing before processing

What are the benefits?

  • Reduce manual replies by 80 percent through automated chat
  • Cut response time from minutes to seconds with AI answers
  • Handle up to 5 times more chat volume without extra staff
  • Improve onboarding with localized welcomes for every user
  • Lower errors by guiding unsupported commands to the right format
  • Boost engagement with live typing signals during processing

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Telegram and OpenAI. See the Tools Required section above for links to create accounts with these services.
  3. Create a Telegram bot: In Telegram search for BotFather, create a new bot, and copy the bot token.
  4. In n8n open Credentials and add a Telegram credential. Or double click the Telegram Trigger node, choose Credential to connect with, click Create new credential, and paste the bot token. Save and test the connection.
  5. Generate an OpenAI API key from your OpenAI account API keys page. In n8n create a new OpenAI credential and paste the key. Assign this credential to the Chat_mode, Greeting, and Create an image nodes.
  6. Open the Settings node. Review model_temperature and token_length. Update system_command to match your brand voice and safety rules. Keep the chatId expressions as they are so replies go to the right user.
  7. Enable the Telegram Trigger node and activate the workflow. This lets the bot receive updates from Telegram in real time.
  8. Send /start to your bot in Telegram. You should see a localized welcome message formatted with Markdown.
  9. Send a normal message. Watch the typing indicator, then check that the AI reply appears and uses your tone settings.
  10. Send /image followed by a prompt, for example /image a red car on the beach. Confirm that an image is returned in the chat.
  11. Try an unsupported command. You should get a helpful error message that explains what to do instead.
  12. If nothing arrives in n8n, make sure your n8n instance is reachable on the internet and the bot token is valid. If needed, recreate the Telegram credential, then deactivate and reactivate the workflow.
  13. If images fail, confirm your OpenAI key is active and has billing enabled, then check the Create an image node options and try a simpler prompt.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

OpenAI

Sign up

Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens

Telegram

Sign up

Free: $0, Telegram Bot API usage is free for developers

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.