> ## Documentation Index
> Fetch the complete documentation index at: https://openops-ecb4f397-mintlify-external-database-workflow-output.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhook responses

> Send HTTP responses back to webhook callers from your workflows

export const NarrowImage = ({src, alt, widthPercent}) => {
  const className = `narrow-image-${useId().replace(/:/g, '-')}`;
  const widthRule = widthPercent ? `width: ${widthPercent}%;` : '';
  return <>
      <style>{`
        .${className} {
          max-width: 75%;
          ${widthRule}
        }
        @media (max-width: 768px) {
          .${className} {
            max-width: 100%;
            width: auto;
          }
        }
      `}</style>

      <img className={className} src={src} alt={alt} />
    </>;
};

When a workflow is triggered by a webhook, you can send a custom HTTP response back to the caller. This enables synchronous communication patterns where the webhook caller waits for and receives a response from your workflow.

## Use cases

Webhook responses are useful when you need to:

* Return processed data to the webhook caller
* Acknowledge receipt of webhook data with custom status codes
* Implement synchronous API endpoints using OpenOps workflows
* Provide immediate feedback to external systems

## How it works

When a workflow is triggered by a webhook, OpenOps can send a response back to the caller before the workflow completes. The response includes:

* HTTP status code
* Response headers
* Response body (JSON or raw text)

By default, webhook triggers return a standard acknowledgment response. Use the **Send Webhook Response** action to customize this response.

## Sending a webhook response

To send a custom response to a webhook caller:

1. Add the **HTTP** block's **Send Webhook Response** action to your workflow
2. Configure the response properties:
   * **Status**: HTTP status code (default: 200)
   * **Headers**: Custom HTTP headers as a JSON object
   * **Body Type**: Choose between JSON or Raw text
   * **Response**: The response body content

### Example: JSON response

```json theme={null}
{
  "status": 200,
  "headers": {
    "Content-Type": "application/json"
  },
  "body": {
    "success": true,
    "message": "Data processed successfully",
    "processedAt": "2026-01-29T10:00:00Z"
  }
}
```

### Example: Raw text response

```text theme={null}
Status: 200
Body Type: Raw
Response: "Operation completed successfully"
```

## Response timing

The webhook response is sent as soon as the **Send Webhook Response** action executes in your workflow. The workflow continues to run after sending the response, but the webhook caller receives the response immediately.

<Note>
  If your workflow doesn't include a **Send Webhook Response** action, OpenOps automatically sends a default acknowledgment at the end of the workflow execution.

  ### Default response

  ```json theme={null}
  {
    "status": 200,
    "headers": {
      "Content-Type": "application/json"
    },
    "body": {
      "message": "Request completed."
    }
  }
  ```
</Note>

## Best practices

* **Send responses early**: Place the **Send Webhook Response** action early in your workflow to avoid timeouts
* **Use appropriate status codes**: Return meaningful HTTP status codes (200 for success, 400 for bad requests, 500 for errors)
* **Include error handling**: Use conditional branching to send different responses based on workflow outcomes
* **Keep responses lightweight**: Avoid sending large payloads in webhook responses

## Limitations

* Only one response can be sent per webhook trigger
* The response is sent asynchronously through the OpenOps engine

## Example workflow

Here's a complete example of a workflow that receives webhook data, processes it, and sends a custom response:

1. **Webhook trigger**: Catches incoming webhook
2. **Data validation**: Validates the incoming data
3. **Send Webhook Response**: Sends acknowledgment to caller
4. **Process data**: Continues processing in the background
5. **Store results**: Saves processed data to a database

This pattern allows you to acknowledge receipt immediately while continuing to process data asynchronously.
