Respond To Webhook
Description
Use the Respond To Webhook activity to explicitly return an HTTP response to the caller of a Webhook Trigger workflow.
This activity allows the workflow to control:
- HTTP response status codes
- Response payload content
- Custom response headers
- API response behavior
The activity is typically used together with the Webhook Trigger activity when the webhook response mode is configured as:
- Using 'Respond to Webhook' activity
This enables workflows to dynamically construct and return custom API responses based on workflow execution logic.
Configuration
The Respond To Webhook activity configuration is organized into the following sections:
- Inputs
- Headers
Inputs
Display Name
Specify a display name for the activity.
The display name identifies the activity within the Agent Builder.
Status
Specify the HTTP status code returned to the webhook caller.
The status code indicates the outcome of the webhook request processing.
Common examples include:
| Status Code | Description |
|---|---|
| 200 | Request processed successfully. |
| 201 | Resource created successfully. |
| 400 | Invalid request or bad input. |
| 401 | Unauthorized request. |
| 403 | Access forbidden. |
| 404 | Requested Resource not found. |
| 500 | Internal server error occurred during processing. |
Body
Specify the response payload returned to the webhook caller.
The response body may contain:
- Plain text
- JSON content
- XML content
- API response data
- Workflow execution results
- Error details
Example JSON response:
{
"status": "success",
"message": "Webhook processed successfully."
}
Execution settings
Configure Wait All Incoming when execution paths converge, and On Error for failure handling. Select Inherit where available to use the workflow-level error policy.
Headers
Use the Headers section to configure custom HTTP response headers returned to the webhook caller.
You can add multiple header names and value pairs to construct the response header collection.
Custom headers are commonly used for:
- Content type configuration
- CORS handling
- Authentication metadata
- API versioning
- Cache control
- Custom integration metadata
Example headers:
| Header Name | Header Value |
|---|---|
| Content-Type | application/json |
| Cache-Control | no-cache |
| X-Request-Id | 12345 |
Notes
- The Respond To Webhook activity is typically used together with the Webhook Trigger activity.
- This activity is applicable when the webhook response mode is configured as Using 'Respond to Webhook' activity.
- Only one webhook response should typically be returned for a request execution path.
- Response headers and body content should comply with the expectations of the calling application or API client.
Related
- Webhook Trigger – Configure webhook-based workflow triggers.
- Webhook Management – Manage webhook triggers in the AI Command Center.
Example: Return JSON
In Webhook Trigger, select Using 'Respond to Webhook' Activity. Add Respond To Webhook on the processing path and configure:
| Setting | Value |
|---|---|
| Status | 200 |
| Header | Content-Type = application/json |
| Body | {"status":"success","message":"Order received"} |
Body is a text/expression input. Supply valid serialized JSON when declaring application/json. Set an HTTP status from 100–599; other values fail validation. This activity publishes the HTTP response and does not produce a separate business-data output.
Use one response activity on each mutually exclusive outcome path. Ensure the caller's path reaches it before the request times out; publishing a response from one path does not make later attempts to respond useful to the same HTTP request.