A Webhook Surface lets external systems push events into your Product over HTTP. When a service like Stripe, Shopify, or GitHub sends an event, the Surface verifies it, figures out which event type it is, and routes it to the right Capability — passing the event payload through to your Flow or Agent.
Before you begin, create a Product and decide which Capability should handle incoming events. You will also need access to the external service so you can register Runtype’s webhook URL and copy its signing secret.
A Webhook Surface needs to know the shape of the events it will receive so it can route them and map their fields. There are two ways to provide it:
The Surface moves through these states as you set it up:
Review the proposed schema, then Confirm it to activate the Surface, or Reject to clear the observations and start listening again.
Most providers sign their webhooks so you can confirm an event genuinely came from them. In the Surface’s signing configuration, choose your provider and paste its signing secret. Runtype verifies every incoming event against the provider’s algorithm and rejects requests that fail.
Signature checks use constant-time comparison, and you can set a timestamp tolerance to reject replayed events. Use None only for trusted internal sources.
A single webhook endpoint often receives many event types. Event routing sends each type to the Capability that should handle it.
type for Stripe).payment_intent.* match a family of events.Runtype passes the complete event through to your Capability without rewriting it. The full request body is available as {{payload}}, so you can reference any field with a dot path — for example, {{payload.data.object.amount}}.
By default, top-level fields of the payload are also made available as Flow inputs by their own names, so {{customerId}} resolves when the payload has a customerId field. To map nested or differently named fields, define field mappings: set the Flow input name as the target and a dot path into the payload as the source.
When entering source paths, the editor suggests paths from the confirmed schema so you do not have to remember the structure.
Some providers inspect the response body rather than the status code. For those, a Surface can return a fixed response — for example, empty TwiML with an application/xml content type for Twilio, or a 204 with no content for Shopify.
If an event later diverges from the confirmed schema, the Surface enters the drift-detected state so you can review the change and re-confirm.