8
n8n 中文网amn8n.com

音频转录 - n8n创作者(模板)

高级

这是一个Document Extraction, Multimodal AI领域的自动化工作流,包含 22 个节点。主要使用 If, Set, Switch, Telegram, HttpRequest 等节点。 使用Telegram和Groq Whisper的音频转录

前置要求
  • Telegram Bot Token
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "BN02jX48DXzgyJFd",
  "meta": {
    "instanceId": "733e9abfd67f4f2666a76557fe5d7598ae7705aa1e6ff21081cb972137b3c8b4",
    "templateCredsSetupCompleted": true
  },
  "name": "Audio Transcript - n8n Creator (Template)",
  "tags": [
    {
      "id": "K8YLAjjyi0ToB8gy",
      "name": "playground",
      "createdAt": "2025-10-09T12:08:34.847Z",
      "updatedAt": "2025-10-09T12:08:34.847Z"
    }
  ],
  "nodes": [
    {
      "id": "ddd06891-12f5-4227-81cd-03fd55b864fe",
      "name": "Telegram: Receive Message",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -864,
        48
      ],
      "webhookId": "823f9309-3b41-4ed6-995f-cf5b657970ee",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {
          "chatIds": "8464412504"
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "s9JmQ5AGImJ32oBQ",
          "name": "abhiman1bot - Telegram"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "fb897823-f7ef-4400-9e43-cf2b25b1c6c8",
      "name": "Switch (Check Message Type)",
      "type": "n8n-nodes-base.switch",
      "position": [
        -432,
        32
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "audio",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "da43a983-aec8-424c-956d-a4f335ec3639",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.audio.file_id }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "voice",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "b5b7d9ac-0a1a-4b65-bde4-8ab98ca2d8f4",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.voice.file_id }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "error",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "68cd3161-3841-402d-8df7-6b5e0aa062e0",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.text }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.3
    },
    {
      "id": "2ff93d32-9942-47d4-9500-91fb50a62d9d",
      "name": "Telegram: Unsupported Type Message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -448,
        320
      ],
      "webhookId": "b0f48834-4a46-4378-9f52-ab563c2ccc8d",
      "parameters": {
        "text": "Yo! I only take audio😅, drop a audio message instead!",
        "chatId": "={{ $('Telegram: Receive Message').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "s9JmQ5AGImJ32oBQ",
          "name": "abhiman1bot - Telegram"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ed090526-76d4-417d-9e2b-9eb5a1043192",
      "name": "Set Node (audio type)",
      "type": "n8n-nodes-base.set",
      "position": [
        -80,
        -48
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ed1a6e35-7378-4907-be8d-70946ffd0326",
              "name": "fileid",
              "type": "string",
              "value": "={{ $('Telegram: Receive Message').item.json.message.audio.file_id }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "60c0e970-e175-481d-9cd4-d50a83ae67f6",
      "name": "Set Node (voice type)",
      "type": "n8n-nodes-base.set",
      "position": [
        -80,
        112
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ed1a6e35-7378-4907-be8d-70946ffd0326",
              "name": "fileid",
              "type": "string",
              "value": "={{ $('Telegram: Receive Message').item.json.message.voice.file_id }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "4a1dd34d-aadd-4b4a-be92-1090529d111c",
      "name": "Telegram: Download Audio File",
      "type": "n8n-nodes-base.telegram",
      "position": [
        400,
        32
      ],
      "webhookId": "b4d5787b-b958-4d86-b0bb-98b5f6703dba",
      "parameters": {
        "fileId": "={{ $json.fileid }}",
        "download": false,
        "resource": "file"
      },
      "credentials": {
        "telegramApi": {
          "id": "s9JmQ5AGImJ32oBQ",
          "name": "abhiman1bot - Telegram"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "1f20c4c9-fea0-4bc0-b424-1bb04813f40d",
      "name": "HTTP - Transcribe Audio (Groq)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1040,
        32
      ],
      "parameters": {
        "url": "https://api.groq.com/openai/v1/audio/transcriptions",
        "method": "POST",
        "options": {
          "response": {
            "response": {
              "responseFormat": "json"
            }
          }
        },
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "url",
              "value": "=https://api.telegram.org/file/bot{{ $('Set Credentials (Groq + Telegram)').item.json.Telegram_access_token }}/{{ $('Telegram: Download Audio File').item.json.result.file_path }}"
            },
            {
              "name": "model",
              "value": "whisper-large-v3"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer {{ $('Set Credentials (Groq + Telegram)').item.json.Groq_API }}"
            },
            {
              "name": "Content-Type",
              "value": "multipart/form-data"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "af9c037a-6b23-4570-b71b-3f1cb24b31fd",
      "name": "Set Credentials (Groq + Telegram)",
      "type": "n8n-nodes-base.set",
      "position": [
        848,
        32
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "51f14a4d-3941-40f1-8990-f339f975fbe6",
              "name": "Groq_API",
              "type": "string",
              "value": "YOUR_GROQ_API_KEY"
            },
            {
              "id": "4359c1e6-d3e9-4456-8dca-da0162c54942",
              "name": "Telegram_access_token",
              "type": "string",
              "value": "YOUR_TELEGRAM_BOT_ACCESS_TOKEN"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c8c763af-dd67-448c-8d2c-cb6add5a1419",
      "name": "Telegram: Send Output Options",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1488,
        32
      ],
      "webhookId": "d26b66fd-68ef-48a8-889c-4961108c02a7",
      "parameters": {
        "chatId": "={{ $('Telegram: Receive Message').item.json.message.chat.id }}",
        "message": "=Which format do you want? 👇",
        "options": {
          "appendAttribution": false
        },
        "operation": "sendAndWait",
        "approvalOptions": {
          "values": {
            "approvalType": "double",
            "approveLabel": "Text message",
            "disapproveLabel": "Text file"
          }
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "s9JmQ5AGImJ32oBQ",
          "name": "abhiman1bot - Telegram"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "77cda3ba-1c15-4c59-88a5-6f29bece5df9",
      "name": "If: Output Type Selected",
      "type": "n8n-nodes-base.if",
      "position": [
        1696,
        32
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "9d302e0c-44e2-4b9e-a3ed-8d21e67945ed",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.data.approved }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "9346c0a9-6f5e-4f01-b156-ef0945b85bed",
      "name": "Telegram: Send Transcript Message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2048,
        -240
      ],
      "webhookId": "c27aae61-d82e-4bd5-ba6e-89d4fad05dc6",
      "parameters": {
        "text": "={{ $('HTTP - Transcribe Audio (Groq)').item.json.text }}",
        "chatId": "={{ $('Telegram: Receive Message').item.json.message.from.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "s9JmQ5AGImJ32oBQ",
          "name": "abhiman1bot - Telegram"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "95e83cb8-1db4-46c7-ab23-288bba951bf4",
      "name": "Set: Transcribed Audio Text",
      "type": "n8n-nodes-base.set",
      "position": [
        2224,
        256
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "20342409-f694-48b6-a09d-3607fed653ed",
              "name": "text",
              "type": "string",
              "value": "={{ $('HTTP - Transcribe Audio (Groq)').item.json.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "e74b6a79-5e27-4f36-962d-cda423db241e",
      "name": "Convert to TXT File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        2432,
        256
      ],
      "parameters": {
        "options": {
          "fileName": "transcription.txt"
        },
        "operation": "toText",
        "sourceProperty": "text",
        "binaryPropertyName": "=transcription"
      },
      "typeVersion": 1.1
    },
    {
      "id": "cfa6abb9-e7ec-4c13-beec-18bf88f9977f",
      "name": "Send Transcript File",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2640,
        256
      ],
      "webhookId": "3eeca011-cdd1-457b-ba1d-8806dfa0e5d2",
      "parameters": {
        "chatId": "={{ $('Telegram: Receive Message').item.json.message.from.id }}",
        "operation": "sendDocument",
        "binaryData": true,
        "additionalFields": {},
        "binaryPropertyName": "transcription"
      },
      "credentials": {
        "telegramApi": {
          "id": "s9JmQ5AGImJ32oBQ",
          "name": "abhiman1bot - Telegram"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a65deb4c-a125-4ca2-9966-bf9c4f8fcb73",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -992,
        -192
      ],
      "parameters": {
        "color": 5,
        "width": 352,
        "height": 432,
        "content": "# Telegram Trigger\n\n- Triggers workflow when a message is received in your Telegram bot.\n- Setup:\n  1. Create a bot via BotFather.\n  2. Add bot token in this node.\n  3. Choose event type (Message or Command)."
      },
      "typeVersion": 1
    },
    {
      "id": "f3f96946-1b21-4e3e-a973-84aba1c22f8f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        -288
      ],
      "parameters": {
        "color": 5,
        "width": 752,
        "height": 816,
        "content": "# Audio/Voice Switch\n\n- Checks if the incoming Telegram message is an audio file or a voice message.  \n- If valid, sets the file ID for further processing.  \n- If the message is not audio/voice:\n  - Sends a \"Wrong file type. Please send an audio or voice message.\" notification back to the user via Telegram.  \n  - Stops the workflow immediately to prevent further execution.  \n- Routes messages based on type for downstream nodes."
      },
      "typeVersion": 1
    },
    {
      "id": "1433aed5-6a96-47b3-84a1-88c76c743f34",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        -176
      ],
      "parameters": {
        "color": 5,
        "width": 352,
        "height": 416,
        "content": "# Telegram Download\n\n- Downloads the audio/voice file from Telegram using the file ID.  \n- Outputs the **file path** for use in downstream nodes."
      },
      "typeVersion": 1
    },
    {
      "id": "1911d9ab-b858-4dd3-a40e-9cc9bc3e4ee1",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        -512
      ],
      "parameters": {
        "color": 5,
        "width": 608,
        "height": 736,
        "content": "# Set & HTTP Nodes for Transcription\n\n- **Purpose:** Prepares credentials and transcribes audio using OpenAI Whisper via Groq API.  \n\n### Set Node\n- Contains fields for your credentials:  \n  - `Groq_API` → Enter your **Groq API key** (can be created for free at [Groq Console](https://console.groq.com/keys)).  \n  - `Telegram_access_token` → Enter your **Telegram bot token**.  \n- Both fields are **mandatory** for this automation to work.  \n- Ensures downstream nodes have the necessary authentication to access Telegram and Groq API.\n\n### HTTP Node\n- Sends the audio file to the **Groq API** for transcription using the OpenAI Whisper model.  \n- Uses credentials set in the Set node (`Groq_API`) for authorization.  \n- Outputs the transcribed text for further processing in the workflow.  \n\n> ⚠️ **Important:** Without entering the Telegram access token and the Groq API key in the Set node, the workflow will **not function**."
      },
      "typeVersion": 1
    },
    {
      "id": "1dc3c2c2-fdff-4454-9b9c-eedfcda542bf",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1408,
        -256
      ],
      "parameters": {
        "color": 5,
        "width": 448,
        "height": 496,
        "content": "# Telegram Reply Option & Switch\n\n- Lets user choose how to receive the transcription:  \n  - As a **Telegram message**  \n  - As a **.txt file**  \n- Switch node routes workflow into two branches based on the selected option."
      },
      "typeVersion": 1
    },
    {
      "id": "26477433-02a0-4651-98b6-c1f96a522889",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1952,
        -480
      ],
      "parameters": {
        "color": 5,
        "width": 320,
        "height": 448,
        "content": "# Telegram Send Message\n\n- Sends the transcribed text directly to the user as a Telegram message.  \n- Triggered when the user chooses the **message** option in the previous switch node."
      },
      "typeVersion": 1
    },
    {
      "id": "2e97dee2-0493-4be7-af26-aacf5dd50418",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2128,
        16
      ],
      "parameters": {
        "color": 5,
        "width": 736,
        "height": 448,
        "content": "# Set, Convert & Send Transcript as File\n\n- **Set Node:** Stores the transcribed text in a field.  \n- **Convert to File Node:** Converts the text field into a `.txt` file.  \n- **Telegram Send Document Node:** Sends the `.txt` file to the user.  \n- Triggered when the user chooses the **.txt file** option in the switch node."
      },
      "typeVersion": 1
    },
    {
      "id": "897b05e5-b03c-43e7-a4d5-4a8fe3418517",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1776,
        -320
      ],
      "parameters": {
        "color": 3,
        "width": 704,
        "height": 736,
        "content": "# Description\nTranscribe Telegram voice/audio to text using Groq's OpenAI-compatible Whisper endpoint, then return the transcript either as a Telegram message or as a `.txt` file.\n\n## How it works (brief)\n1. **Telegram Trigger** — receives incoming message.  \n2. **Switch (Audio/Voice)** — if `voice` or `audio` → set `file_id`; else send \"Wrong file type\" and stop.  \n3. **Telegram Download** — download audio using `file_id`, output **file path/binary**.  \n4. **Set Node (credentials)** — **must** set `Groq_API` and `Telegram_access_token` fields for the workflow to work.  \n5. **HTTP Node → Groq (Whisper)** — POST audio (multipart) to Groq’s transcription endpoint; get text.  \n6. **Reply Switch** — choose **message** or **.txt file**.  \n   - **Message branch:** Telegram Send Message → sends transcript text.  \n   - **File branch:** Set transcript → Convert to `.txt` → Telegram Send Document → sends file.\n\n## Requirements\n- n8n instance with internet access  \n- Telegram bot token (BotFather)  \n- Groq API key (https://console.groq.com/keys)  \n\n## Notes / Security\n- Enter `Groq_API` and `Telegram_access_token` in the **Set** node (or n8n Credentials).  \n- Do **not** hardcode keys in public nodes.  \n- Workflow stops after sending \"Wrong file type\" when incoming message is not audio/voice."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8f44217a-1e75-4f99-b539-164737cf6451",
  "connections": {
    "Convert to TXT File": {
      "main": [
        [
          {
            "node": "Send Transcript File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Node (audio type)": {
      "main": [
        [
          {
            "node": "Telegram: Download Audio File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Node (voice type)": {
      "main": [
        [
          {
            "node": "Telegram: Download Audio File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If: Output Type Selected": {
      "main": [
        [
          {
            "node": "Telegram: Send Transcript Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set: Transcribed Audio Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram: Receive Message": {
      "main": [
        [
          {
            "node": "Switch (Check Message Type)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set: Transcribed Audio Text": {
      "main": [
        [
          {
            "node": "Convert to TXT File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch (Check Message Type)": {
      "main": [
        [
          {
            "node": "Set Node (audio type)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set Node (voice type)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Telegram: Unsupported Type Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram: Download Audio File": {
      "main": [
        [
          {
            "node": "Set Credentials (Groq + Telegram)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram: Send Output Options": {
      "main": [
        [
          {
            "node": "If: Output Type Selected",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP - Transcribe Audio (Groq)": {
      "main": [
        [
          {
            "node": "Telegram: Send Output Options",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Credentials (Groq + Telegram)": {
      "main": [
        [
          {
            "node": "HTTP - Transcribe Audio (Groq)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 文档提取, 多模态 AI

需要付费吗?

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

工作流信息
难度等级
高级
节点数量22
分类2
节点类型8
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Abhiman

Abhiman

@abhimangs

Automation consultant helping creators and small teams streamline their workflows using Notion and n8n. I build systems that save time, boost productivity, and keep everything running smoothly. Check my LinkedIn to connect or collaborate on custom automations.

外部链接
在 n8n.io 查看

分享此工作流