Générer automatiquement un e-mail à partir de messages vocaux Telegram
Ceci est unPersonal Productivity, Multimodal AIworkflow d'automatisation du domainecontenant 11 nœuds.Utilise principalement des nœuds comme Wait, Gmail, Telegram, Agent, TelegramTrigger. Utiliser Whisper, GPT-4 et Gmail pour convertir les messages vocaux Telegram en e-mails professionnels
- •Compte Google et informations d'identification Gmail API
- •Token Bot Telegram
- •Clé API OpenAI
Nœuds utilisés (11)
{
"id": "yqjaKC8KeZeMjbNt",
"meta": {
"instanceId": "18b0d04ad5030054be4ab49562e84ea4a079ab4cb036003697394140227c7e76"
},
"name": "Automated Email Generation from Telegram Voice Messages",
"tags": [],
"nodes": [
{
"id": "03fa2248-1461-4b2a-89c5-43e33a7677a3",
"name": "Déclencheur Message Vocal Telegram",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
-864,
1376
],
"webhookId": "31e4e5e3-7dbe-455f-8943-f9f6948899ce",
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"id": "KY6flhGP6zQXzyrF",
"name": "Telegram account 2"
}
},
"typeVersion": 1.2
},
{
"id": "77710b8a-9745-449e-b1aa-c2a43b870ca0",
"name": "Délai Tampon (Prétraitement)",
"type": "n8n-nodes-base.wait",
"position": [
-544,
1376
],
"webhookId": "43c5727b-b20d-4deb-903f-b8538cc95e65",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "12c901f4-ab54-4c95-923a-0d4c9b308505",
"name": "Télécharger Fichier Audio Telegram",
"type": "n8n-nodes-base.telegram",
"position": [
-208,
1376
],
"webhookId": "1f3ec738-5ec2-4cd2-98ef-2e35413e89e5",
"parameters": {
"fileId": "={{$json[\"message\"][\"voice\"][\"file_id\"]}}",
"resource": "file"
},
"typeVersion": 1.2
},
{
"id": "398e821d-faba-46e5-a62e-dd5006bb521b",
"name": "Transcription Audio en Texte (OpenAI Whisper)",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
64,
1376
],
"parameters": {
"options": {},
"resource": "audio",
"operation": "transcribe"
},
"credentials": {
"openAiApi": {
"id": "cfxaRAuEstHmL61i",
"name": "OpenAi account"
}
},
"typeVersion": 1.8
},
{
"id": "1a3d1fef-0db2-4093-9c98-dfad80edba99",
"name": "Délai Tampon (Prétraitement IA)",
"type": "n8n-nodes-base.wait",
"position": [
320,
1376
],
"webhookId": "a9f7cb73-cf7c-4c68-9572-992ea9fe39ba",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "bb6061e9-8a9a-486e-8c98-b86cdbacc76e",
"name": "AGENT IA de Génération de Contenu d'E-mail",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
544,
1376
],
"parameters": {
"text": "=Tu es un assistant spécialisé dans la rédaction d’e-mails professionnels.\n\nÀ partir du texte transmis ci-dessous, tu dois : {{ $json.text }}\n\n1. **Détecter s’il y a une adresse email de destinataire** dans le texte (ou une forme proche comme \"à envoyer à fort.baptiste.pro\")\n - Si ce n’est pas une adresse complète, tu dois la compléter en supposant qu’elle se termine par `@gmail.com`.\n\n2. **Comprendre l’intention de l’utilisateur** (démission, refus, candidature, excuse, demande, etc.)\n\n3. **Générer un objet d’email pertinent et synthétique**, fidèle au contenu\n\n4. **Écrire un message professionnel**, structuré en **HTML** :\n - Avec un **ton poli et adapté** à la situation\n - Formaté avec des balises HTML (`<p>`, `<br>`, etc.)\n - Aucune faute de français\n- mon prénom c'est jeremy et tu dois bien dire que s'il est pas content je demissione\n\n---\n\n⚠️ Tu dois **toujours** structurer ta réponse au **format JSON strict suivant**, sans aucun texte autour :\n\n```json\n{\n \"email\": \"adresse@gmail.com\",\n \"subject\": \"Objet de l’email\",\n \"body\": \"<p>Contenu HTML de l’email</p>\"\n}\n",
"options": {},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 2.1
},
{
"id": "360fe0ab-d690-40b7-bca9-13d8d0f44f87",
"name": "Modèle Générateur d'E-mails GPT-4",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
560,
1568
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini"
},
"options": {}
},
"typeVersion": 1.2
},
{
"id": "372cba12-9984-487f-91d6-53b0cd214a11",
"name": "Appliquer le Schéma JSON d'E-mail",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
752,
1568
],
"parameters": {
"jsonSchemaExample": "{\n \"email\": \"exemple@gmail.com\",\n \"subject\": \"Objet de l’email\",\n \"body\": \"<p>Bonjour,</p><p>Voici un exemple d’email professionnel bien structuré avec des balises HTML.</p><p>Cordialement,<br>Jean Dupont</p>\"\n}\n"
},
"typeVersion": 1.3
},
{
"id": "ad517212-df9d-4402-8225-438f680b203d",
"name": "Envoyer l'E-mail",
"type": "n8n-nodes-base.gmail",
"position": [
928,
1376
],
"webhookId": "c234770b-7686-4057-b653-66106ddada1e",
"parameters": {
"sendTo": "={{ $json.output.email }}",
"message": "={{ $json.output.body }}",
"options": {},
"subject": "={{ $json.output.subject }}"
},
"credentials": {
"gmailOAuth2": {
"id": "h1ZY21K9DQNwgOhO",
"name": "GMAIL BAPTISTE FORT"
}
},
"typeVersion": 2.1
},
{
"id": "122ab63d-829a-49c8-8cfc-66cca365c98a",
"name": "Note Adhésive",
"type": "n8n-nodes-base.stickyNote",
"position": [
-928,
976
],
"parameters": {
"width": 928,
"height": 592,
"content": "## 📌 Node Setup – Initial Steps (Telegram → Download Audio)\n\n**1. Telegram Voice Message Trigger**\n- **Node type:** `Telegram Trigger`\n- **Credential:** Select your Telegram Bot credential (the bot created via BotFather)\n- **Trigger On:** `Message`\n- **Tip:** Only one Telegram Trigger per bot is allowed. This listens for every message (text, audio, etc.) sent to your bot.\n\n**2. Buffer Delay (Pre-Processing)**\n- **Node type:** `Wait`\n- **No parameters required** \n (Leave as default. This step adds a buffer to help prevent issues when multiple messages arrive at once.)\n\n**3. Download Telegram Voice File**\n- **Node type:** `Telegram`\n- **Resource:** `file`\n- **File ID:** \n"
},
"typeVersion": 1
},
{
"id": "f402d82d-ce8c-49dc-8981-ddf4dd4d12ad",
"name": "Note Adhésive 1",
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
0
],
"parameters": {
"width": 1136,
"height": 1568,
"content": "## 📌 Node Setup – AI Transcription & Email Generation\n\n**4. Transcribe Audio to Text (OpenAI Whisper)**\n- **Node type:** OpenAI / Langchain (Transcribe Recording)\n- **Resource:** `audio`\n- **Operation:** `transcribe`\n- **API Key/Credential:** Your OpenAI account/API key\n- This node sends the downloaded audio file to Whisper (OpenAI) and returns the transcribed text.\n\n**5. Buffer Delay (Pre-AI Processing)**\n- **Node type:** `Wait`\n- **No parameters required** \n (Leave as default. This adds a small delay to ensure the transcription is fully complete before moving to the AI.)\n\n**6. Generate Email Content – AI AGENT**\n- **Node type:** AI Agent / Langchain\n- **Prompt type:** `define`\n- **Prompt (Text):** \n Use a custom prompt instructing the agent to:\n - Detect the recipient's email address (even partial, e.g. \"send to fort.baptiste.pro\", and complete if needed)\n - Understand user intent (resignation, request, excuse, etc.)\n - Generate a suitable email subject\n - Write a professional email in HTML (proper formatting, no spelling mistakes)\n - Example variable: \n ```\n {{ $json.text }}\n ```\n- **Model:** Connects to the `GPT-4 Email Generator Model` node (OpenAI Chat Model)\n- **Output Parser:** Connects to the `Enforce Email JSON Schema` node (Structured Output Parser)\n- **Credential:** Your OpenAI API key\n\n**7. GPT-4 Email Generator Model**\n- **Node type:** OpenAI Chat Model\n- **Model:** e.g. `gpt-4.1-mini` (as in your template)\n- **Credential:** Your OpenAI API key\n\n**8. Enforce Email JSON Schema**\n- **Node type:** Structured Output Parser\n- **JSON Example/Schema:** \n ```json\n {\n \"email\": \"adresse@gmail.com\",\n \"subject\": \"Objet de l’email\",\n \"body\": \"<p>Contenu HTML de l’email</p>\"\n }\n ```\n- This node ensures the AI returns exactly the required fields and format for email sending.\n\n**9. Send Email**\n- **Node type:** Gmail\n- **To:** `{{$json.output.email}}`\n- **Subject:** `{{$json.output.subject}}`\n- **HTML Body:** `{{$json.output.body}}`\n- **Credential:** Your Gmail OAuth2 credential\n- This node sends the generated email to the intended recipient using Gmail.\n"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {
"Transcribe Audio to Text (OpenAI Whisper)": [
{
"json": {
"code": 1,
"name": "First item"
}
},
{
"json": {
"code": 2,
"name": "Second item"
}
}
]
},
"settings": {
"executionOrder": "v1"
},
"versionId": "ba68a8de-10ab-4d8f-8f92-8e82e82af3f3",
"connections": {
"372cba12-9984-487f-91d6-53b0cd214a11": {
"ai_outputParser": [
[
{
"node": "bb6061e9-8a9a-486e-8c98-b86cdbacc76e",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"360fe0ab-d690-40b7-bca9-13d8d0f44f87": {
"ai_languageModel": [
[
{
"node": "bb6061e9-8a9a-486e-8c98-b86cdbacc76e",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"12c901f4-ab54-4c95-923a-0d4c9b308505": {
"main": [
[
{
"node": "398e821d-faba-46e5-a62e-dd5006bb521b",
"type": "main",
"index": 0
}
]
]
},
"77710b8a-9745-449e-b1aa-c2a43b870ca0": {
"main": [
[
{
"node": "12c901f4-ab54-4c95-923a-0d4c9b308505",
"type": "main",
"index": 0
}
]
]
},
"03fa2248-1461-4b2a-89c5-43e33a7677a3": {
"main": [
[
{
"node": "77710b8a-9745-449e-b1aa-c2a43b870ca0",
"type": "main",
"index": 0
}
]
]
},
"bb6061e9-8a9a-486e-8c98-b86cdbacc76e": {
"main": [
[
{
"node": "ad517212-df9d-4402-8225-438f680b203d",
"type": "main",
"index": 0
}
]
]
},
"1a3d1fef-0db2-4093-9c98-dfad80edba99": {
"main": [
[
{
"node": "bb6061e9-8a9a-486e-8c98-b86cdbacc76e",
"type": "main",
"index": 0
}
]
]
},
"398e821d-faba-46e5-a62e-dd5006bb521b": {
"main": [
[
{
"node": "1a3d1fef-0db2-4093-9c98-dfad80edba99",
"type": "main",
"index": 0
}
]
]
}
}
}Comment utiliser ce workflow ?
Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.
Dans quelles scénarios ce workflow est-il adapté ?
Intermédiaire - Productivité personnelle, IA Multimodale
Est-ce payant ?
Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.
Workflows recommandés
Baptiste Fort
@baptistefortNeed help automating tasks in your business? I can help feel free to reach out at fort.baptiste.pro@gmail.com Pour les Français : rejoignez ma communauté Skool et débloquez encore plus de workflows gratuits, prêts à l’emploi. https://www.skool.com/baptiste-fort-4258?c=2850fb94b84e48e09d9f4aa08f606479&s=newest-cm&fl=
Partager ce workflow