What This Workflow Does ✏️
This workflow uses Telegram messages as input to help users prepare speeches.
The main problem it solves is long, hard speech editing and unclear message points.
It gives back clear feedback, guides steps, and can write a new speech.
The result is faster, better speeches with less stress.
- Receives text or voice messages through Telegram Bot.
- Transcribes voice messages to text using OpenAI transcription.
- Analyzes speech contents to give feedback on clarity, structure, and pacing.
- Directs user through speech prep steps using tailored AI prompts.
- Generates new speeches based on feedback from previous messages.
- Sends back cleaned and properly split messages formatted to Telegram rules.
This saves hours of manual editing and helps people get instant, helpful AI advice for their speeches.
Tools and Services Used
- Telegram Bot API: Receives and sends messages from users.
- OpenAI API: Transcribes voice audio to text.
- Google PaLM (Google Gemini): Generates AI feedback and speech content.
- n8n: Automates message processing and AI calls using the LangChain nodes.
Inputs, Processing and Outputs
Inputs
- User sends text or voice messages via Telegram Bot.
Processing Steps
- Telegram Trigger: Watches for new messages and starts workflow.
- Message Type Detection: Checks if incoming message is text or voice.
- Audio Download and Transcription: Downloads audio file, sends to OpenAI for transcription.
- Routing Based on Keywords: Routes messages through Switch node based on words like “new speech” or “generate speech”.
- AI Prompt Setup: Sets prompt for LangChain AI Agent depending on task.
- Memory Management: Clears AI conversation memory before new tasks to avoid confusion.
- AI Response Generation: AI Agent creates feedback or speech text.
- Response Cleaning: Code node strips unsupported Telegram markdown symbols.
- Text Chunking: Code node breaks messages into parts under 4000 characters.
- Telegram Reply: Sends chunks back to user in chat.
- Memory Storage: Saves conversation history by user to keep context over messages.
Output
- Clear, relevant AI feedback or new speech texts sent back in Telegram messages.
- Messages fit Telegram limits and have no unsupported formatting.
- Conversation context maintained for smooth follow-ups.
Who Should Use This Workflow?
Anyone who needs help preparing speeches fast without confusion.
Users who send texts or voice notes and want AI feedback or new speech drafts.
Good for learners with little speech-writing experience or those with limited time.
Beginner Step-by-Step: How to Use This Workflow in n8n
Step 1: Import Workflow
- Locate the Download button on this page.
- Download the workflow JSON file.
- Open n8n editor where you build workflows.
- Select “Import from File” option in n8n.
- Upload the downloaded JSON you just got.
Step 2: Configure Credentials and Settings
- Enter your Telegram Bot API credentials in the Telegram Trigger and Telegram response nodes.
- Set your OpenAI API Key in the LangChain OpenAI transcription node.
- Provide Google PaLM (Google Gemini) API key in the AI Agent nodes.
- Check any IDs or emails used in nodes (chat ID, file IDs). Update if you have custom channels or folders.
- Review prompt text in Set prompt nodes; copy/paste any adjusted prompt if needed.
Step 3: Test the Workflow
- Send a test text message or voice note to the Telegram bot.
- Watch n8n execution panel to confirm workflow triggers.
- Check the Telegram chat for AI-generated feedback or speech text replies.
Step 4: Activate for Production
- Turn the workflow status ON in n8n editor.
- The Telegram bot will now run continuously and handle user messages.
- Monitor execution panel for errors or warnings during live use.
For more control and better reliability, consider using self-host n8n to run the workflow on your own server.
Customization Ideas
- Switch AI models from Google Gemini to OpenAI GPT by replacing the AI model nodes.
- Change system prompt text to focus on different speech styles or coaching types.
- Add support for more message types like videos or documents in Telegram Trigger and routing.
- Adjust conversation memory length by changing the contextWindowLength in Memory Buffer Window node.
Handling Edge Cases and Common Issues
AI Memory Confusion
If AI responses mix unrelated topics or have wrong details, likely the conversation memory is not cleared.
Fix by making sure the Memory Manager node wipes memory before starting new speech work.
Voice Message Transcription Failures
If voice messages do not transcribe or cause errors, likely the file ID is wrong or OpenAI API credentials are missing.
Double check Telegram audio file ID mapping and verify OpenAI API keys set properly in transcription node.
Summary of Results ✓
✓ Speeches can be made faster with AI feedback and speech creation.
✓ Messages are clear and fit Telegram’s size and format rules.
✓ Works well with both text and voice inputs.
✓ Keeps conversation context so AI replies make sense.
✓ Saves time and improves quality of public speaking preparation.

