Catalog/workflow-predicate-eval

Workflow

Predicate DSL evaluate API

Evaluates a nested predicate tree (all/any/not + fact comparisons) against a context and returns the boolean result with a per-leaf trace. Answers 'Is this composite condition satisfied?', 'Which sub-conditions passed?'.

Price$0.02per request
MethodPOST
Route/v1/workflow/predicate-eval
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
predicatedslallanynotconditionbooleanworkflow
API URLhttps://x402.hexl.dev/v1/workflow/predicate-eval
Integration docs
Example request
{
  "predicate": {
    "all": [
      {
        "fact": "country",
        "op": "eq",
        "value": "US"
      },
      {
        "fact": "age",
        "op": "gte",
        "value": 21
      }
    ]
  },
  "context": {
    "country": "US",
    "age": 30
  }
}
Example response
{
  "result": true,
  "leafCount": 2,
  "trace": [
    {
      "leaf": "country eq \"US\"",
      "result": true
    },
    {
      "leaf": "age gte 21",
      "result": true
    }
  ],
  "interpretation": "Predicate satisfied (2/2 leaves true)."
}
Input schema
{
  "type": "object",
  "required": [
    "predicate",
    "context"
  ],
  "properties": {
    "predicate": {
      "type": "object",
      "examples": [
        {
          "all": [
            {
              "fact": "country",
              "op": "eq",
              "value": "US"
            },
            {
              "fact": "age",
              "op": "gte",
              "value": 21
            }
          ]
        }
      ]
    },
    "context": {
      "type": "object",
      "examples": [
        {
          "country": "US",
          "age": 30
        }
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}