WorkflowChatGPTOpen

Telegram AI chatbot n8n with image generation

This n8n workflow runs a Telegram bot that chats with OpenAI by default and creates pictures when you send /image with a request. It is for people who want a personal or team AI assistant inside Telegram with both text replies and image generation.

What it does

The Telegram trigger passes each message to a switch that checks the command. /start sends a greeting written by OpenAI, /image plus a prompt generates an image, and plain text goes to chat mode, with a typing action while it works. Unsupported commands get an error fallback.

How to use it

Create a bot with BotFather, add the Telegram and OpenAI credentials, and adjust the Settings node.

More in ChatGPT and the n8n workflow library.

Full text

Front matter
name: Telegram AI-bot
description: Triggered manually or by an app event. Connects OpenAI, Stop And Error, Switch, Telegram. ## Error fallback for unsupported commands ## Chatbot mode by default ### (when no command is provided) ## Welcome message ### /start ## Create an image ### /image + request
category: Automation
kind: Workflow
software: OpenAI|Stop And Error|Switch|Telegram

Telegram AI-bot

Triggered manually or by an app event. Connects OpenAI, Stop And Error, Switch, Telegram. ## Error fallback for unsupported commands ## Chatbot mode by default

(when no command is provided) ## Welcome message

/start ## Create an image

/image + request

Steps

  • Telegram Trigger (telegramTrigger)
  • CheckCommand (switch)
  • Sticky Note (stickyNote)
  • Settings (set)
  • Sticky Note1 (stickyNote)
  • Sticky Note2 (stickyNote)
  • Chat_mode (openAi)
  • Greeting (openAi)
  • Text reply (telegram)
  • Send Typing action (telegram)
  • Merge (merge)
  • Sticky Note3 (stickyNote)
  • Create an image (openAi)
  • Send error message (telegram)
  • Send image (telegram)
  • PreProcessing (set)
  • Error Handler (stopAndError)

Import

Download the JSON from the GitHub source and import it in n8n (Workflows, Import from file).

Source and license

Source: https://github.com/Zie619/n8n-workflows/blob/main/Openai/0248_Openai_Telegram_Automate_Triggered.md

Author: Zie619, n8n workflow collection. License: MIT.

Shown here with formatting for the web. Keep the author and license notice when you reuse it.

Related entries

There are more like this in the members library

The n8n workflow library holds 1,814 entries. Members can search all of them by meaning and read every one in full.