8
n8n 中文网amn8n.com

维基百科播客Telegram代理 - 模板

中级

这是一个AI, Marketing领域的自动化工作流,包含 12 个节点。主要使用 Set, Switch, Telegram, Agent, TelegramTrigger 等节点,结合人工智能技术实现智能自动化。 维基百科播客生成器 - 通过Telegram的AI语音内容创作工具

前置要求
  • Telegram Bot Token
  • OpenAI API Key
  • Anthropic API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "zCH7mVwHTPMedQnn",
  "meta": {
    "instanceId": "7dfa146768a036d27a67d125f90ea637bfb301bd4fd25d0086548016421d44bd",
    "templateCredsSetupCompleted": true
  },
  "name": "维基百科播客Telegram代理 - 模板",
  "tags": [],
  "nodes": [
    {
      "id": "02ec8740-62ea-4803-aec0-93ec18f24be1",
      "name": "Telegram触发器",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -1000,
        -80
      ],
      "webhookId": "7d818408-495c-447b-9c56-2a67c783db27",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "Zq1NBOOoVJ5tyR1G",
          "name": "Wikipedia Podcast Bot"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "0820738d-45f2-49fe-8837-bd9fdbde5a25",
      "name": "Anthropic 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        -120,
        140
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "claude-sonnet-4-20250514",
          "cachedResultName": "Claude 4 Sonnet"
        },
        "options": {}
      },
      "credentials": {
        "anthropicApi": {
          "id": "WgfLltDtHqUy7q9O",
          "name": "Anthropic account"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "665f8751-48b8-46cc-bd76-d82127435ea2",
      "name": "Wikipedia",
      "type": "@n8n/n8n-nodes-langchain.toolWikipedia",
      "position": [
        0,
        140
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "54b0a604-9e7c-43dc-899b-80432e1e9aa8",
      "name": "思考",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        120,
        140
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "8c4ecbd4-e340-4017-9c73-eea76aecb30f",
      "name": "文本或语音",
      "type": "n8n-nodes-base.switch",
      "position": [
        -780,
        -80
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Text",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "7c629699-9dd6-4a75-9b76-d796875f9ac9",
                    "operator": {
                      "type": "string",
                      "operation": "notEmpty",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.text }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Voice",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "0e56bc7f-c754-4f5e-9ddd-7124e1f5d998",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.voice }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "4a62e7d8-204d-407e-a090-3dcad37c70b2",
      "name": "获取语音消息",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -560,
        20
      ],
      "webhookId": "3c23a290-0c65-447f-9e7f-f4d71226a8e9",
      "parameters": {
        "fileId": "={{ $json.message.voice.file_id }}",
        "resource": "file"
      },
      "credentials": {
        "telegramApi": {
          "id": "Zq1NBOOoVJ5tyR1G",
          "name": "Wikipedia Podcast Bot"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7c0a4950-13c5-401a-b9bc-3409cd8cde24",
      "name": "转录语音消息",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -340,
        20
      ],
      "parameters": {
        "options": {},
        "resource": "audio",
        "operation": "transcribe"
      },
      "credentials": {
        "openAiApi": {
          "id": "x1byAha0t8ltLIeW",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "73daa7c9-124f-4595-ae2a-de4aa9ce1cd4",
      "name": "为AI代理准备文本消息",
      "type": "n8n-nodes-base.set",
      "position": [
        -340,
        -180
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a5bcf087-7580-4904-88d3-ca29614fc923",
              "name": "text",
              "type": "string",
              "value": "={{ $json.message.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c8d4fa95-94b4-47ae-9332-4cefe844d4f0",
      "name": "ElevenLabs文本转语音",
      "type": "@elevenlabs/n8n-nodes-elevenlabs.elevenLabs",
      "position": [
        320,
        -80
      ],
      "parameters": {
        "text": "={{ $json.output }}",
        "voice": {
          "__rl": true,
          "mode": "list",
          "value": "yUy9CCX9brt8aPVvIWy3",
          "cachedResultName": "Ramona - Calm & Soothing Voice"
        },
        "resource": "speech",
        "requestOptions": {},
        "additionalOptions": {}
      },
      "credentials": {
        "elevenLabsApi": {
          "id": "MQAFsLdzC3NvDqyE",
          "name": "ElevenLabs account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "119ec323-c887-45ac-bd9d-b1b7691789df",
      "name": "发送语音回复",
      "type": "n8n-nodes-base.telegram",
      "position": [
        540,
        -80
      ],
      "webhookId": "ffe71aef-85a4-4a81-b220-4632e19d6982",
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "operation": "sendAudio",
        "binaryData": true,
        "additionalFields": {
          "caption": "=🎙️ Wikipedia-Podcast: {{ $('Telegram Trigger').item.json.message.text }}",
          "fileName": "={{ $('Telegram Trigger').item.json.message.text }}.mp3"
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "Zq1NBOOoVJ5tyR1G",
          "name": "Wikipedia Podcast Bot"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c2e46d2f-01e9-4512-b44d-5b2bae881341",
      "name": "维基百科播客代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -88,
        -80
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "systemMessage": "=You are a professional podcast host who creates captivating and informative 5-minute podcasts about Wikipedia articles. Your task is to produce an engaging, well-structured podcast from the topic mentioned by the user.\n\n## Your Working Method:\n\n1. **Research**: Use the Wikipedia tool to gather comprehensive information about the desired topic\n2. **Deep Dive**: Search for additional interesting details, backgrounds, and connections\n3. **Podcast Creation**: Create approximately a 5-minute podcast text (about 600-750 words)\n\n## Podcast Structure:\n\n**Intro (30-45 seconds)**\n- Greet the listeners warmly\n- Introduce the topic and spark curiosity\n- Give a brief preview of the most interesting aspects\n\n**Main Part (3.5-4 minutes)**\n- Tell the story chronologically or thematically structured\n- Emphasize particularly fascinating, surprising, or little-known facts\n- Use vivid descriptions and concrete examples\n- Make connections to current events or other well-known topics\n\n**Outro (30-45 seconds)**\n- Summarize the most important insights\n- Encourage reflection or pose an interesting concluding question\n- Say goodbye in a friendly manner\n\n## Style Guidelines:\n\n- **Conversational**: Speak as if you were telling a fascinating story to a friend\n- **Accessible**: Explain complex matters understandably without oversimplifying\n- **Enthusiastic**: Show your enthusiasm for the topic\n- **Structured**: Use clear transitions between sections\n- **Lively**: Use rhetorical questions, short pauses (marked with \"...\") and vary the pace\n- **Direct**: Continuously address the listeners with \"you\" - they are your conversation partners\n- **Tangible**: Translate large numbers and abstract statistics into understandable comparisons\n\n## Special Notes:\n\n- Pay attention to natural language suitable for speaking\n- Avoid overly long sentences or complicated nested clauses\n- Occasionally integrate \"By the way...\" or \"Did you know that...\" for additional facts\n- **No stage directions**: NEVER use brackets with music or sound cues like [INTRO MUSIC] or [OUTRO MUSIC]\n- **Make numbers tangible**: Translate large statistics into comparisons (e.g., \"As many people as live in all of Bavaria today\" instead of \"13 million\")\n- **Continuous listener address**: Use \"you\" throughout - the listeners are always directly addressed\n- Always ensure that all information comes from reliable Wikipedia sources\n\nNow create a captivating podcast about the desired topic!"
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "d6dc5f36-789e-46df-88cd-2ad9b0be7d59",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1900,
        -540
      ],
      "parameters": {
        "width": 820,
        "height": 1140,
        "content": "# 欢迎使用我的维基百科播客Telegram代理工作流!"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {
    "Telegram Trigger": [
      {
        "json": {
          "message": {
            "chat": {
              "id": 1810565648,
              "type": "private",
              "username": "FSEssen",
              "first_name": "FS"
            },
            "date": 1748536655,
            "from": {
              "id": 1810565648,
              "is_bot": false,
              "username": "FSEssen",
              "first_name": "FS",
              "language_code": "de"
            },
            "text": "City of Essen",
            "message_id": 6
          },
          "update_id": 958624919
        }
      }
    ]
  },
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "5355ca40-6418-40b0-9b54-2add30a8bb1e",
  "connections": {
    "Think": {
      "ai_tool": [
        [
          {
            "node": "Wikipedia Podcast Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Wikipedia": {
      "ai_tool": [
        [
          {
            "node": "Wikipedia Podcast Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Text or Voice": {
      "main": [
        [
          {
            "node": "Prepare Text Message for AI Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Voice Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Text or Voice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Voice Message": {
      "main": [
        [
          {
            "node": "Transcribe Voice Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Wikipedia Podcast Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Wikipedia Podcast Agent": {
      "main": [
        [
          {
            "node": "ElevenLabs Text to Speech",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe Voice Message": {
      "main": [
        [
          {
            "node": "Wikipedia Podcast Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ElevenLabs Text to Speech": {
      "main": [
        [
          {
            "node": "Send Voice Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Text Message for AI Agent": {
      "main": [
        [
          {
            "node": "Wikipedia Podcast Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 人工智能, 营销

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流