Skip to main content

Extract JSON Action

The extract_json action pulls values from the incoming request and stores them as chain variables. Subsequent actions can reference these variables via template interpolation using $variable.<name>$.

Configuration

{
"type": "extract_json",
"name": "Extract order details",
"config": {
"source": "body",
"extractions": [
{"path": "order.id", "variable": "order_id"},
{"path": "order.customer.email", "variable": "customer_email"},
{"path": "order.items[0].name", "variable": "first_item"}
]
}
}

Fields

FieldTypeRequiredDescription
sourcestringYesWhere to extract from: "body", "headers", or "query"
extractionsarrayYesList of extraction rules (at least one required)

Extraction rule

FieldTypeRequiredDescription
pathstringYesDot-notation path to the value (e.g., order.id, items[0].name)
variablestringYesVariable name to store the value (alphanumeric and underscores: [a-zA-Z0-9_]+)

Behavior

  • Extractions are processed in order
  • If a path doesn't match any data, that extraction is silently skipped — no error is raised
  • Extracted variables are available to all subsequent actions in the chain via $variable.<name>$
  • Variables only persist for the current webhook request

Examples

Extract from body

{
"source": "body",
"extractions": [
{"path": "event.type", "variable": "event_type"},
{"path": "event.data.object.id", "variable": "object_id"}
]
}

Use in a later action: $variable.event_type$, $variable.object_id$

Extract from headers

{
"source": "headers",
"extractions": [
{"path": "x-github-event", "variable": "github_event"},
{"path": "x-hub-signature-256", "variable": "signature"}
]
}

Extract from query parameters

{
"source": "query",
"extractions": [
{"path": "token", "variable": "auth_token"},
{"path": "env", "variable": "environment"}
]
}