Respond to Webhook
Use the Respond to Webhook node to control the response to incoming webhooks. This node works with the Webhook node.
The Respond to Webhook node runs once, using the first incoming data item. Refer to Return more than one data item for more information.
How to use Respond to Webhook
To use the Respond to Webhook node:
- Add a Webhook node as the trigger node for the workflow.
- In the Webhook node, set Respond to Using 'Respond to Webhook' node.
- Add the Respond to Webhook node anywhere in your workflow. If you want it to return data from other nodes, place it after those nodes.
Node parameters
Configure the node behavior using these parameters.
Respond With
Choose what data to send in the webhook response.
- All Incoming Items: Respond with all the JSON items from the input.
- Binary File: Respond with a binary file defined in Response Data Source.
- First Incoming Item: Respond with the first incoming item's JSON.
- JSON: Respond with a JSON object defined in Response Body.
- JWT Token: Respond with a JSON Web Token (JWT).
- No Data: No response payload.
- Redirect: Redirect to a URL set in Redirect URL.
- Text: Respond with text set in Response Body.
Node options
Select Add Option to view and set the options.
- Response Code: Set the response code to use.
- Response Headers: Define the response headers to send.
- Put Response in Field: Available when you respond with All Incoming Items or First Incoming Item. Set the field name for the field containing the response data.
Workflow behavior
When using the Respond to Webhook node, workflows behave as follows:
- The workflow finishes without executing the Respond to Webhook node: it returns a standard message with a 200 status.
- The workflow errors before the first Respond to Webhook node executes: the workflow returns an error message with a 500 status.
- A second Respond to Webhook node executes after the first one: the workflow ignores it.
- A Respond to Webhook node executes but there was no webhook: the workflow ignores the Respond to Webhook node.
Output the response sent to the webhook
By default, the Respond to Webhook node has a single output branch that contains the node's input data.
You can optionally enable a second output branch containing the response sent to the webhook. To enable this secondary output, open the Respond to Webhook node on the canvas and select the Settings tab. Activate the Enable Response Output Branch option.
The node will now have two outputs:
- Input Data: The original output, passing on the node's input.
- Response: The response object sent to the webhook.