Webhook Endpoints

Webhook endpoints handle incoming HTTP requests and can trigger workflows or activities in response. They run as WASM components, just like activities, but export an HTTP handler instead of named functions.

A handler receives a request and returns a response. It can call a workflow or activity directly — blocking until the result is ready — or schedule one as fire-and-forget without waiting. Join sets are not available inside webhook handlers. URL path parameters are exposed as environment variables inside the handler.

Implementation

For language-specific implementation details, see:

Example — Stargazers demo

The webhook endpoint in the stargazers demo repository shows a real-world integration with GitHub, covering:

Configuration

Associating Webhook Endpoints with HTTP Servers

Webhook endpoints don't listen for HTTP requests directly. Instead, they are associated with an [[http_server]] instance defined in your deployment configuration. This association is established using the http_server field within the [[webhook_endpoint]] or [[webhook_endpoint_js]] configuration.

[[http_server]]
name = "my_server"
listening_addr = "0.0.0.0:9000"

[[webhook_endpoint_wasm]]
name = "my_endpoint"
http_server = "my_server"
# ... other webhook endpoint settings ...

Routes Configuration

Each webhook endpoint must define one or more routes. These routes determine which incoming HTTP requests will be handled by that endpoint.

[[webhook_endpoint_wasm]]
name = "my_endpoint"
http_server = "my_server"
routes = [
    { methods = ["GET"], route = "/users/{id}" },  # Route with method
    "/products/*",                                 # Route without method (wildcard)
    "/status",                                     # Route without method (exact match)
]

Route Syntax and Matching

Obelisk supports several ways to define routes:

Route Priority and Matching Order

When an incoming HTTP request arrives, Obelisk checks the configured routes to determine which webhook endpoint should handle it. The matching process follows these rules: