8
n8n 中文网amn8n.com

从 Telegram 语音消息自动生成电子邮件

中级

这是一个Personal Productivity, Multimodal AI领域的自动化工作流,包含 11 个节点。主要使用 Wait, Gmail, Telegram, Agent, TelegramTrigger 等节点。 使用Whisper、GPT-4和Gmail将Telegram语音消息转换为专业电子邮件

前置要求
  • Google 账号和 Gmail API 凭证
  • Telegram Bot Token
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "yqjaKC8KeZeMjbNt",
  "meta": {
    "instanceId": "18b0d04ad5030054be4ab49562e84ea4a079ab4cb036003697394140227c7e76"
  },
  "name": "从 Telegram 语音消息自动生成电子邮件",
  "tags": [],
  "nodes": [
    {
      "id": "03fa2248-1461-4b2a-89c5-43e33a7677a3",
      "name": "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": "缓冲延迟(预处理)",
      "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": "下载 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": "音频转文本(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": "缓冲延迟(AI 预处理)",
      "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": "生成电子邮件内容 AI 助手",
      "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": "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": "强制执行电子邮件 JSON 架构",
      "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": "发送电子邮件",
      "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": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -928,
        976
      ],
      "parameters": {
        "width": 928,
        "height": 592,
        "content": "## 📌 节点设置 – 初始步骤(Telegram → 下载音频)"
      },
      "typeVersion": 1
    },
    {
      "id": "f402d82d-ce8c-49dc-8981-ddf4dd4d12ad",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 1136,
        "height": 1568,
        "content": "## 📌 节点设置 – AI 转录与电子邮件生成"
      },
      "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": {
    "Enforce Email JSON Schema": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Email Content AI AGENT",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "GPT-4 Email Generator Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Email Content AI AGENT",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Download Telegram Voice File": {
      "main": [
        [
          {
            "node": "Transcribe Audio to Text (OpenAI Whisper)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Buffer Delay (Pre-Processing)": {
      "main": [
        [
          {
            "node": "Download Telegram Voice File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Voice Message Trigger": {
      "main": [
        [
          {
            "node": "Buffer Delay (Pre-Processing)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Email Content AI AGENT": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Buffer Delay (Pre-AI Processing)": {
      "main": [
        [
          {
            "node": "Generate Email Content AI AGENT",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe Audio to Text (OpenAI Whisper)": {
      "main": [
        [
          {
            "node": "Buffer Delay (Pre-AI Processing)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 个人效率, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量11
分类2
节点类型9
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Baptiste Fort

Baptiste Fort

@baptistefort

Need 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=

外部链接
在 n8n.io 查看

分享此工作流