Imagine: What if you could turn a simple Telegram voice message into a professional email—without typing, copying, pasting, or even opening Gmail?
This workflow does it all for you: just record a voice note, and it will transcribe, format, and write a clean HTML email, then send it to the right person—all by itself.
Node: Telegram Trigger
This node listens to all Message events received by the specified bot (e.g., “BOT OFFICIEL BAPTISTE”).
Whenever a user sends a voice message, the trigger fires automatically.
⚠️ Only one Telegram trigger per bot is possible (API limitation).
Key parameter:
Trigger On
: MessageNode: Wait
Used to buffer or smooth out calls to avoid collisions if you receive several voice messages in a row.
Node: Get a file
file
)fileId = {{$json["message"]["voice"]["file_id"]}}
Node: Transcribe a recording
Node: Wait1
Same purpose as step 2: useful if you want to buffer or add a delay to absorb processing time.
Node: AI Agent
This is the core of the flow:
The transcribed text is sent to GPT-4 (or GPT-4.1-mini here, via OpenAI Chat Model)
Prompt used:
You are an assistant specialized in writing professional emails.
Based on the text below, you must: {{ $json.text }}
1. Detect if there is a recipient's email address in the text (or something similar like "send to fort.baptiste.pro")
- If it’s not a complete address, complete it by assuming it ends with `@gmail.com`.
2. Understand the user's intent (resignation, refusal, application, excuse, request, etc.)
3. Generate a relevant and concise email subject, faithful to the content
4. Write a professional message, structured in HTML:
- With a polite tone, adapted to the situation
- Formatted with HTML tags (`<p>`, `<br>`, etc.)
- No spelling mistakes in French
- My first name is jeremy and if the text says he is not happy, specify the wish to resign
⚠️ You must always return your answer in the following strict JSON format, with no extra text:
```
```json
{
"email": "[email protected]",
"subject": "Objet de l’email",
"body": "<p>Contenu HTML de l’email</p>"
}
```
Everything is strictly validated and formatted with the Structured Output Parser node.
Node: Send a message
{{$json.output.email}}
{{$json.output.subject}}
{{$json.output.body}}