工作流开发#
¥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 可确保你可以在编辑器 UI 中查看传入数据,这对于调试非常有用。选择“监听测试事件”以在将数据发送到测试 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.
在本地主机上的 self-hosted n8n 实例上使用 Webhook 节点时,请以隧道模式运行 n8n:
¥When using the Webhook node on localhost on a self-hosted n8n instance, run n8n in tunnel mode:
<视频 src="/_video/integrations/builtin/core-nodes/webhook/webhook-node-intro.mp4" controls width="100%">
¥
生产工作流#
¥Production workflows
当你的工作流准备就绪后,切换到使用生产环境 Webhook URL。然后你可以激活你的工作流,n8n 会在外部服务调用 webhook URL 时自动运行它。
¥When your workflow is ready, switch to using the Production webhook URL. You can then activate your workflow, and n8n runs it automatically when an external service calls the webhook URL.
使用生产 Webhook 时,请确保已保存并激活工作流。使用生产 webhook 时,通过 webhook 流出的数据在编辑器 UI 中不可见。
¥When working with a Production webhook, ensure that you have saved and activated 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 activating workflows.