Workflow
Evaluate decision table API
Fires the first row of a condition->action decision table whose conditions all match the facts; conditions support eq/ne/gt/gte/lt/lte/in/nin/between/regex/exists and wildcard. Answers 'Which rule applies to these facts?', 'What action should fire?'.
Price$0.02per request
MethodPOST
Route/v1/workflow/decision-table
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
decision-tablerulesconditionsactiondmnlookupworkflowrouting
API URL
Integration docshttps://x402.hexl.dev/v1/workflow/decision-tableExample request
{
"rules": [
{
"when": {
"tier": "gold",
"spend": {
"op": "gte",
"value": 100
}
},
"then": {
"discount": 0.2
}
},
{
"when": {
"tier": "*"
},
"then": {
"discount": 0.05
}
}
],
"facts": {
"tier": "gold",
"spend": 150
}
}Example response
{
"matched": true,
"firedRowIndex": 0,
"matchedRowIndices": [
0
],
"action": {
"discount": 0.2
},
"interpretation": "Row 0 fired."
}Input schema
{
"type": "object",
"required": [
"rules",
"facts"
],
"properties": {
"rules": {
"type": "array",
"description": "Ordered rows with when/then",
"examples": [
[
{
"when": {
"tier": "gold",
"spend": {
"op": "gte",
"value": 100
}
},
"then": {
"discount": 0.2
}
},
{
"when": {
"tier": "*"
},
"then": {
"discount": 0.05
}
}
]
]
},
"facts": {
"type": "object",
"examples": [
{
"tier": "gold",
"spend": 150
}
]
},
"firstMatch": {
"type": "boolean"
},
"default": {
"type": "object"
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}