Send custom webhook responses
Return custom HTTP responses from webhook-triggered patterns using Respond To Webhook.
By default, when a webhook-triggered pattern receives a request, DRAGOPS acknowledges it immediately with a 200 OK response and runs the pattern in the background. But some integrations need more than an acknowledgment — they expect a specific status code, custom headers, or a JSON body in the response. The Respond To Webhook node gives you full control over the HTTP response sent back to the caller.
How webhook responses work
DRAGOPS supports two webhook response modes:
Asynchronous (default)
Without a Respond To Webhook node, the pattern runs asynchronously. DRAGOPS immediately returns 200 OK to the caller and executes the pattern in the background. The caller does not wait for the pattern to finish and does not receive any output from the execution.
This is ideal for fire-and-forget integrations — GitHub webhooks, Slack event subscriptions, and any service that only needs confirmation that the request was received.
Synchronous
When a pattern includes a Respond To Webhook node, it runs synchronously. DRAGOPS holds the HTTP connection open until the pattern reaches the Respond To Webhook node, then sends the specified response back to the caller. This lets you process the request, build a result, and return it — all within a single HTTP request/response cycle.
This is required for integrations where the caller expects meaningful data in the response — Slack slash commands, custom API endpoints, and verification challenges.
Respond To Webhook node
Input pins
| Pin | Type | Default | Description |
|---|---|---|---|
| Status Code | Integer | 200 | The HTTP status code to return |
| Headers | Object | {} | Response headers as key-value pairs |
| Body | String | "" | The response body |
How to use it
- Right-click on the canvas and search for "Respond To Webhook".
- Add it to the canvas.
- Wire the execution flow from your processing logic to Respond To Webhook.
- Set the Status Code, Headers, and Body pins.
The Respond To Webhook node must be reachable from the On Webhook trigger through the execution flow. When execution reaches this node, DRAGOPS sends the configured response to the waiting HTTP client.
Example: Receive a webhook, process data, return a JSON response
This pattern receives a webhook request with an order, validates it, and returns a JSON response confirming the order was processed.
Step 1: Create the pattern
- Open the DRAGOPS dashboard and select New Pattern.
- Name it "Order API" and select Create.
Step 2: Add the trigger
- Remove the default On Start node.
- Right-click on the canvas, search for "On Webhook", and add it to the canvas.
Step 3: Extract and validate the order
- Add a Get Property node. Set the Key to
orderId. - Wire On Webhook's Body output pin to Get Property's Object input pin.
- Wire the execution flow from On Webhook to Get Property.
Step 4: Build the response object
- Add a Set Property node. Set the Key to
status. - Add a String literal with the value
acceptedand wire it to Set Property's Value input pin. - Add a second Set Property node. Set the Key to
orderId. - Wire Get Property's Value output pin to the second Set Property's Value input pin.
- Chain the two Set Property nodes: wire the first Set Property's Object output to the second Set Property's Object input.
- Wire the execution flow through both Set Property nodes.
Step 5: Convert to JSON and send the response
- Add a JSON Stringify node. Wire the final Set Property's Object output to JSON Stringify's Object input pin.
- Add a Respond To Webhook node.
- Set the Status Code to
200. - Add a Set Property node for headers. Set the Key to
Content-Typeand the value toapplication/json. Wire its Object output to Respond To Webhook's Headers input pin. - Wire JSON Stringify's String output to Respond To Webhook's Body input pin.
- Wire the execution flow to Respond To Webhook.
Step 6: Test
- Select Run in the toolbar.
- Enter test data:
{
"body": { "orderId": "ORD-2026-001" },
"headers": {},
"query": {},
"method": "POST"
}- The console shows the Respond To Webhook node sending:
{"status": "accepted", "orderId": "ORD-2026-001"}Step 7: Deploy and send a live request
- Select Deploy in the toolbar.
- Copy the webhook URL from the Triggers panel.
- Send a request:
curl -X POST https://your-webhook-url \
-H "Content-Type: application/json" \
-d '{"orderId": "ORD-2026-001"}'The response:
{"status": "accepted", "orderId": "ORD-2026-001"}Setting different status codes
Use the Status Code pin to return different HTTP status codes based on your logic. Common patterns:
| Status Code | Meaning | Use case |
|---|---|---|
| 200 | OK | Successful processing |
| 201 | Created | A resource was created |
| 400 | Bad Request | Invalid input data |
| 404 | Not Found | Requested resource does not exist |
| 422 | Unprocessable Entity | Valid format but failed validation |
| 500 | Internal Server Error | Unexpected failure |
Example: Return 400 for invalid input
Use a Branch node to check the input and route to different Respond To Webhook nodes:
Setting custom headers
Build a headers object using Set Property nodes. Chain multiple Set Property nodes to add several headers:
Synchronous vs asynchronous: Choosing the right mode
| Synchronous (with Respond To Webhook) | Asynchronous (without Respond To Webhook) |
|---|---|
| Caller waits for and receives a response | Caller receives an immediate 200 OK |
| Best for: API endpoints, slash commands, verification challenges | Best for: event notifications, fire-and-forget webhooks |
| Pattern must complete before the HTTP timeout | Pattern can run as long as needed |
| Heavier on the connection — holds it open | Lightweight — releases the connection immediately |
Timeout consideration: Synchronous patterns must reach the Respond To Webhook node before the HTTP connection times out. Keep synchronous patterns fast — avoid long-running operations, large loops, or multiple sequential API calls before responding. If you need to do heavy processing, send an immediate acknowledgment with Respond To Webhook first, then continue processing in a separate branch.
Tips
- Respond exactly once. A pattern should have only one Respond To Webhook node in any given execution path. If the execution flow reaches a second Respond To Webhook node, the response has already been sent and the second one has no effect.
- Set Content-Type for JSON responses. Always include a
Content-Type: application/jsonheader when the body is JSON. Many HTTP clients rely on this header to parse the response correctly. - Use Respond To Webhook for verification challenges. Services like Slack and Microsoft Teams send verification requests that expect a specific response body. Use Respond To Webhook to return the expected challenge response.
- Handle errors before responding. Wrap your processing logic in a Try / Catch so you can return a meaningful error response (with an appropriate status code) instead of letting the pattern fail silently.