DRAGOPS
DRAGOPS

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

PinTypeDefaultDescription
Status CodeInteger200The HTTP status code to return
HeadersObject{}Response headers as key-value pairs
BodyString""The response body

How to use it

  1. Right-click on the canvas and search for "Respond To Webhook".
  2. Add it to the canvas.
  3. Wire the execution flow from your processing logic to Respond To Webhook.
  4. 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

  1. Open the DRAGOPS dashboard and select New Pattern.
  2. Name it "Order API" and select Create.

Step 2: Add the trigger

  1. Remove the default On Start node.
  2. Right-click on the canvas, search for "On Webhook", and add it to the canvas.

Step 3: Extract and validate the order

  1. Add a Get Property node. Set the Key to orderId.
  2. Wire On Webhook's Body output pin to Get Property's Object input pin.
  3. Wire the execution flow from On Webhook to Get Property.

Step 4: Build the response object

  1. Add a Set Property node. Set the Key to status.
  2. Add a String literal with the value accepted and wire it to Set Property's Value input pin.
  3. Add a second Set Property node. Set the Key to orderId.
  4. Wire Get Property's Value output pin to the second Set Property's Value input pin.
  5. Chain the two Set Property nodes: wire the first Set Property's Object output to the second Set Property's Object input.
  6. Wire the execution flow through both Set Property nodes.

Step 5: Convert to JSON and send the response

  1. Add a JSON Stringify node. Wire the final Set Property's Object output to JSON Stringify's Object input pin.
  2. Add a Respond To Webhook node.
  3. Set the Status Code to 200.
  4. Add a Set Property node for headers. Set the Key to Content-Type and the value to application/json. Wire its Object output to Respond To Webhook's Headers input pin.
  5. Wire JSON Stringify's String output to Respond To Webhook's Body input pin.
  6. Wire the execution flow to Respond To Webhook.

Step 6: Test

  1. Select Run in the toolbar.
  2. Enter test data:
{
  "body": { "orderId": "ORD-2026-001" },
  "headers": {},
  "query": {},
  "method": "POST"
}
  1. The console shows the Respond To Webhook node sending:
{"status": "accepted", "orderId": "ORD-2026-001"}

Step 7: Deploy and send a live request

  1. Select Deploy in the toolbar.
  2. Copy the webhook URL from the Triggers panel.
  3. 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 CodeMeaningUse case
200OKSuccessful processing
201CreatedA resource was created
400Bad RequestInvalid input data
404Not FoundRequested resource does not exist
422Unprocessable EntityValid format but failed validation
500Internal Server ErrorUnexpected 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 responseCaller receives an immediate 200 OK
Best for: API endpoints, slash commands, verification challengesBest for: event notifications, fire-and-forget webhooks
Pattern must complete before the HTTP timeoutPattern can run as long as needed
Heavier on the connection — holds it openLightweight — 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/json header 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.

What is next?

On this page