Overview
Build an n8n workflow that takes a request sent to your Telegram bot, generates an image or a spoken audio clip with the OpenAI node, and posts each kind of result to its own Telegram channel.
Problem or Objective
- Which agents can create images by running image-generation models or workflows for you?
- Which agents run multi-step workflows across your apps?
- Which agents research destinations and build an itinerary you can check before booking?
More in Content and Media
AI Agents and Models
Tools and Integrations
- Tools
- n8n · Telegram · OpenAI
- Prerequisites
- An n8n instance, a Telegram bot added to the target channels, Telegram credentials, and an OpenAI API key or n8n Cloud Gateway credits.
How It Works
Create a Telegram bot, add it to two channels you control (one for images, one for audio) and connect it to n8n with Telegram credentials. Start the workflow with the Telegram Trigger so it runs when you message the bot, for example image: a lighthouse at dusk, or voice: a 20-second welcome message. Add an OpenAI chat step that reads the request and returns the type and a cleaned-up prompt or script. Route on the type with a branching node (check n8n's Switch or If node docs for the options): one branch runs the OpenAI node's Generate an Image operation and then Telegram Send Photo to the image channel, the other runs Generate Audio and then Send Audio to the audio channel. If anyone other than you can read a channel, first send the result to your private chat with the bot and post it on only after you reply to approve it.
Implementation Workflow
Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.
- Choose the agentSet up n8n.
- Connect the toolsConnect the tools this workflow relies on: n8n, Telegram, OpenAI.
- Check the prerequisitesAn n8n instance, a Telegram bot added to the target channels, Telegram credentials, and an OpenAI API key or n8n Cloud Gateway credits.
- Gather your detailsCollect what the prompt asks for: Message sent to the bot, House style for images, Longest audio clip in seconds, Voice to use for audio.
- Run the starter promptPaste the starter prompt below into n8n and adapt it to your case.
- Check against the documentationCompare what you get with the documentation at docs.n8n.io before you rely on it.
Practical Starter Prompt: Sort a media request for the right channel
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
You receive one request sent to my Telegram bot: [Message sent to the bot]. Decide whether it asks for an image or for spoken audio. Return JSON with type set to image or audio, and either an image prompt in the style [House style for images] or a speech script of at most [Longest audio clip in seconds] seconds read in the voice [Voice to use for audio]. If the request is unclear, unsafe or asks for a real person's likeness or voice, return type set to reject with a short reason. Do not post anything yourself; the workflow sends results to my private chat first, and I approve before anything goes to a shared channel.Use this in the OpenAI chat step before the branching node. Send rejects back to your private chat. For shared channels, keep the approve-before-posting step: the result goes to your private chat, and only your approving reply sends it on.
Expected Results and Benefits
This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.
This is a suggested workflow, not a reported outcome. The n8n Telegram node page lists Send Photo, Send Audio and other message operations and says the bot must be added to a channel to send to it. The OpenAI node page lists Generate an Image and Generate Audio. The AI Agent page covers tool-using chat steps. None of the cited pages documents the routing node, and none says anything about error handling or moderation, so test both branches with harmless requests first.
Limitations and Considerations
Each image and audio generation is billed by OpenAI unless you use n8n Cloud Gateway credits, which the OpenAI node page says can replace your own API key on n8n Cloud; check prices before running it often. Restrict the Telegram Trigger to your own chat so strangers cannot spend your credits, and keep the approval step for any channel others can read. Label synthetic voices as generated where your audience or local rules expect it, and follow OpenAI's usage policies for what you generate. Results depend on your setup and were not independently reproduced by Top 200 Repos.
GitHub Repositories
AI Agent Repository
Source code of the agent that does the work.
Official Website
The official site of the main tool or project in this use case.
Related Videos
About n8n-io/n8n
Give Your Agent Tools (n8n Agents Course 5/7) (opens in a new tab)
Walkthrough of n8n by n8n: it is on the project’s own channel.
Watch on YouTube (opens in a new tab)About n8n-io/n8n
n8n AI Nodes: Connect OpenAI, Claude, and Local Models (opens in a new tab)
Walkthrough of n8n by AI Daily Lab: its description links the GitHub repository.
Watch on YouTube (opens in a new tab)Independent creators. Listing a video implies no endorsement, sponsorship or partnership.
Sources
- Telegram | Nodes | n8n Docs (opens in a new tab)
Project documentation · docs.n8n.io · Undated · Source checked 27 Nov 2026, 07:07 UTC
What this source supports
- Send Audio file to the chat and display it in the music player.
- To use most of the Message operations, you must add your bot to a channel so that it can send messages to that channel.
- n8n provides a trigger node for Telegram.
- OpenAI | Nodes | n8n Docs (opens in a new tab)
Project documentation · docs.n8n.io · Undated · Source checked 27 Nov 2026, 07:07 UTC
What this source supports
- n8n has built-in support for a wide range of OpenAI features, including creating images and assistants, as well as chatting with models.
- On n8n Cloud, you can use the OpenAI node with Gateway credits instead of your own OpenAI API key.

