Skip to main content
Creates a webhook that can be used to suspend and resume a workflow run upon receiving HTTP requests to a generated URL. Webhooks are specialized hooks that provide an HTTP endpoint. External systems can make HTTP requests to the webhook URL to send data into the workflow.

Signature

Parameters

WebhookOptions
Configuration options for the webhook.

Returns

Webhook<Request> | Webhook<RequestWithResponse>
A webhook object that extends Hook with an HTTP URL.

Usage

Basic Webhook

Create a webhook and receive HTTP requests:

Custom Response

Automatically respond with a custom response:

Manual Response

Respond manually from within a step:

Iterate Over Multiple Requests

Handle multiple HTTP requests:

Parse Request Body

Extract data from the HTTP request:

Webhook with Custom Token

Use a predictable token:

Notes

  • Can only be called inside a workflow function (with "use workflow")
  • The webhook URL is automatically generated and includes the workflow deployment URL
  • When respondWith: 'manual' is set, you must call request.respondWith() from within a step function
  • Webhooks inherit all Hook functionality, including disposal and iteration
  • The Request object follows the Web API Request standard