- 开始使用
- 构建
- 部署并运行
- 示例
- 参考
HTTP Webhook
Set up an HTTP Webhook, as a trigger or a wait step, with its fields and the request data it outputs.
HTTP Webhook将工作流连接到任何可以发送 Webhook 的应用程序,Webhook 是应用程序在发生某些情况时向网址发送的请求。节点会为您提供该地址。您将其粘贴到另一个应用程序中,它发送的每个请求都会到达工作流。
节点出现在两个位置中,并且在两个位置中的工作方式相同:
- 作为触发器,在更改触发器列表中:每个请求都会启动新的运行。
- 作为等待步骤,在“添加节点”>“等待事件”中:运行在节点处暂停,直到请求到达,然后继续。
设置
- 添加节点,作为触发器或等待步骤。
- In Connection, select an HTTP Webhook connection, or create one. Connection describes its fields.
- 从面板顶部的框中复制 Webhook URL,并将其粘贴到其他应用程序的 Webhook 设置中。
- (可选)添加筛选器,以便仅计算匹配的请求:
- 选择“添加条件”或“添加组” 。
- 选择全部 (AND)或任意 (OR) 。
- 部署工作流。只有在部署后,请求才能到达它。
字段
| 字段 | 必填 | 描述 |
|---|---|---|
| Webhook URL | — | 要粘贴到其他应用程序中的地址。每个节点都有自己的访问权限。 |
| 连接 | 是 | 接收请求的 HTTP Webhook 连接。“刷新架构”会重新加载传入数据的形状。 |
| 筛选 | 否 | 请求必须匹配的条件。系统将忽略不匹配的请求。 |
| 输入参数 | 否 | 仅触发器。其他节点在$vars.<node ID>.output下读取的值。 |
连接
An HTTP Webhook connection receives the requests of one app. The webhook URL is created with the connection, so the node shows it only after the connection exists. Create a connection describes how to create a connection from the node. On the Connect to HTTP Webhook page, fill in these fields:
| 字段 | 要输入的内容 |
|---|---|
| Folder in which connection is stored | The folder that holds the connection. |
| What application is this webhook for? | A name for the app that sends the requests, such as Stripe-prod. It also becomes the connection identifier. |
| 身份验证类型 | None, or Header Based Authentication to accept only requests that carry a header and value that you choose. Set the same header in the other app. |
| 挑战地点 | No challenge, or where the app sends its verification challenge: Header, Body, or Query parameter. |
With Header Based Authentication, a request without the matching header is rejected with the HTTP status 401.
Some apps, such as Slack, WhatsApp, and Stripe, check the webhook URL before they send events. They send a challenge, a value that the URL must return. If the app does this, select where the challenge arrives in Challenge location, then fill in the fields that appear, as the webhook documentation of the app describes. WhatsApp, for example, sends the challenge in the hub.challenge query parameter, and expects it back as plain text.
输出
The node's output is the request that the other app sent. Until the first request arrives, the node doesn't know its shape, so send one test request before you reference its fields in later nodes.