Skip to content

Telegram 触发节点常见问题#

¥Telegram Trigger node common issues

以下是 Telegram 触发节点 的一些常见错误和问题,以及解决或故障排除步骤。

¥Here are some common errors and issues with the Telegram Trigger node and steps to resolve or troubleshoot them.

等待触发事件卡住#

¥Stuck waiting for trigger event

使用“执行”步骤或“执行工作流”按钮测试 Telegram 触发器节点时,执行过程可能看起来卡住,无法停止监听事件。如果出现这种情况,你可能需要退出工作流并重新打开以重置画布。

¥When testing the Telegram Trigger node with the Execute step or Execute workflow buttons, the execution may appear stuck and unable to stop listening for events. If this occurs, you may need to exit the workflow and open it again to reset the canvas.

监听事件卡住通常是由于 n8n 之外的网络配置问题导致的。具体来说,当你在反向代理后运行 n8n 而未配置 WebSocket 代理时,通常会出现此行为。

¥Stuck listening events often occur due to issues with your network configuration outside of n8n. Specifically, this behavior often occurs when you run n8n behind a reverse proxy without configuring websocket proxying.

要解决此问题,请检查你的反向代理配置(Nginx、Caddy、Apache HTTP 服务器、Traefik 等),启用 WebSocket 支持。

¥To resolve this issue, check your reverse proxy configuration (Nginx, Caddy, Apache HTTP Server, Traefik, etc.) to enable websocket support.

错误请求:错误的 Webhook:必须为 webhook 提供 HTTPS URL#

¥Bad request: bad webhook: An HTTPS URL must be provided for webhook

当你在反向代理后运行 n8n,并且实例的 webhook URL 存在问题时,会发生此错误。

¥This error occurs when you run n8n behind a reverse proxy and there is a problem with your instance's webhook URL.

当 n8n 运行在反向代理之后时,你必须使用 n8n 实例运行所在的公共 URL 进行 配置 WEBHOOK_URL 环境变量 重定向。对于 Telegram,此 URL 必须使用 HTTPS。

¥When running n8n behind a reverse proxy, you must configure the WEBHOOK_URL environment variable with the public URL where your n8n instance is running. For Telegram, this URL must use HTTPS.

要修复此问题,请在反向代理中配置 TLS/SSL 终止。之后,请更新 WEBHOOK_URL 环境变量以使用 HTTPS 地址。

¥To fix this issue, configure TLS/SSL termination in your reverse proxy. Afterward, update your WEBHOOK_URL environment variable to use the HTTPS address.

工作流仅在测试或生产环境中运行#

¥Workflow only works in testing or production

Telegram 每个应用只允许注册一个 Webhook。这意味着每次你从使用测试 URL 切换到生产 URL(反之亦然)时,Telegram 都会覆盖已注册的 webhook URL。

¥Telegram only allows you to register a single webhook per app. This means that every time you switch from using the testing URL to the production URL (and vice versa), Telegram overwrites the registered webhook URL.

如果你尝试测试一个在生产环境中也处于活动状态的工作流,则可能会遇到问题。Telegram 机器人只会将事件发送到两个 webhook URL 中的一个,因此另一个 URL 将永远不会收到事件通知。

¥You may have trouble with this if you try to test a workflow that's also active in production. The Telegram bot will only send events to one of the two webhook URLs, so the other will never receive event notifications.

要解决此问题,你可以在测试时禁用工作流,或者为测试和生产环境创建单独的 Telegram 机器人。

¥To work around this, you can either disable your workflow when testing or create separate Telegram bots for testing and production.

要创建一个单独的 Telegram 机器人用于测试,请重复创建第一个机器人的过程。请参阅 Telegram 机器人文档Telegram 机器人 API 参考 以获取更多信息。

¥To create a separate telegram bot for testing, repeat the process you completed to create your first bot. Reference Telegram's bot documentation and the Telegram bot API reference for more information.

要在测试时禁用工作流,请尝试以下操作:

¥To disable your workflow when testing, try the following:

Halts production traffic

此变通方案会暂时禁用你的生产工作流以进行测试。你的工作流在停用期间将不再接收生产流量。

¥This workaround temporarily disables your production workflow for testing. Your workflow will no longer receive production traffic while it's deactivated.

  1. 前往你的工作流页面。

¥Go to your workflow page. 2. 切换顶部面板中的“激活”开关以暂时禁用工作流。

¥Toggle the Active switch in the top panel to disable the workflow temporarily. 3. 使用测试 Webhook URL 测试你的工作流。

¥Test your workflow using the test webhook URL. 4. 测试完成后,请切换“非活动”开关以重新启用工作流。生产环境的 webhook URL 应该恢复正常工作。

¥When you finish testing, toggle the Inactive toggle to enable the workflow again. The production webhook URL should resume working.