Webhook Chains

Chains let you wire webhooks in sequence — when one webhook delivers successfully, it automatically fires the next webhook with the combined payload, enabling multi-step webhook pipelines.

Overview

A chain is a list of connections on a webhook's chainedWebhooks array. When the primary delivery succeeds, HostWebhook fires each chained webhook with a payload that includes both the original event and the previous delivery's response. Chains execute sequentially — step 2 waits for step 1.

Webhook A──▶Webhook B──▶Webhook C

Each step receives the original payload plus the previous step's response.


Chain payload structure

When a chained webhook fires, it receives a wrapped payload containing the original event data and the previous step's delivery result:

jsonChain payload (step 2)
{
  "original": {
    "type": "order.created",
    "data": {
      "orderId": "ord_123",
      "amount": 9900,
      "currency": "usd"
    }
  },
  "previous": {
    "status": 200,
    "body": {
      "processed": true,
      "internalId": "inv_456",
      "shippingEstimate": "2025-05-22"
    },
    "headers": {
      "content-type": "application/json",
      "x-request-id": "req_abc"
    }
  }
}
At step 3 and beyond, previous contains only the immediately preceding step's response — not all prior steps. If you need data from step 1 at step 3, it must be forwarded through step 2's response.

Configuration

Chain connections are defined on the source webhook's chainedWebhooks array:

FieldTypeDescription
webhookIdstringThe ID of the next webhook in the chain
continueOnFailurebooleanIf true, the chain continues even if this step's delivery fails (default: false)

Configure via API

PATCH /api/webhooks/:id

jsonRequest body
{
  "chainedWebhooks": [
    {
      "webhookId": "664a1f2e8b1c4a001f2d0002",
      "continueOnFailure": false
    },
    {
      "webhookId": "664a1f2e8b1c4a001f2d0003",
      "continueOnFailure": true
    }
  ]
}

Bridge transforms

A bridge transform modifies the payload between chain steps. This lets you reshape the original + previous payload before it reaches the next webhook. Bridge transforms use the same {{path}} interpolation syntax as payload transforms.

jsonBridge transform example
{
  "orderId": "{{original.data.orderId}}",
  "internalId": "{{previous.body.internalId}}",
  "shippingDate": "{{previous.body.shippingEstimate}}",
  "amount": "{{original.data.amount}}"
}
Use bridge transforms to flatten the nested original / previous structure into the format the next webhook expects.

Limits & safety

LimitValuePurpose
Max chain steps10Prevents excessively long chains
Max propagation depth10Prevents loops when chains trigger other chains
continueOnFailurePer connectionControls whether a failure stops the chain

Loop prevention

The pipeline engine tracks propagationDepth across chain executions. If a chain triggers another chain (or circles back to the same webhook), the depth increments. At depth 10, the chain is terminated with an error to prevent infinite loops.

Circular chains (A chains to B, B chains to A) are detected and stopped at the propagation depth limit. Avoid circular configurations — they waste event quota and produce confusing traces.

Canvas layout

On the canvas, chained webhooks are laid out horizontally — chains go to the right. This visual convention makes it easy to identify sequential chain flows.

textCanvas layout convention
[Webhook A] ──chain──▶ [Webhook B] ──chain──▶ [Webhook C]

Error handling

When continueOnFailure is false (the default), a failed delivery at any chain step stops the entire chain. Subsequent steps are not executed.

When continueOnFailure is true, the chain continues to the next step even if the current step fails. The previous payload will contain the error response instead of a success response.