工作流开发(Workflow development)#
Webhook 节点 的工作方式与其他核心节点略有不同。n8n 建议在生产环境中构建、测试和使用 Webhook 节点时遵循这些流程。
🌐 The Webhook node works a bit differently from other core nodes. n8n recommends following these processes for building, testing, and using your Webhook node in production.
n8n 为每个 Webhook 节点生成两个 Webhook URL:一个 测试 URL 和一个 生产 URL。
🌐 n8n generates two Webhook URLs for each Webhook node: a Test URL and a Production URL.
构建和测试工作流(Build and test workflows)#
在构建或测试工作流时,请使用 测试 webhook URL。
🌐 While building or testing a workflow, use the Test webhook URL.
使用测试 webhook 可以确保你在编辑器界面中查看传入的数据,这对于调试非常有用。请选择 监听测试事件 来在将数据发送到测试 webhook 之前注册该 webhook。测试 webhook 将保持活跃状态 120 秒。
🌐 Using a test webhook ensures that you can view the incoming data in the editor UI, which is useful for debugging. Select Listen for test event to register the webhook before sending the data to the test webhook. The test webhook stays active for 120 seconds.
在本地使用 n8n 实例上的 Webhook 节点时,请以隧道模式运行 n8n:
🌐 When using the Webhook node on localhost on a self-hosted n8n instance, run n8n in tunnel mode:
生产工作流(Production workflows)#
当你的工作流程准备就绪时,请切换到使用 Production 网关 URL。然后,你可以发布工作流程,当外部服务调用该网关 URL 时,n8n 会自动运行它。
🌐 When your workflow is ready, switch to using the Production webhook URL. You can then publish your workflow, and n8n runs it automatically when an external service calls the webhook URL.
在使用生产 webhook 时,请确保已保存并发布工作流。通过生产 webhook 流动的数据在编辑器界面中是不可见的。
🌐 When working with a Production webhook, ensure that you have saved and published the workflow. Data flowing through the webhook isn't visible in the editor UI with the production webhook.
有关发布工作流的更多信息,请参阅 创建工作流。
🌐 Refer to Create a workflow for more information on publishing workflows.