# Estimate a waterfall (/docs/api/waterfalls/waterfall_estimate)

Price a waterfall before running it, without calling any vendor: per-step quote, p50 latency, fill and reach, plus worst-case and expected cost (micro-USD) and ETA. Pass a definition, or a template id with the same pins/speed/max_cost_micro choices as waterfall_create_from_template.

`POST /v1/waterfalls/estimate`

```json
{
  "operationId": "waterfall_estimate",
  "summary": "Estimate a waterfall",
  "description": "Price a waterfall before running it, without calling any vendor: per-step quote, p50 latency, fill and reach, plus worst-case and expected cost (micro-USD) and ETA. Pass a definition, or a template id with the same pins/speed/max_cost_micro choices as waterfall_create_from_template.",
  "tags": [
    "waterfalls"
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "definition": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "waterfall"
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40,
                      "pattern": "^[a-z0-9][a-z0-9_-]*$",
                      "default": "main"
                    },
                    "capability": {
                      "type": "string",
                      "pattern": "^[a-z]+(\\.[a-z0-9_]+)+$"
                    },
                    "steps": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "endpoint"
                                ]
                              },
                              "endpoint_id": {
                                "type": "string",
                                "minLength": 3,
                                "maxLength": 200
                              },
                              "id": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 40,
                                "pattern": "^[a-z0-9][a-z0-9_-]*$",
                                "description": "Stable id; defaults to the endpoint id"
                              },
                              "timeout_ms": {
                                "type": "integer",
                                "minimum": 100,
                                "maximum": 120000
                              },
                              "retries": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 5,
                                "default": 0,
                                "description": "Retries on 5xx and timeouts"
                              },
                              "retry_backoff_ms": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 30000,
                                "default": 250
                              },
                              "max_cost_micro": {
                                "type": "integer",
                                "minimum": 0,
                                "description": "Skip this step if its quote is above this"
                              },
                              "required_fields": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$"
                                },
                                "maxItems": 20,
                                "default": []
                              },
                              "min_confidence": {
                                "type": "number",
                                "minimum": 0,
                                "maximum": 100
                              },
                              "confidence_field": {
                                "type": "string",
                                "maxLength": 80,
                                "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$",
                                "default": "confidence"
                              },
                              "prefer_verified": {
                                "type": "boolean",
                                "default": false
                              },
                              "continue_on_hit": {
                                "type": "boolean",
                                "default": false
                              },
                              "credential": {
                                "type": "string",
                                "enum": [
                                  "auto",
                                  "managed",
                                  "byok"
                                ],
                                "default": "auto"
                              },
                              "on_client_error": {
                                "type": "string",
                                "enum": [
                                  "continue",
                                  "fail"
                                ],
                                "default": "continue"
                              },
                              "when": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "field": {
                                        "type": "string",
                                        "maxLength": 120,
                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                      },
                                      "op": {
                                        "type": "string",
                                        "enum": [
                                          "eq",
                                          "neq",
                                          "gt",
                                          "gte",
                                          "lt",
                                          "lte",
                                          "exists",
                                          "not_exists",
                                          "non_empty",
                                          "contains",
                                          "starts_with",
                                          "ends_with",
                                          "in",
                                          "not_in"
                                        ]
                                      },
                                      "value": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 500
                                          },
                                          {
                                            "type": "number"
                                          },
                                          {
                                            "type": "boolean"
                                          },
                                          {
                                            "type": "null"
                                          },
                                          {
                                            "type": "array",
                                            "items": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "maxItems": 50
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "field",
                                      "op"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "all": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "field": {
                                              "type": "string",
                                              "maxLength": 120,
                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                            },
                                            "op": {
                                              "type": "string",
                                              "enum": [
                                                "eq",
                                                "neq",
                                                "gt",
                                                "gte",
                                                "lt",
                                                "lte",
                                                "exists",
                                                "not_exists",
                                                "non_empty",
                                                "contains",
                                                "starts_with",
                                                "ends_with",
                                                "in",
                                                "not_in"
                                              ]
                                            },
                                            "value": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                },
                                                {
                                                  "type": "array",
                                                  "items": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      }
                                                    ]
                                                  },
                                                  "maxItems": 50
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "field",
                                            "op"
                                          ]
                                        },
                                        "minItems": 1,
                                        "maxItems": 20
                                      }
                                    },
                                    "required": [
                                      "all"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "any": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "field": {
                                              "type": "string",
                                              "maxLength": 120,
                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                            },
                                            "op": {
                                              "type": "string",
                                              "enum": [
                                                "eq",
                                                "neq",
                                                "gt",
                                                "gte",
                                                "lt",
                                                "lte",
                                                "exists",
                                                "not_exists",
                                                "non_empty",
                                                "contains",
                                                "starts_with",
                                                "ends_with",
                                                "in",
                                                "not_in"
                                              ]
                                            },
                                            "value": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                },
                                                {
                                                  "type": "array",
                                                  "items": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      }
                                                    ]
                                                  },
                                                  "maxItems": 50
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "field",
                                            "op"
                                          ]
                                        },
                                        "minItems": 1,
                                        "maxItems": 20
                                      }
                                    },
                                    "required": [
                                      "any"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "not": {
                                        "type": "object",
                                        "properties": {
                                          "field": {
                                            "type": "string",
                                            "maxLength": 120,
                                            "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                          },
                                          "op": {
                                            "type": "string",
                                            "enum": [
                                              "eq",
                                              "neq",
                                              "gt",
                                              "gte",
                                              "lt",
                                              "lte",
                                              "exists",
                                              "not_exists",
                                              "non_empty",
                                              "contains",
                                              "starts_with",
                                              "ends_with",
                                              "in",
                                              "not_in"
                                            ]
                                          },
                                          "value": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 500
                                              },
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "boolean"
                                              },
                                              {
                                                "type": "null"
                                              },
                                              {
                                                "type": "array",
                                                "items": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                },
                                                "maxItems": 50
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "field",
                                          "op"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "not"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "all": {
                                        "type": "array",
                                        "items": {
                                          "anyOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "maxLength": 120,
                                                  "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                },
                                                "op": {
                                                  "type": "string",
                                                  "enum": [
                                                    "eq",
                                                    "neq",
                                                    "gt",
                                                    "gte",
                                                    "lt",
                                                    "lte",
                                                    "exists",
                                                    "not_exists",
                                                    "non_empty",
                                                    "contains",
                                                    "starts_with",
                                                    "ends_with",
                                                    "in",
                                                    "not_in"
                                                  ]
                                                },
                                                "value": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    },
                                                    {
                                                      "type": "array",
                                                      "items": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          }
                                                        ]
                                                      },
                                                      "maxItems": 50
                                                    }
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "op"
                                              ]
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "all": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "object",
                                                    "properties": {
                                                      "field": {
                                                        "type": "string",
                                                        "maxLength": 120,
                                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                      },
                                                      "op": {
                                                        "type": "string",
                                                        "enum": [
                                                          "eq",
                                                          "neq",
                                                          "gt",
                                                          "gte",
                                                          "lt",
                                                          "lte",
                                                          "exists",
                                                          "not_exists",
                                                          "non_empty",
                                                          "contains",
                                                          "starts_with",
                                                          "ends_with",
                                                          "in",
                                                          "not_in"
                                                        ]
                                                      },
                                                      "value": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          },
                                                          {
                                                            "type": "array",
                                                            "items": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                }
                                                              ]
                                                            },
                                                            "maxItems": 50
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "field",
                                                      "op"
                                                    ]
                                                  },
                                                  "minItems": 1,
                                                  "maxItems": 20
                                                }
                                              },
                                              "required": [
                                                "all"
                                              ]
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "any": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "object",
                                                    "properties": {
                                                      "field": {
                                                        "type": "string",
                                                        "maxLength": 120,
                                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                      },
                                                      "op": {
                                                        "type": "string",
                                                        "enum": [
                                                          "eq",
                                                          "neq",
                                                          "gt",
                                                          "gte",
                                                          "lt",
                                                          "lte",
                                                          "exists",
                                                          "not_exists",
                                                          "non_empty",
                                                          "contains",
                                                          "starts_with",
                                                          "ends_with",
                                                          "in",
                                                          "not_in"
                                                        ]
                                                      },
                                                      "value": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          },
                                                          {
                                                            "type": "array",
                                                            "items": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                }
                                                              ]
                                                            },
                                                            "maxItems": 50
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "field",
                                                      "op"
                                                    ]
                                                  },
                                                  "minItems": 1,
                                                  "maxItems": 20
                                                }
                                              },
                                              "required": [
                                                "any"
                                              ]
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "not": {
                                                  "type": "object",
                                                  "properties": {
                                                    "field": {
                                                      "type": "string",
                                                      "maxLength": 120,
                                                      "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                    },
                                                    "op": {
                                                      "type": "string",
                                                      "enum": [
                                                        "eq",
                                                        "neq",
                                                        "gt",
                                                        "gte",
                                                        "lt",
                                                        "lte",
                                                        "exists",
                                                        "not_exists",
                                                        "non_empty",
                                                        "contains",
                                                        "starts_with",
                                                        "ends_with",
                                                        "in",
                                                        "not_in"
                                                      ]
                                                    },
                                                    "value": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        },
                                                        {
                                                          "type": "number"
                                                        },
                                                        {
                                                          "type": "boolean"
                                                        },
                                                        {
                                                          "type": "null"
                                                        },
                                                        {
                                                          "type": "array",
                                                          "items": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              }
                                                            ]
                                                          },
                                                          "maxItems": 50
                                                        }
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "field",
                                                    "op"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "not"
                                              ]
                                            }
                                          ]
                                        },
                                        "minItems": 1,
                                        "maxItems": 20
                                      }
                                    },
                                    "required": [
                                      "all"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "any": {
                                        "type": "array",
                                        "items": {
                                          "anyOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "maxLength": 120,
                                                  "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                },
                                                "op": {
                                                  "type": "string",
                                                  "enum": [
                                                    "eq",
                                                    "neq",
                                                    "gt",
                                                    "gte",
                                                    "lt",
                                                    "lte",
                                                    "exists",
                                                    "not_exists",
                                                    "non_empty",
                                                    "contains",
                                                    "starts_with",
                                                    "ends_with",
                                                    "in",
                                                    "not_in"
                                                  ]
                                                },
                                                "value": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    },
                                                    {
                                                      "type": "array",
                                                      "items": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          }
                                                        ]
                                                      },
                                                      "maxItems": 50
                                                    }
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "op"
                                              ]
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "all": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "object",
                                                    "properties": {
                                                      "field": {
                                                        "type": "string",
                                                        "maxLength": 120,
                                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                      },
                                                      "op": {
                                                        "type": "string",
                                                        "enum": [
                                                          "eq",
                                                          "neq",
                                                          "gt",
                                                          "gte",
                                                          "lt",
                                                          "lte",
                                                          "exists",
                                                          "not_exists",
                                                          "non_empty",
                                                          "contains",
                                                          "starts_with",
                                                          "ends_with",
                                                          "in",
                                                          "not_in"
                                                        ]
                                                      },
                                                      "value": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          },
                                                          {
                                                            "type": "array",
                                                            "items": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                }
                                                              ]
                                                            },
                                                            "maxItems": 50
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "field",
                                                      "op"
                                                    ]
                                                  },
                                                  "minItems": 1,
                                                  "maxItems": 20
                                                }
                                              },
                                              "required": [
                                                "all"
                                              ]
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "any": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "object",
                                                    "properties": {
                                                      "field": {
                                                        "type": "string",
                                                        "maxLength": 120,
                                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                      },
                                                      "op": {
                                                        "type": "string",
                                                        "enum": [
                                                          "eq",
                                                          "neq",
                                                          "gt",
                                                          "gte",
                                                          "lt",
                                                          "lte",
                                                          "exists",
                                                          "not_exists",
                                                          "non_empty",
                                                          "contains",
                                                          "starts_with",
                                                          "ends_with",
                                                          "in",
                                                          "not_in"
                                                        ]
                                                      },
                                                      "value": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          },
                                                          {
                                                            "type": "array",
                                                            "items": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                }
                                                              ]
                                                            },
                                                            "maxItems": 50
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "field",
                                                      "op"
                                                    ]
                                                  },
                                                  "minItems": 1,
                                                  "maxItems": 20
                                                }
                                              },
                                              "required": [
                                                "any"
                                              ]
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "not": {
                                                  "type": "object",
                                                  "properties": {
                                                    "field": {
                                                      "type": "string",
                                                      "maxLength": 120,
                                                      "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                    },
                                                    "op": {
                                                      "type": "string",
                                                      "enum": [
                                                        "eq",
                                                        "neq",
                                                        "gt",
                                                        "gte",
                                                        "lt",
                                                        "lte",
                                                        "exists",
                                                        "not_exists",
                                                        "non_empty",
                                                        "contains",
                                                        "starts_with",
                                                        "ends_with",
                                                        "in",
                                                        "not_in"
                                                      ]
                                                    },
                                                    "value": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        },
                                                        {
                                                          "type": "number"
                                                        },
                                                        {
                                                          "type": "boolean"
                                                        },
                                                        {
                                                          "type": "null"
                                                        },
                                                        {
                                                          "type": "array",
                                                          "items": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              }
                                                            ]
                                                          },
                                                          "maxItems": 50
                                                        }
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "field",
                                                    "op"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "not"
                                              ]
                                            }
                                          ]
                                        },
                                        "minItems": 1,
                                        "maxItems": 20
                                      }
                                    },
                                    "required": [
                                      "any"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "not": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "field": {
                                                "type": "string",
                                                "maxLength": 120,
                                                "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                              },
                                              "op": {
                                                "type": "string",
                                                "enum": [
                                                  "eq",
                                                  "neq",
                                                  "gt",
                                                  "gte",
                                                  "lt",
                                                  "lte",
                                                  "exists",
                                                  "not_exists",
                                                  "non_empty",
                                                  "contains",
                                                  "starts_with",
                                                  "ends_with",
                                                  "in",
                                                  "not_in"
                                                ]
                                              },
                                              "value": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "maxLength": 500
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  },
                                                  {
                                                    "type": "null"
                                                  },
                                                  {
                                                    "type": "array",
                                                    "items": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        },
                                                        {
                                                          "type": "number"
                                                        },
                                                        {
                                                          "type": "boolean"
                                                        },
                                                        {
                                                          "type": "null"
                                                        }
                                                      ]
                                                    },
                                                    "maxItems": 50
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "field",
                                              "op"
                                            ]
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "all": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "field": {
                                                      "type": "string",
                                                      "maxLength": 120,
                                                      "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                    },
                                                    "op": {
                                                      "type": "string",
                                                      "enum": [
                                                        "eq",
                                                        "neq",
                                                        "gt",
                                                        "gte",
                                                        "lt",
                                                        "lte",
                                                        "exists",
                                                        "not_exists",
                                                        "non_empty",
                                                        "contains",
                                                        "starts_with",
                                                        "ends_with",
                                                        "in",
                                                        "not_in"
                                                      ]
                                                    },
                                                    "value": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        },
                                                        {
                                                          "type": "number"
                                                        },
                                                        {
                                                          "type": "boolean"
                                                        },
                                                        {
                                                          "type": "null"
                                                        },
                                                        {
                                                          "type": "array",
                                                          "items": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              }
                                                            ]
                                                          },
                                                          "maxItems": 50
                                                        }
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "field",
                                                    "op"
                                                  ]
                                                },
                                                "minItems": 1,
                                                "maxItems": 20
                                              }
                                            },
                                            "required": [
                                              "all"
                                            ]
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "any": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "field": {
                                                      "type": "string",
                                                      "maxLength": 120,
                                                      "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                    },
                                                    "op": {
                                                      "type": "string",
                                                      "enum": [
                                                        "eq",
                                                        "neq",
                                                        "gt",
                                                        "gte",
                                                        "lt",
                                                        "lte",
                                                        "exists",
                                                        "not_exists",
                                                        "non_empty",
                                                        "contains",
                                                        "starts_with",
                                                        "ends_with",
                                                        "in",
                                                        "not_in"
                                                      ]
                                                    },
                                                    "value": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        },
                                                        {
                                                          "type": "number"
                                                        },
                                                        {
                                                          "type": "boolean"
                                                        },
                                                        {
                                                          "type": "null"
                                                        },
                                                        {
                                                          "type": "array",
                                                          "items": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              }
                                                            ]
                                                          },
                                                          "maxItems": 50
                                                        }
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "field",
                                                    "op"
                                                  ]
                                                },
                                                "minItems": 1,
                                                "maxItems": 20
                                              }
                                            },
                                            "required": [
                                              "any"
                                            ]
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "not": {
                                                "type": "object",
                                                "properties": {
                                                  "field": {
                                                    "type": "string",
                                                    "maxLength": 120,
                                                    "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                  },
                                                  "op": {
                                                    "type": "string",
                                                    "enum": [
                                                      "eq",
                                                      "neq",
                                                      "gt",
                                                      "gte",
                                                      "lt",
                                                      "lte",
                                                      "exists",
                                                      "not_exists",
                                                      "non_empty",
                                                      "contains",
                                                      "starts_with",
                                                      "ends_with",
                                                      "in",
                                                      "not_in"
                                                    ]
                                                  },
                                                  "value": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      },
                                                      {
                                                        "type": "array",
                                                        "items": {
                                                          "anyOf": [
                                                            {
                                                              "type": "string",
                                                              "maxLength": 500
                                                            },
                                                            {
                                                              "type": "number"
                                                            },
                                                            {
                                                              "type": "boolean"
                                                            },
                                                            {
                                                              "type": "null"
                                                            }
                                                          ]
                                                        },
                                                        "maxItems": 50
                                                      }
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "field",
                                                  "op"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "not"
                                            ]
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "not"
                                    ]
                                  }
                                ]
                              }
                            },
                            "required": [
                              "type",
                              "endpoint_id"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "routed"
                                ]
                              },
                              "provider": {
                                "type": "object",
                                "properties": {
                                  "order": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    },
                                    "maxItems": 20
                                  },
                                  "only": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    },
                                    "maxItems": 20
                                  },
                                  "ignore": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    },
                                    "maxItems": 20
                                  },
                                  "allow_fallbacks": {
                                    "type": "boolean"
                                  },
                                  "sort": {
                                    "type": "string",
                                    "enum": [
                                      "price",
                                      "reliability",
                                      "latency",
                                      "throughput",
                                      "quality"
                                    ]
                                  },
                                  "max_cost_micro": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "description": "Skip endpoints whose quote exceeds this"
                                  },
                                  "max_price_micro": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "description": "OpenRouter-style max_price: skip endpoints whose worst-case price is above this"
                                  },
                                  "preferred_max_latency_ms": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 120000,
                                    "description": "Endpoints with a p50 above this are tried after the ones under it"
                                  },
                                  "data_policy": {
                                    "type": "object",
                                    "properties": {
                                      "storage": {
                                        "type": "string",
                                        "enum": [
                                          "any",
                                          "reviewed",
                                          "storable"
                                        ],
                                        "default": "any"
                                      },
                                      "zdr": {
                                        "type": "boolean",
                                        "default": false
                                      }
                                    }
                                  },
                                  "require_verified": {
                                    "type": "boolean",
                                    "description": "Only vendors Relaygrid has verified"
                                  }
                                },
                                "default": {}
                              },
                              "max_endpoints": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 20,
                                "default": 5
                              },
                              "id": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 40,
                                "pattern": "^[a-z0-9][a-z0-9_-]*$",
                                "description": "Stable id; defaults to the endpoint id"
                              },
                              "timeout_ms": {
                                "type": "integer",
                                "minimum": 100,
                                "maximum": 120000
                              },
                              "retries": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 5,
                                "default": 0,
                                "description": "Retries on 5xx and timeouts"
                              },
                              "retry_backoff_ms": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 30000,
                                "default": 250
                              },
                              "max_cost_micro": {
                                "type": "integer",
                                "minimum": 0,
                                "description": "Skip this step if its quote is above this"
                              },
                              "required_fields": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$"
                                },
                                "maxItems": 20,
                                "default": []
                              },
                              "min_confidence": {
                                "type": "number",
                                "minimum": 0,
                                "maximum": 100
                              },
                              "confidence_field": {
                                "type": "string",
                                "maxLength": 80,
                                "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$",
                                "default": "confidence"
                              },
                              "prefer_verified": {
                                "type": "boolean",
                                "default": false
                              },
                              "continue_on_hit": {
                                "type": "boolean",
                                "default": false
                              },
                              "credential": {
                                "type": "string",
                                "enum": [
                                  "auto",
                                  "managed",
                                  "byok"
                                ],
                                "default": "auto"
                              },
                              "on_client_error": {
                                "type": "string",
                                "enum": [
                                  "continue",
                                  "fail"
                                ],
                                "default": "continue"
                              },
                              "when": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "field": {
                                        "type": "string",
                                        "maxLength": 120,
                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                      },
                                      "op": {
                                        "type": "string",
                                        "enum": [
                                          "eq",
                                          "neq",
                                          "gt",
                                          "gte",
                                          "lt",
                                          "lte",
                                          "exists",
                                          "not_exists",
                                          "non_empty",
                                          "contains",
                                          "starts_with",
                                          "ends_with",
                                          "in",
                                          "not_in"
                                        ]
                                      },
                                      "value": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 500
                                          },
                                          {
                                            "type": "number"
                                          },
                                          {
                                            "type": "boolean"
                                          },
                                          {
                                            "type": "null"
                                          },
                                          {
                                            "type": "array",
                                            "items": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "maxItems": 50
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "field",
                                      "op"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "all": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "field": {
                                              "type": "string",
                                              "maxLength": 120,
                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                            },
                                            "op": {
                                              "type": "string",
                                              "enum": [
                                                "eq",
                                                "neq",
                                                "gt",
                                                "gte",
                                                "lt",
                                                "lte",
                                                "exists",
                                                "not_exists",
                                                "non_empty",
                                                "contains",
                                                "starts_with",
                                                "ends_with",
                                                "in",
                                                "not_in"
                                              ]
                                            },
                                            "value": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                },
                                                {
                                                  "type": "array",
                                                  "items": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      }
                                                    ]
                                                  },
                                                  "maxItems": 50
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "field",
                                            "op"
                                          ]
                                        },
                                        "minItems": 1,
                                        "maxItems": 20
                                      }
                                    },
                                    "required": [
                                      "all"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "any": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "field": {
                                              "type": "string",
                                              "maxLength": 120,
                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                            },
                                            "op": {
                                              "type": "string",
                                              "enum": [
                                                "eq",
                                                "neq",
                                                "gt",
                                                "gte",
                                                "lt",
                                                "lte",
                                                "exists",
                                                "not_exists",
                                                "non_empty",
                                                "contains",
                                                "starts_with",
                                                "ends_with",
                                                "in",
                                                "not_in"
                                              ]
                                            },
                                            "value": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                },
                                                {
                                                  "type": "array",
                                                  "items": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      }
                                                    ]
                                                  },
                                                  "maxItems": 50
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "field",
                                            "op"
                                          ]
                                        },
                                        "minItems": 1,
                                        "maxItems": 20
                                      }
                                    },
                                    "required": [
                                      "any"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "not": {
                                        "type": "object",
                                        "properties": {
                                          "field": {
                                            "type": "string",
                                            "maxLength": 120,
                                            "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                          },
                                          "op": {
                                            "type": "string",
                                            "enum": [
                                              "eq",
                                              "neq",
                                              "gt",
                                              "gte",
                                              "lt",
                                              "lte",
                                              "exists",
                                              "not_exists",
                                              "non_empty",
                                              "contains",
                                              "starts_with",
                                              "ends_with",
                                              "in",
                                              "not_in"
                                            ]
                                          },
                                          "value": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 500
                                              },
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "boolean"
                                              },
                                              {
                                                "type": "null"
                                              },
                                              {
                                                "type": "array",
                                                "items": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                },
                                                "maxItems": 50
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "field",
                                          "op"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "not"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "all": {
                                        "type": "array",
                                        "items": {
                                          "anyOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "maxLength": 120,
                                                  "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                },
                                                "op": {
                                                  "type": "string",
                                                  "enum": [
                                                    "eq",
                                                    "neq",
                                                    "gt",
                                                    "gte",
                                                    "lt",
                                                    "lte",
                                                    "exists",
                                                    "not_exists",
                                                    "non_empty",
                                                    "contains",
                                                    "starts_with",
                                                    "ends_with",
                                                    "in",
                                                    "not_in"
                                                  ]
                                                },
                                                "value": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    },
                                                    {
                                                      "type": "array",
                                                      "items": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          }
                                                        ]
                                                      },
                                                      "maxItems": 50
                                                    }
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "op"
                                              ]
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "all": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "object",
                                                    "properties": {
                                                      "field": {
                                                        "type": "string",
                                                        "maxLength": 120,
                                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                      },
                                                      "op": {
                                                        "type": "string",
                                                        "enum": [
                                                          "eq",
                                                          "neq",
                                                          "gt",
                                                          "gte",
                                                          "lt",
                                                          "lte",
                                                          "exists",
                                                          "not_exists",
                                                          "non_empty",
                                                          "contains",
                                                          "starts_with",
                                                          "ends_with",
                                                          "in",
                                                          "not_in"
                                                        ]
                                                      },
                                                      "value": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          },
                                                          {
                                                            "type": "array",
                                                            "items": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                }
                                                              ]
                                                            },
                                                            "maxItems": 50
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "field",
                                                      "op"
                                                    ]
                                                  },
                                                  "minItems": 1,
                                                  "maxItems": 20
                                                }
                                              },
                                              "required": [
                                                "all"
                                              ]
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "any": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "object",
                                                    "properties": {
                                                      "field": {
                                                        "type": "string",
                                                        "maxLength": 120,
                                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                      },
                                                      "op": {
                                                        "type": "string",
                                                        "enum": [
                                                          "eq",
                                                          "neq",
                                                          "gt",
                                                          "gte",
                                                          "lt",
                                                          "lte",
                                                          "exists",
                                                          "not_exists",
                                                          "non_empty",
                                                          "contains",
                                                          "starts_with",
                                                          "ends_with",
                                                          "in",
                                                          "not_in"
                                                        ]
                                                      },
                                                      "value": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          },
                                                          {
                                                            "type": "array",
                                                            "items": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                }
                                                              ]
                                                            },
                                                            "maxItems": 50
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "field",
                                                      "op"
                                                    ]
                                                  },
                                                  "minItems": 1,
                                                  "maxItems": 20
                                                }
                                              },
                                              "required": [
                                                "any"
                                              ]
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "not": {
                                                  "type": "object",
                                                  "properties": {
                                                    "field": {
                                                      "type": "string",
                                                      "maxLength": 120,
                                                      "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                    },
                                                    "op": {
                                                      "type": "string",
                                                      "enum": [
                                                        "eq",
                                                        "neq",
                                                        "gt",
                                                        "gte",
                                                        "lt",
                                                        "lte",
                                                        "exists",
                                                        "not_exists",
                                                        "non_empty",
                                                        "contains",
                                                        "starts_with",
                                                        "ends_with",
                                                        "in",
                                                        "not_in"
                                                      ]
                                                    },
                                                    "value": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        },
                                                        {
                                                          "type": "number"
                                                        },
                                                        {
                                                          "type": "boolean"
                                                        },
                                                        {
                                                          "type": "null"
                                                        },
                                                        {
                                                          "type": "array",
                                                          "items": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              }
                                                            ]
                                                          },
                                                          "maxItems": 50
                                                        }
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "field",
                                                    "op"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "not"
                                              ]
                                            }
                                          ]
                                        },
                                        "minItems": 1,
                                        "maxItems": 20
                                      }
                                    },
                                    "required": [
                                      "all"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "any": {
                                        "type": "array",
                                        "items": {
                                          "anyOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "maxLength": 120,
                                                  "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                },
                                                "op": {
                                                  "type": "string",
                                                  "enum": [
                                                    "eq",
                                                    "neq",
                                                    "gt",
                                                    "gte",
                                                    "lt",
                                                    "lte",
                                                    "exists",
                                                    "not_exists",
                                                    "non_empty",
                                                    "contains",
                                                    "starts_with",
                                                    "ends_with",
                                                    "in",
                                                    "not_in"
                                                  ]
                                                },
                                                "value": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    },
                                                    {
                                                      "type": "array",
                                                      "items": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          }
                                                        ]
                                                      },
                                                      "maxItems": 50
                                                    }
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "op"
                                              ]
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "all": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "object",
                                                    "properties": {
                                                      "field": {
                                                        "type": "string",
                                                        "maxLength": 120,
                                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                      },
                                                      "op": {
                                                        "type": "string",
                                                        "enum": [
                                                          "eq",
                                                          "neq",
                                                          "gt",
                                                          "gte",
                                                          "lt",
                                                          "lte",
                                                          "exists",
                                                          "not_exists",
                                                          "non_empty",
                                                          "contains",
                                                          "starts_with",
                                                          "ends_with",
                                                          "in",
                                                          "not_in"
                                                        ]
                                                      },
                                                      "value": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          },
                                                          {
                                                            "type": "array",
                                                            "items": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                }
                                                              ]
                                                            },
                                                            "maxItems": 50
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "field",
                                                      "op"
                                                    ]
                                                  },
                                                  "minItems": 1,
                                                  "maxItems": 20
                                                }
                                              },
                                              "required": [
                                                "all"
                                              ]
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "any": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "object",
                                                    "properties": {
                                                      "field": {
                                                        "type": "string",
                                                        "maxLength": 120,
                                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                      },
                                                      "op": {
                                                        "type": "string",
                                                        "enum": [
                                                          "eq",
                                                          "neq",
                                                          "gt",
                                                          "gte",
                                                          "lt",
                                                          "lte",
                                                          "exists",
                                                          "not_exists",
                                                          "non_empty",
                                                          "contains",
                                                          "starts_with",
                                                          "ends_with",
                                                          "in",
                                                          "not_in"
                                                        ]
                                                      },
                                                      "value": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          },
                                                          {
                                                            "type": "array",
                                                            "items": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                }
                                                              ]
                                                            },
                                                            "maxItems": 50
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "field",
                                                      "op"
                                                    ]
                                                  },
                                                  "minItems": 1,
                                                  "maxItems": 20
                                                }
                                              },
                                              "required": [
                                                "any"
                                              ]
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "not": {
                                                  "type": "object",
                                                  "properties": {
                                                    "field": {
                                                      "type": "string",
                                                      "maxLength": 120,
                                                      "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                    },
                                                    "op": {
                                                      "type": "string",
                                                      "enum": [
                                                        "eq",
                                                        "neq",
                                                        "gt",
                                                        "gte",
                                                        "lt",
                                                        "lte",
                                                        "exists",
                                                        "not_exists",
                                                        "non_empty",
                                                        "contains",
                                                        "starts_with",
                                                        "ends_with",
                                                        "in",
                                                        "not_in"
                                                      ]
                                                    },
                                                    "value": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        },
                                                        {
                                                          "type": "number"
                                                        },
                                                        {
                                                          "type": "boolean"
                                                        },
                                                        {
                                                          "type": "null"
                                                        },
                                                        {
                                                          "type": "array",
                                                          "items": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              }
                                                            ]
                                                          },
                                                          "maxItems": 50
                                                        }
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "field",
                                                    "op"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "not"
                                              ]
                                            }
                                          ]
                                        },
                                        "minItems": 1,
                                        "maxItems": 20
                                      }
                                    },
                                    "required": [
                                      "any"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "not": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "field": {
                                                "type": "string",
                                                "maxLength": 120,
                                                "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                              },
                                              "op": {
                                                "type": "string",
                                                "enum": [
                                                  "eq",
                                                  "neq",
                                                  "gt",
                                                  "gte",
                                                  "lt",
                                                  "lte",
                                                  "exists",
                                                  "not_exists",
                                                  "non_empty",
                                                  "contains",
                                                  "starts_with",
                                                  "ends_with",
                                                  "in",
                                                  "not_in"
                                                ]
                                              },
                                              "value": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "maxLength": 500
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  },
                                                  {
                                                    "type": "null"
                                                  },
                                                  {
                                                    "type": "array",
                                                    "items": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        },
                                                        {
                                                          "type": "number"
                                                        },
                                                        {
                                                          "type": "boolean"
                                                        },
                                                        {
                                                          "type": "null"
                                                        }
                                                      ]
                                                    },
                                                    "maxItems": 50
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "field",
                                              "op"
                                            ]
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "all": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "field": {
                                                      "type": "string",
                                                      "maxLength": 120,
                                                      "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                    },
                                                    "op": {
                                                      "type": "string",
                                                      "enum": [
                                                        "eq",
                                                        "neq",
                                                        "gt",
                                                        "gte",
                                                        "lt",
                                                        "lte",
                                                        "exists",
                                                        "not_exists",
                                                        "non_empty",
                                                        "contains",
                                                        "starts_with",
                                                        "ends_with",
                                                        "in",
                                                        "not_in"
                                                      ]
                                                    },
                                                    "value": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        },
                                                        {
                                                          "type": "number"
                                                        },
                                                        {
                                                          "type": "boolean"
                                                        },
                                                        {
                                                          "type": "null"
                                                        },
                                                        {
                                                          "type": "array",
                                                          "items": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              }
                                                            ]
                                                          },
                                                          "maxItems": 50
                                                        }
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "field",
                                                    "op"
                                                  ]
                                                },
                                                "minItems": 1,
                                                "maxItems": 20
                                              }
                                            },
                                            "required": [
                                              "all"
                                            ]
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "any": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "field": {
                                                      "type": "string",
                                                      "maxLength": 120,
                                                      "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                    },
                                                    "op": {
                                                      "type": "string",
                                                      "enum": [
                                                        "eq",
                                                        "neq",
                                                        "gt",
                                                        "gte",
                                                        "lt",
                                                        "lte",
                                                        "exists",
                                                        "not_exists",
                                                        "non_empty",
                                                        "contains",
                                                        "starts_with",
                                                        "ends_with",
                                                        "in",
                                                        "not_in"
                                                      ]
                                                    },
                                                    "value": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        },
                                                        {
                                                          "type": "number"
                                                        },
                                                        {
                                                          "type": "boolean"
                                                        },
                                                        {
                                                          "type": "null"
                                                        },
                                                        {
                                                          "type": "array",
                                                          "items": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              }
                                                            ]
                                                          },
                                                          "maxItems": 50
                                                        }
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "field",
                                                    "op"
                                                  ]
                                                },
                                                "minItems": 1,
                                                "maxItems": 20
                                              }
                                            },
                                            "required": [
                                              "any"
                                            ]
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "not": {
                                                "type": "object",
                                                "properties": {
                                                  "field": {
                                                    "type": "string",
                                                    "maxLength": 120,
                                                    "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                  },
                                                  "op": {
                                                    "type": "string",
                                                    "enum": [
                                                      "eq",
                                                      "neq",
                                                      "gt",
                                                      "gte",
                                                      "lt",
                                                      "lte",
                                                      "exists",
                                                      "not_exists",
                                                      "non_empty",
                                                      "contains",
                                                      "starts_with",
                                                      "ends_with",
                                                      "in",
                                                      "not_in"
                                                    ]
                                                  },
                                                  "value": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      },
                                                      {
                                                        "type": "array",
                                                        "items": {
                                                          "anyOf": [
                                                            {
                                                              "type": "string",
                                                              "maxLength": 500
                                                            },
                                                            {
                                                              "type": "number"
                                                            },
                                                            {
                                                              "type": "boolean"
                                                            },
                                                            {
                                                              "type": "null"
                                                            }
                                                          ]
                                                        },
                                                        "maxItems": 50
                                                      }
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "field",
                                                  "op"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "not"
                                            ]
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "not"
                                    ]
                                  }
                                ]
                              }
                            },
                            "required": [
                              "type"
                            ]
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 25
                    },
                    "speed": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "profile": {
                              "type": "string",
                              "enum": [
                                "fastest"
                              ]
                            },
                            "concurrency": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 10,
                              "default": 3
                            },
                            "hedge_after_ms": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 30000,
                              "default": 750
                            },
                            "deadline_ms": {
                              "type": "integer",
                              "minimum": 500,
                              "maximum": 900000,
                              "default": 15000
                            }
                          },
                          "required": [
                            "profile"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "profile": {
                              "type": "string",
                              "enum": [
                                "balanced"
                              ]
                            },
                            "hedge_after_ms": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 60000,
                              "default": 3000
                            },
                            "deadline_ms": {
                              "type": "integer",
                              "minimum": 500,
                              "maximum": 900000,
                              "default": 30000
                            }
                          },
                          "required": [
                            "profile"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "profile": {
                              "type": "string",
                              "enum": [
                                "cheapest"
                              ]
                            },
                            "deadline_ms": {
                              "type": "integer",
                              "minimum": 500,
                              "maximum": 900000,
                              "default": 60000
                            }
                          },
                          "required": [
                            "profile"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "profile": {
                              "type": "string",
                              "enum": [
                                "custom"
                              ]
                            },
                            "concurrency": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 10,
                              "default": 1
                            },
                            "hedge_after_ms": {
                              "type": [
                                "integer",
                                "null"
                              ],
                              "minimum": 0,
                              "maximum": 60000,
                              "default": null
                            },
                            "step_timeout_ms": {
                              "type": "integer",
                              "minimum": 100,
                              "maximum": 120000
                            },
                            "deadline_ms": {
                              "type": "integer",
                              "minimum": 500,
                              "maximum": 900000,
                              "default": 30000
                            },
                            "sort": {
                              "type": "string",
                              "enum": [
                                "declared",
                                "price",
                                "latency",
                                "quality"
                              ],
                              "default": "declared"
                            }
                          },
                          "required": [
                            "profile"
                          ]
                        }
                      ],
                      "default": {
                        "profile": "balanced"
                      }
                    },
                    "stop": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "rule": {
                                "type": "string",
                                "enum": [
                                  "first_hit"
                                ]
                              }
                            },
                            "required": [
                              "rule"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "rule": {
                                "type": "string",
                                "enum": [
                                  "first_verified"
                                ]
                              }
                            },
                            "required": [
                              "rule"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "rule": {
                                "type": "string",
                                "enum": [
                                  "until_fields_filled"
                                ]
                              },
                              "fields": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "maxLength": 80,
                                  "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$"
                                },
                                "minItems": 1,
                                "maxItems": 50
                              }
                            },
                            "required": [
                              "rule",
                              "fields"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "rule": {
                                "type": "string",
                                "enum": [
                                  "all_then_merge"
                                ]
                              }
                            },
                            "required": [
                              "rule"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "rule": {
                                "type": "string",
                                "enum": [
                                  "condition"
                                ]
                              },
                              "condition": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "field": {
                                        "type": "string",
                                        "maxLength": 120,
                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                      },
                                      "op": {
                                        "type": "string",
                                        "enum": [
                                          "eq",
                                          "neq",
                                          "gt",
                                          "gte",
                                          "lt",
                                          "lte",
                                          "exists",
                                          "not_exists",
                                          "non_empty",
                                          "contains",
                                          "starts_with",
                                          "ends_with",
                                          "in",
                                          "not_in"
                                        ]
                                      },
                                      "value": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 500
                                          },
                                          {
                                            "type": "number"
                                          },
                                          {
                                            "type": "boolean"
                                          },
                                          {
                                            "type": "null"
                                          },
                                          {
                                            "type": "array",
                                            "items": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "maxItems": 50
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "field",
                                      "op"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "all": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "field": {
                                              "type": "string",
                                              "maxLength": 120,
                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                            },
                                            "op": {
                                              "type": "string",
                                              "enum": [
                                                "eq",
                                                "neq",
                                                "gt",
                                                "gte",
                                                "lt",
                                                "lte",
                                                "exists",
                                                "not_exists",
                                                "non_empty",
                                                "contains",
                                                "starts_with",
                                                "ends_with",
                                                "in",
                                                "not_in"
                                              ]
                                            },
                                            "value": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                },
                                                {
                                                  "type": "array",
                                                  "items": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      }
                                                    ]
                                                  },
                                                  "maxItems": 50
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "field",
                                            "op"
                                          ]
                                        },
                                        "minItems": 1,
                                        "maxItems": 20
                                      }
                                    },
                                    "required": [
                                      "all"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "any": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "field": {
                                              "type": "string",
                                              "maxLength": 120,
                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                            },
                                            "op": {
                                              "type": "string",
                                              "enum": [
                                                "eq",
                                                "neq",
                                                "gt",
                                                "gte",
                                                "lt",
                                                "lte",
                                                "exists",
                                                "not_exists",
                                                "non_empty",
                                                "contains",
                                                "starts_with",
                                                "ends_with",
                                                "in",
                                                "not_in"
                                              ]
                                            },
                                            "value": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                },
                                                {
                                                  "type": "array",
                                                  "items": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      }
                                                    ]
                                                  },
                                                  "maxItems": 50
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "field",
                                            "op"
                                          ]
                                        },
                                        "minItems": 1,
                                        "maxItems": 20
                                      }
                                    },
                                    "required": [
                                      "any"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "not": {
                                        "type": "object",
                                        "properties": {
                                          "field": {
                                            "type": "string",
                                            "maxLength": 120,
                                            "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                          },
                                          "op": {
                                            "type": "string",
                                            "enum": [
                                              "eq",
                                              "neq",
                                              "gt",
                                              "gte",
                                              "lt",
                                              "lte",
                                              "exists",
                                              "not_exists",
                                              "non_empty",
                                              "contains",
                                              "starts_with",
                                              "ends_with",
                                              "in",
                                              "not_in"
                                            ]
                                          },
                                          "value": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 500
                                              },
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "boolean"
                                              },
                                              {
                                                "type": "null"
                                              },
                                              {
                                                "type": "array",
                                                "items": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                },
                                                "maxItems": 50
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "field",
                                          "op"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "not"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "all": {
                                        "type": "array",
                                        "items": {
                                          "anyOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "maxLength": 120,
                                                  "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                },
                                                "op": {
                                                  "type": "string",
                                                  "enum": [
                                                    "eq",
                                                    "neq",
                                                    "gt",
                                                    "gte",
                                                    "lt",
                                                    "lte",
                                                    "exists",
                                                    "not_exists",
                                                    "non_empty",
                                                    "contains",
                                                    "starts_with",
                                                    "ends_with",
                                                    "in",
                                                    "not_in"
                                                  ]
                                                },
                                                "value": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    },
                                                    {
                                                      "type": "array",
                                                      "items": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          }
                                                        ]
                                                      },
                                                      "maxItems": 50
                                                    }
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "op"
                                              ]
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "all": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "object",
                                                    "properties": {
                                                      "field": {
                                                        "type": "string",
                                                        "maxLength": 120,
                                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                      },
                                                      "op": {
                                                        "type": "string",
                                                        "enum": [
                                                          "eq",
                                                          "neq",
                                                          "gt",
                                                          "gte",
                                                          "lt",
                                                          "lte",
                                                          "exists",
                                                          "not_exists",
                                                          "non_empty",
                                                          "contains",
                                                          "starts_with",
                                                          "ends_with",
                                                          "in",
                                                          "not_in"
                                                        ]
                                                      },
                                                      "value": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          },
                                                          {
                                                            "type": "array",
                                                            "items": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                }
                                                              ]
                                                            },
                                                            "maxItems": 50
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "field",
                                                      "op"
                                                    ]
                                                  },
                                                  "minItems": 1,
                                                  "maxItems": 20
                                                }
                                              },
                                              "required": [
                                                "all"
                                              ]
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "any": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "object",
                                                    "properties": {
                                                      "field": {
                                                        "type": "string",
                                                        "maxLength": 120,
                                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                      },
                                                      "op": {
                                                        "type": "string",
                                                        "enum": [
                                                          "eq",
                                                          "neq",
                                                          "gt",
                                                          "gte",
                                                          "lt",
                                                          "lte",
                                                          "exists",
                                                          "not_exists",
                                                          "non_empty",
                                                          "contains",
                                                          "starts_with",
                                                          "ends_with",
                                                          "in",
                                                          "not_in"
                                                        ]
                                                      },
                                                      "value": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          },
                                                          {
                                                            "type": "array",
                                                            "items": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                }
                                                              ]
                                                            },
                                                            "maxItems": 50
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "field",
                                                      "op"
                                                    ]
                                                  },
                                                  "minItems": 1,
                                                  "maxItems": 20
                                                }
                                              },
                                              "required": [
                                                "any"
                                              ]
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "not": {
                                                  "type": "object",
                                                  "properties": {
                                                    "field": {
                                                      "type": "string",
                                                      "maxLength": 120,
                                                      "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                    },
                                                    "op": {
                                                      "type": "string",
                                                      "enum": [
                                                        "eq",
                                                        "neq",
                                                        "gt",
                                                        "gte",
                                                        "lt",
                                                        "lte",
                                                        "exists",
                                                        "not_exists",
                                                        "non_empty",
                                                        "contains",
                                                        "starts_with",
                                                        "ends_with",
                                                        "in",
                                                        "not_in"
                                                      ]
                                                    },
                                                    "value": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        },
                                                        {
                                                          "type": "number"
                                                        },
                                                        {
                                                          "type": "boolean"
                                                        },
                                                        {
                                                          "type": "null"
                                                        },
                                                        {
                                                          "type": "array",
                                                          "items": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              }
                                                            ]
                                                          },
                                                          "maxItems": 50
                                                        }
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "field",
                                                    "op"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "not"
                                              ]
                                            }
                                          ]
                                        },
                                        "minItems": 1,
                                        "maxItems": 20
                                      }
                                    },
                                    "required": [
                                      "all"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "any": {
                                        "type": "array",
                                        "items": {
                                          "anyOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "maxLength": 120,
                                                  "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                },
                                                "op": {
                                                  "type": "string",
                                                  "enum": [
                                                    "eq",
                                                    "neq",
                                                    "gt",
                                                    "gte",
                                                    "lt",
                                                    "lte",
                                                    "exists",
                                                    "not_exists",
                                                    "non_empty",
                                                    "contains",
                                                    "starts_with",
                                                    "ends_with",
                                                    "in",
                                                    "not_in"
                                                  ]
                                                },
                                                "value": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    },
                                                    {
                                                      "type": "array",
                                                      "items": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          }
                                                        ]
                                                      },
                                                      "maxItems": 50
                                                    }
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "op"
                                              ]
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "all": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "object",
                                                    "properties": {
                                                      "field": {
                                                        "type": "string",
                                                        "maxLength": 120,
                                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                      },
                                                      "op": {
                                                        "type": "string",
                                                        "enum": [
                                                          "eq",
                                                          "neq",
                                                          "gt",
                                                          "gte",
                                                          "lt",
                                                          "lte",
                                                          "exists",
                                                          "not_exists",
                                                          "non_empty",
                                                          "contains",
                                                          "starts_with",
                                                          "ends_with",
                                                          "in",
                                                          "not_in"
                                                        ]
                                                      },
                                                      "value": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          },
                                                          {
                                                            "type": "array",
                                                            "items": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                }
                                                              ]
                                                            },
                                                            "maxItems": 50
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "field",
                                                      "op"
                                                    ]
                                                  },
                                                  "minItems": 1,
                                                  "maxItems": 20
                                                }
                                              },
                                              "required": [
                                                "all"
                                              ]
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "any": {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "object",
                                                    "properties": {
                                                      "field": {
                                                        "type": "string",
                                                        "maxLength": 120,
                                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                      },
                                                      "op": {
                                                        "type": "string",
                                                        "enum": [
                                                          "eq",
                                                          "neq",
                                                          "gt",
                                                          "gte",
                                                          "lt",
                                                          "lte",
                                                          "exists",
                                                          "not_exists",
                                                          "non_empty",
                                                          "contains",
                                                          "starts_with",
                                                          "ends_with",
                                                          "in",
                                                          "not_in"
                                                        ]
                                                      },
                                                      "value": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          },
                                                          {
                                                            "type": "array",
                                                            "items": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                }
                                                              ]
                                                            },
                                                            "maxItems": 50
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "field",
                                                      "op"
                                                    ]
                                                  },
                                                  "minItems": 1,
                                                  "maxItems": 20
                                                }
                                              },
                                              "required": [
                                                "any"
                                              ]
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "not": {
                                                  "type": "object",
                                                  "properties": {
                                                    "field": {
                                                      "type": "string",
                                                      "maxLength": 120,
                                                      "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                    },
                                                    "op": {
                                                      "type": "string",
                                                      "enum": [
                                                        "eq",
                                                        "neq",
                                                        "gt",
                                                        "gte",
                                                        "lt",
                                                        "lte",
                                                        "exists",
                                                        "not_exists",
                                                        "non_empty",
                                                        "contains",
                                                        "starts_with",
                                                        "ends_with",
                                                        "in",
                                                        "not_in"
                                                      ]
                                                    },
                                                    "value": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        },
                                                        {
                                                          "type": "number"
                                                        },
                                                        {
                                                          "type": "boolean"
                                                        },
                                                        {
                                                          "type": "null"
                                                        },
                                                        {
                                                          "type": "array",
                                                          "items": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              }
                                                            ]
                                                          },
                                                          "maxItems": 50
                                                        }
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "field",
                                                    "op"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "not"
                                              ]
                                            }
                                          ]
                                        },
                                        "minItems": 1,
                                        "maxItems": 20
                                      }
                                    },
                                    "required": [
                                      "any"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "not": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "field": {
                                                "type": "string",
                                                "maxLength": 120,
                                                "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                              },
                                              "op": {
                                                "type": "string",
                                                "enum": [
                                                  "eq",
                                                  "neq",
                                                  "gt",
                                                  "gte",
                                                  "lt",
                                                  "lte",
                                                  "exists",
                                                  "not_exists",
                                                  "non_empty",
                                                  "contains",
                                                  "starts_with",
                                                  "ends_with",
                                                  "in",
                                                  "not_in"
                                                ]
                                              },
                                              "value": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "maxLength": 500
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  },
                                                  {
                                                    "type": "null"
                                                  },
                                                  {
                                                    "type": "array",
                                                    "items": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        },
                                                        {
                                                          "type": "number"
                                                        },
                                                        {
                                                          "type": "boolean"
                                                        },
                                                        {
                                                          "type": "null"
                                                        }
                                                      ]
                                                    },
                                                    "maxItems": 50
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "field",
                                              "op"
                                            ]
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "all": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "field": {
                                                      "type": "string",
                                                      "maxLength": 120,
                                                      "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                    },
                                                    "op": {
                                                      "type": "string",
                                                      "enum": [
                                                        "eq",
                                                        "neq",
                                                        "gt",
                                                        "gte",
                                                        "lt",
                                                        "lte",
                                                        "exists",
                                                        "not_exists",
                                                        "non_empty",
                                                        "contains",
                                                        "starts_with",
                                                        "ends_with",
                                                        "in",
                                                        "not_in"
                                                      ]
                                                    },
                                                    "value": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        },
                                                        {
                                                          "type": "number"
                                                        },
                                                        {
                                                          "type": "boolean"
                                                        },
                                                        {
                                                          "type": "null"
                                                        },
                                                        {
                                                          "type": "array",
                                                          "items": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              }
                                                            ]
                                                          },
                                                          "maxItems": 50
                                                        }
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "field",
                                                    "op"
                                                  ]
                                                },
                                                "minItems": 1,
                                                "maxItems": 20
                                              }
                                            },
                                            "required": [
                                              "all"
                                            ]
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "any": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "field": {
                                                      "type": "string",
                                                      "maxLength": 120,
                                                      "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                    },
                                                    "op": {
                                                      "type": "string",
                                                      "enum": [
                                                        "eq",
                                                        "neq",
                                                        "gt",
                                                        "gte",
                                                        "lt",
                                                        "lte",
                                                        "exists",
                                                        "not_exists",
                                                        "non_empty",
                                                        "contains",
                                                        "starts_with",
                                                        "ends_with",
                                                        "in",
                                                        "not_in"
                                                      ]
                                                    },
                                                    "value": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        },
                                                        {
                                                          "type": "number"
                                                        },
                                                        {
                                                          "type": "boolean"
                                                        },
                                                        {
                                                          "type": "null"
                                                        },
                                                        {
                                                          "type": "array",
                                                          "items": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              }
                                                            ]
                                                          },
                                                          "maxItems": 50
                                                        }
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "field",
                                                    "op"
                                                  ]
                                                },
                                                "minItems": 1,
                                                "maxItems": 20
                                              }
                                            },
                                            "required": [
                                              "any"
                                            ]
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "not": {
                                                "type": "object",
                                                "properties": {
                                                  "field": {
                                                    "type": "string",
                                                    "maxLength": 120,
                                                    "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                  },
                                                  "op": {
                                                    "type": "string",
                                                    "enum": [
                                                      "eq",
                                                      "neq",
                                                      "gt",
                                                      "gte",
                                                      "lt",
                                                      "lte",
                                                      "exists",
                                                      "not_exists",
                                                      "non_empty",
                                                      "contains",
                                                      "starts_with",
                                                      "ends_with",
                                                      "in",
                                                      "not_in"
                                                    ]
                                                  },
                                                  "value": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      },
                                                      {
                                                        "type": "array",
                                                        "items": {
                                                          "anyOf": [
                                                            {
                                                              "type": "string",
                                                              "maxLength": 500
                                                            },
                                                            {
                                                              "type": "number"
                                                            },
                                                            {
                                                              "type": "boolean"
                                                            },
                                                            {
                                                              "type": "null"
                                                            }
                                                          ]
                                                        },
                                                        "maxItems": 50
                                                      }
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "field",
                                                  "op"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "not"
                                            ]
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "not"
                                    ]
                                  }
                                ]
                              }
                            },
                            "required": [
                              "rule",
                              "condition"
                            ]
                          }
                        ]
                      },
                      "maxItems": 10,
                      "default": [
                        {
                          "rule": "first_hit"
                        }
                      ]
                    },
                    "stop_mode": {
                      "type": "string",
                      "enum": [
                        "any",
                        "all"
                      ],
                      "default": "any"
                    },
                    "merge": {
                      "type": "object",
                      "properties": {
                        "default": {
                          "type": "string",
                          "enum": [
                            "highest_quality",
                            "consensus",
                            "most_recent",
                            "prefer_verified",
                            "first_non_null",
                            "union"
                          ],
                          "default": "first_non_null"
                        },
                        "fields": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "string",
                            "enum": [
                              "highest_quality",
                              "consensus",
                              "most_recent",
                              "prefer_verified",
                              "first_non_null",
                              "union"
                            ]
                          },
                          "default": {}
                        },
                        "recency_field": {
                          "type": "string",
                          "maxLength": 80,
                          "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$",
                          "default": "updated_at"
                        }
                      },
                      "default": {}
                    },
                    "input_map": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "maxLength": 160,
                        "pattern": "^(input|stages\\.[a-z0-9][a-z0-9_-]*)\\.[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                      },
                      "default": {}
                    },
                    "when": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "field": {
                              "type": "string",
                              "maxLength": 120,
                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                            },
                            "op": {
                              "type": "string",
                              "enum": [
                                "eq",
                                "neq",
                                "gt",
                                "gte",
                                "lt",
                                "lte",
                                "exists",
                                "not_exists",
                                "non_empty",
                                "contains",
                                "starts_with",
                                "ends_with",
                                "in",
                                "not_in"
                              ]
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 500
                                },
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "boolean"
                                },
                                {
                                  "type": "null"
                                },
                                {
                                  "type": "array",
                                  "items": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 500
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "maxItems": 50
                                }
                              ]
                            }
                          },
                          "required": [
                            "field",
                            "op"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "all": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "field": {
                                    "type": "string",
                                    "maxLength": 120,
                                    "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                  },
                                  "op": {
                                    "type": "string",
                                    "enum": [
                                      "eq",
                                      "neq",
                                      "gt",
                                      "gte",
                                      "lt",
                                      "lte",
                                      "exists",
                                      "not_exists",
                                      "non_empty",
                                      "contains",
                                      "starts_with",
                                      "ends_with",
                                      "in",
                                      "not_in"
                                    ]
                                  },
                                  "value": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 500
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "null"
                                      },
                                      {
                                        "type": "array",
                                        "items": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "maxLength": 500
                                            },
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "boolean"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "maxItems": 50
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "field",
                                  "op"
                                ]
                              },
                              "minItems": 1,
                              "maxItems": 20
                            }
                          },
                          "required": [
                            "all"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "any": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "field": {
                                    "type": "string",
                                    "maxLength": 120,
                                    "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                  },
                                  "op": {
                                    "type": "string",
                                    "enum": [
                                      "eq",
                                      "neq",
                                      "gt",
                                      "gte",
                                      "lt",
                                      "lte",
                                      "exists",
                                      "not_exists",
                                      "non_empty",
                                      "contains",
                                      "starts_with",
                                      "ends_with",
                                      "in",
                                      "not_in"
                                    ]
                                  },
                                  "value": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 500
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "null"
                                      },
                                      {
                                        "type": "array",
                                        "items": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "maxLength": 500
                                            },
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "boolean"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "maxItems": 50
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "field",
                                  "op"
                                ]
                              },
                              "minItems": 1,
                              "maxItems": 20
                            }
                          },
                          "required": [
                            "any"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "not": {
                              "type": "object",
                              "properties": {
                                "field": {
                                  "type": "string",
                                  "maxLength": 120,
                                  "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                },
                                "op": {
                                  "type": "string",
                                  "enum": [
                                    "eq",
                                    "neq",
                                    "gt",
                                    "gte",
                                    "lt",
                                    "lte",
                                    "exists",
                                    "not_exists",
                                    "non_empty",
                                    "contains",
                                    "starts_with",
                                    "ends_with",
                                    "in",
                                    "not_in"
                                  ]
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "maxLength": 500
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "null"
                                    },
                                    {
                                      "type": "array",
                                      "items": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 500
                                          },
                                          {
                                            "type": "number"
                                          },
                                          {
                                            "type": "boolean"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "maxItems": 50
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "field",
                                "op"
                              ]
                            }
                          },
                          "required": [
                            "not"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "all": {
                              "type": "array",
                              "items": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "field": {
                                        "type": "string",
                                        "maxLength": 120,
                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                      },
                                      "op": {
                                        "type": "string",
                                        "enum": [
                                          "eq",
                                          "neq",
                                          "gt",
                                          "gte",
                                          "lt",
                                          "lte",
                                          "exists",
                                          "not_exists",
                                          "non_empty",
                                          "contains",
                                          "starts_with",
                                          "ends_with",
                                          "in",
                                          "not_in"
                                        ]
                                      },
                                      "value": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 500
                                          },
                                          {
                                            "type": "number"
                                          },
                                          {
                                            "type": "boolean"
                                          },
                                          {
                                            "type": "null"
                                          },
                                          {
                                            "type": "array",
                                            "items": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "maxItems": 50
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "field",
                                      "op"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "all": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "field": {
                                              "type": "string",
                                              "maxLength": 120,
                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                            },
                                            "op": {
                                              "type": "string",
                                              "enum": [
                                                "eq",
                                                "neq",
                                                "gt",
                                                "gte",
                                                "lt",
                                                "lte",
                                                "exists",
                                                "not_exists",
                                                "non_empty",
                                                "contains",
                                                "starts_with",
                                                "ends_with",
                                                "in",
                                                "not_in"
                                              ]
                                            },
                                            "value": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                },
                                                {
                                                  "type": "array",
                                                  "items": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      }
                                                    ]
                                                  },
                                                  "maxItems": 50
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "field",
                                            "op"
                                          ]
                                        },
                                        "minItems": 1,
                                        "maxItems": 20
                                      }
                                    },
                                    "required": [
                                      "all"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "any": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "field": {
                                              "type": "string",
                                              "maxLength": 120,
                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                            },
                                            "op": {
                                              "type": "string",
                                              "enum": [
                                                "eq",
                                                "neq",
                                                "gt",
                                                "gte",
                                                "lt",
                                                "lte",
                                                "exists",
                                                "not_exists",
                                                "non_empty",
                                                "contains",
                                                "starts_with",
                                                "ends_with",
                                                "in",
                                                "not_in"
                                              ]
                                            },
                                            "value": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                },
                                                {
                                                  "type": "array",
                                                  "items": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      }
                                                    ]
                                                  },
                                                  "maxItems": 50
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "field",
                                            "op"
                                          ]
                                        },
                                        "minItems": 1,
                                        "maxItems": 20
                                      }
                                    },
                                    "required": [
                                      "any"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "not": {
                                        "type": "object",
                                        "properties": {
                                          "field": {
                                            "type": "string",
                                            "maxLength": 120,
                                            "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                          },
                                          "op": {
                                            "type": "string",
                                            "enum": [
                                              "eq",
                                              "neq",
                                              "gt",
                                              "gte",
                                              "lt",
                                              "lte",
                                              "exists",
                                              "not_exists",
                                              "non_empty",
                                              "contains",
                                              "starts_with",
                                              "ends_with",
                                              "in",
                                              "not_in"
                                            ]
                                          },
                                          "value": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 500
                                              },
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "boolean"
                                              },
                                              {
                                                "type": "null"
                                              },
                                              {
                                                "type": "array",
                                                "items": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                },
                                                "maxItems": 50
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "field",
                                          "op"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "not"
                                    ]
                                  }
                                ]
                              },
                              "minItems": 1,
                              "maxItems": 20
                            }
                          },
                          "required": [
                            "all"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "any": {
                              "type": "array",
                              "items": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "field": {
                                        "type": "string",
                                        "maxLength": 120,
                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                      },
                                      "op": {
                                        "type": "string",
                                        "enum": [
                                          "eq",
                                          "neq",
                                          "gt",
                                          "gte",
                                          "lt",
                                          "lte",
                                          "exists",
                                          "not_exists",
                                          "non_empty",
                                          "contains",
                                          "starts_with",
                                          "ends_with",
                                          "in",
                                          "not_in"
                                        ]
                                      },
                                      "value": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 500
                                          },
                                          {
                                            "type": "number"
                                          },
                                          {
                                            "type": "boolean"
                                          },
                                          {
                                            "type": "null"
                                          },
                                          {
                                            "type": "array",
                                            "items": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "maxItems": 50
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "field",
                                      "op"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "all": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "field": {
                                              "type": "string",
                                              "maxLength": 120,
                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                            },
                                            "op": {
                                              "type": "string",
                                              "enum": [
                                                "eq",
                                                "neq",
                                                "gt",
                                                "gte",
                                                "lt",
                                                "lte",
                                                "exists",
                                                "not_exists",
                                                "non_empty",
                                                "contains",
                                                "starts_with",
                                                "ends_with",
                                                "in",
                                                "not_in"
                                              ]
                                            },
                                            "value": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                },
                                                {
                                                  "type": "array",
                                                  "items": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      }
                                                    ]
                                                  },
                                                  "maxItems": 50
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "field",
                                            "op"
                                          ]
                                        },
                                        "minItems": 1,
                                        "maxItems": 20
                                      }
                                    },
                                    "required": [
                                      "all"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "any": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "field": {
                                              "type": "string",
                                              "maxLength": 120,
                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                            },
                                            "op": {
                                              "type": "string",
                                              "enum": [
                                                "eq",
                                                "neq",
                                                "gt",
                                                "gte",
                                                "lt",
                                                "lte",
                                                "exists",
                                                "not_exists",
                                                "non_empty",
                                                "contains",
                                                "starts_with",
                                                "ends_with",
                                                "in",
                                                "not_in"
                                              ]
                                            },
                                            "value": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                },
                                                {
                                                  "type": "array",
                                                  "items": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      }
                                                    ]
                                                  },
                                                  "maxItems": 50
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "field",
                                            "op"
                                          ]
                                        },
                                        "minItems": 1,
                                        "maxItems": 20
                                      }
                                    },
                                    "required": [
                                      "any"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "not": {
                                        "type": "object",
                                        "properties": {
                                          "field": {
                                            "type": "string",
                                            "maxLength": 120,
                                            "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                          },
                                          "op": {
                                            "type": "string",
                                            "enum": [
                                              "eq",
                                              "neq",
                                              "gt",
                                              "gte",
                                              "lt",
                                              "lte",
                                              "exists",
                                              "not_exists",
                                              "non_empty",
                                              "contains",
                                              "starts_with",
                                              "ends_with",
                                              "in",
                                              "not_in"
                                            ]
                                          },
                                          "value": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 500
                                              },
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "boolean"
                                              },
                                              {
                                                "type": "null"
                                              },
                                              {
                                                "type": "array",
                                                "items": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                },
                                                "maxItems": 50
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "field",
                                          "op"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "not"
                                    ]
                                  }
                                ]
                              },
                              "minItems": 1,
                              "maxItems": 20
                            }
                          },
                          "required": [
                            "any"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "not": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "field": {
                                      "type": "string",
                                      "maxLength": 120,
                                      "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                    },
                                    "op": {
                                      "type": "string",
                                      "enum": [
                                        "eq",
                                        "neq",
                                        "gt",
                                        "gte",
                                        "lt",
                                        "lte",
                                        "exists",
                                        "not_exists",
                                        "non_empty",
                                        "contains",
                                        "starts_with",
                                        "ends_with",
                                        "in",
                                        "not_in"
                                      ]
                                    },
                                    "value": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "maxLength": 500
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "boolean"
                                        },
                                        {
                                          "type": "null"
                                        },
                                        {
                                          "type": "array",
                                          "items": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 500
                                              },
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "boolean"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "maxItems": 50
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "field",
                                    "op"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "all": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "field": {
                                            "type": "string",
                                            "maxLength": 120,
                                            "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                          },
                                          "op": {
                                            "type": "string",
                                            "enum": [
                                              "eq",
                                              "neq",
                                              "gt",
                                              "gte",
                                              "lt",
                                              "lte",
                                              "exists",
                                              "not_exists",
                                              "non_empty",
                                              "contains",
                                              "starts_with",
                                              "ends_with",
                                              "in",
                                              "not_in"
                                            ]
                                          },
                                          "value": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 500
                                              },
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "boolean"
                                              },
                                              {
                                                "type": "null"
                                              },
                                              {
                                                "type": "array",
                                                "items": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                },
                                                "maxItems": 50
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "field",
                                          "op"
                                        ]
                                      },
                                      "minItems": 1,
                                      "maxItems": 20
                                    }
                                  },
                                  "required": [
                                    "all"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "any": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "field": {
                                            "type": "string",
                                            "maxLength": 120,
                                            "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                          },
                                          "op": {
                                            "type": "string",
                                            "enum": [
                                              "eq",
                                              "neq",
                                              "gt",
                                              "gte",
                                              "lt",
                                              "lte",
                                              "exists",
                                              "not_exists",
                                              "non_empty",
                                              "contains",
                                              "starts_with",
                                              "ends_with",
                                              "in",
                                              "not_in"
                                            ]
                                          },
                                          "value": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 500
                                              },
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "boolean"
                                              },
                                              {
                                                "type": "null"
                                              },
                                              {
                                                "type": "array",
                                                "items": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                },
                                                "maxItems": 50
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "field",
                                          "op"
                                        ]
                                      },
                                      "minItems": 1,
                                      "maxItems": 20
                                    }
                                  },
                                  "required": [
                                    "any"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "not": {
                                      "type": "object",
                                      "properties": {
                                        "field": {
                                          "type": "string",
                                          "maxLength": 120,
                                          "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                        },
                                        "op": {
                                          "type": "string",
                                          "enum": [
                                            "eq",
                                            "neq",
                                            "gt",
                                            "gte",
                                            "lt",
                                            "lte",
                                            "exists",
                                            "not_exists",
                                            "non_empty",
                                            "contains",
                                            "starts_with",
                                            "ends_with",
                                            "in",
                                            "not_in"
                                          ]
                                        },
                                        "value": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "maxLength": 500
                                            },
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "boolean"
                                            },
                                            {
                                              "type": "null"
                                            },
                                            {
                                              "type": "array",
                                              "items": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "maxLength": 500
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "maxItems": 50
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "field",
                                        "op"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "not"
                                  ]
                                }
                              ]
                            }
                          },
                          "required": [
                            "not"
                          ]
                        }
                      ]
                    },
                    "fields": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "maxLength": 80,
                        "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$"
                      },
                      "maxItems": 50
                    },
                    "max_cost_micro": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Total cap across every attempt of a run"
                    },
                    "deadline_ms": {
                      "type": "integer",
                      "minimum": 500,
                      "maximum": 900000,
                      "description": "Total wall-clock cap; overrides stage deadlines"
                    }
                  },
                  "required": [
                    "kind",
                    "capability",
                    "steps"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "pipeline"
                      ]
                    },
                    "stages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 40,
                            "pattern": "^[a-z0-9][a-z0-9_-]*$",
                            "default": "main"
                          },
                          "capability": {
                            "type": "string",
                            "pattern": "^[a-z]+(\\.[a-z0-9_]+)+$"
                          },
                          "steps": {
                            "type": "array",
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "endpoint"
                                      ]
                                    },
                                    "endpoint_id": {
                                      "type": "string",
                                      "minLength": 3,
                                      "maxLength": 200
                                    },
                                    "id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 40,
                                      "pattern": "^[a-z0-9][a-z0-9_-]*$",
                                      "description": "Stable id; defaults to the endpoint id"
                                    },
                                    "timeout_ms": {
                                      "type": "integer",
                                      "minimum": 100,
                                      "maximum": 120000
                                    },
                                    "retries": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 5,
                                      "default": 0,
                                      "description": "Retries on 5xx and timeouts"
                                    },
                                    "retry_backoff_ms": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 30000,
                                      "default": 250
                                    },
                                    "max_cost_micro": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "description": "Skip this step if its quote is above this"
                                    },
                                    "required_fields": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "maxLength": 80,
                                        "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$"
                                      },
                                      "maxItems": 20,
                                      "default": []
                                    },
                                    "min_confidence": {
                                      "type": "number",
                                      "minimum": 0,
                                      "maximum": 100
                                    },
                                    "confidence_field": {
                                      "type": "string",
                                      "maxLength": 80,
                                      "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$",
                                      "default": "confidence"
                                    },
                                    "prefer_verified": {
                                      "type": "boolean",
                                      "default": false
                                    },
                                    "continue_on_hit": {
                                      "type": "boolean",
                                      "default": false
                                    },
                                    "credential": {
                                      "type": "string",
                                      "enum": [
                                        "auto",
                                        "managed",
                                        "byok"
                                      ],
                                      "default": "auto"
                                    },
                                    "on_client_error": {
                                      "type": "string",
                                      "enum": [
                                        "continue",
                                        "fail"
                                      ],
                                      "default": "continue"
                                    },
                                    "when": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "field": {
                                              "type": "string",
                                              "maxLength": 120,
                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                            },
                                            "op": {
                                              "type": "string",
                                              "enum": [
                                                "eq",
                                                "neq",
                                                "gt",
                                                "gte",
                                                "lt",
                                                "lte",
                                                "exists",
                                                "not_exists",
                                                "non_empty",
                                                "contains",
                                                "starts_with",
                                                "ends_with",
                                                "in",
                                                "not_in"
                                              ]
                                            },
                                            "value": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                },
                                                {
                                                  "type": "array",
                                                  "items": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      }
                                                    ]
                                                  },
                                                  "maxItems": 50
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "field",
                                            "op"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "all": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "field": {
                                                    "type": "string",
                                                    "maxLength": 120,
                                                    "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                  },
                                                  "op": {
                                                    "type": "string",
                                                    "enum": [
                                                      "eq",
                                                      "neq",
                                                      "gt",
                                                      "gte",
                                                      "lt",
                                                      "lte",
                                                      "exists",
                                                      "not_exists",
                                                      "non_empty",
                                                      "contains",
                                                      "starts_with",
                                                      "ends_with",
                                                      "in",
                                                      "not_in"
                                                    ]
                                                  },
                                                  "value": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      },
                                                      {
                                                        "type": "array",
                                                        "items": {
                                                          "anyOf": [
                                                            {
                                                              "type": "string",
                                                              "maxLength": 500
                                                            },
                                                            {
                                                              "type": "number"
                                                            },
                                                            {
                                                              "type": "boolean"
                                                            },
                                                            {
                                                              "type": "null"
                                                            }
                                                          ]
                                                        },
                                                        "maxItems": 50
                                                      }
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "field",
                                                  "op"
                                                ]
                                              },
                                              "minItems": 1,
                                              "maxItems": 20
                                            }
                                          },
                                          "required": [
                                            "all"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "any": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "field": {
                                                    "type": "string",
                                                    "maxLength": 120,
                                                    "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                  },
                                                  "op": {
                                                    "type": "string",
                                                    "enum": [
                                                      "eq",
                                                      "neq",
                                                      "gt",
                                                      "gte",
                                                      "lt",
                                                      "lte",
                                                      "exists",
                                                      "not_exists",
                                                      "non_empty",
                                                      "contains",
                                                      "starts_with",
                                                      "ends_with",
                                                      "in",
                                                      "not_in"
                                                    ]
                                                  },
                                                  "value": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      },
                                                      {
                                                        "type": "array",
                                                        "items": {
                                                          "anyOf": [
                                                            {
                                                              "type": "string",
                                                              "maxLength": 500
                                                            },
                                                            {
                                                              "type": "number"
                                                            },
                                                            {
                                                              "type": "boolean"
                                                            },
                                                            {
                                                              "type": "null"
                                                            }
                                                          ]
                                                        },
                                                        "maxItems": 50
                                                      }
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "field",
                                                  "op"
                                                ]
                                              },
                                              "minItems": 1,
                                              "maxItems": 20
                                            }
                                          },
                                          "required": [
                                            "any"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "not": {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "maxLength": 120,
                                                  "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                },
                                                "op": {
                                                  "type": "string",
                                                  "enum": [
                                                    "eq",
                                                    "neq",
                                                    "gt",
                                                    "gte",
                                                    "lt",
                                                    "lte",
                                                    "exists",
                                                    "not_exists",
                                                    "non_empty",
                                                    "contains",
                                                    "starts_with",
                                                    "ends_with",
                                                    "in",
                                                    "not_in"
                                                  ]
                                                },
                                                "value": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    },
                                                    {
                                                      "type": "array",
                                                      "items": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          }
                                                        ]
                                                      },
                                                      "maxItems": 50
                                                    }
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "op"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "not"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "all": {
                                              "type": "array",
                                              "items": {
                                                "anyOf": [
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "field": {
                                                        "type": "string",
                                                        "maxLength": 120,
                                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                      },
                                                      "op": {
                                                        "type": "string",
                                                        "enum": [
                                                          "eq",
                                                          "neq",
                                                          "gt",
                                                          "gte",
                                                          "lt",
                                                          "lte",
                                                          "exists",
                                                          "not_exists",
                                                          "non_empty",
                                                          "contains",
                                                          "starts_with",
                                                          "ends_with",
                                                          "in",
                                                          "not_in"
                                                        ]
                                                      },
                                                      "value": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          },
                                                          {
                                                            "type": "array",
                                                            "items": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                }
                                                              ]
                                                            },
                                                            "maxItems": 50
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "field",
                                                      "op"
                                                    ]
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "all": {
                                                        "type": "array",
                                                        "items": {
                                                          "type": "object",
                                                          "properties": {
                                                            "field": {
                                                              "type": "string",
                                                              "maxLength": 120,
                                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                            },
                                                            "op": {
                                                              "type": "string",
                                                              "enum": [
                                                                "eq",
                                                                "neq",
                                                                "gt",
                                                                "gte",
                                                                "lt",
                                                                "lte",
                                                                "exists",
                                                                "not_exists",
                                                                "non_empty",
                                                                "contains",
                                                                "starts_with",
                                                                "ends_with",
                                                                "in",
                                                                "not_in"
                                                              ]
                                                            },
                                                            "value": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                },
                                                                {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "anyOf": [
                                                                      {
                                                                        "type": "string",
                                                                        "maxLength": 500
                                                                      },
                                                                      {
                                                                        "type": "number"
                                                                      },
                                                                      {
                                                                        "type": "boolean"
                                                                      },
                                                                      {
                                                                        "type": "null"
                                                                      }
                                                                    ]
                                                                  },
                                                                  "maxItems": 50
                                                                }
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "field",
                                                            "op"
                                                          ]
                                                        },
                                                        "minItems": 1,
                                                        "maxItems": 20
                                                      }
                                                    },
                                                    "required": [
                                                      "all"
                                                    ]
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "any": {
                                                        "type": "array",
                                                        "items": {
                                                          "type": "object",
                                                          "properties": {
                                                            "field": {
                                                              "type": "string",
                                                              "maxLength": 120,
                                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                            },
                                                            "op": {
                                                              "type": "string",
                                                              "enum": [
                                                                "eq",
                                                                "neq",
                                                                "gt",
                                                                "gte",
                                                                "lt",
                                                                "lte",
                                                                "exists",
                                                                "not_exists",
                                                                "non_empty",
                                                                "contains",
                                                                "starts_with",
                                                                "ends_with",
                                                                "in",
                                                                "not_in"
                                                              ]
                                                            },
                                                            "value": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                },
                                                                {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "anyOf": [
                                                                      {
                                                                        "type": "string",
                                                                        "maxLength": 500
                                                                      },
                                                                      {
                                                                        "type": "number"
                                                                      },
                                                                      {
                                                                        "type": "boolean"
                                                                      },
                                                                      {
                                                                        "type": "null"
                                                                      }
                                                                    ]
                                                                  },
                                                                  "maxItems": 50
                                                                }
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "field",
                                                            "op"
                                                          ]
                                                        },
                                                        "minItems": 1,
                                                        "maxItems": 20
                                                      }
                                                    },
                                                    "required": [
                                                      "any"
                                                    ]
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "not": {
                                                        "type": "object",
                                                        "properties": {
                                                          "field": {
                                                            "type": "string",
                                                            "maxLength": 120,
                                                            "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                          },
                                                          "op": {
                                                            "type": "string",
                                                            "enum": [
                                                              "eq",
                                                              "neq",
                                                              "gt",
                                                              "gte",
                                                              "lt",
                                                              "lte",
                                                              "exists",
                                                              "not_exists",
                                                              "non_empty",
                                                              "contains",
                                                              "starts_with",
                                                              "ends_with",
                                                              "in",
                                                              "not_in"
                                                            ]
                                                          },
                                                          "value": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              },
                                                              {
                                                                "type": "array",
                                                                "items": {
                                                                  "anyOf": [
                                                                    {
                                                                      "type": "string",
                                                                      "maxLength": 500
                                                                    },
                                                                    {
                                                                      "type": "number"
                                                                    },
                                                                    {
                                                                      "type": "boolean"
                                                                    },
                                                                    {
                                                                      "type": "null"
                                                                    }
                                                                  ]
                                                                },
                                                                "maxItems": 50
                                                              }
                                                            ]
                                                          }
                                                        },
                                                        "required": [
                                                          "field",
                                                          "op"
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "not"
                                                    ]
                                                  }
                                                ]
                                              },
                                              "minItems": 1,
                                              "maxItems": 20
                                            }
                                          },
                                          "required": [
                                            "all"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "any": {
                                              "type": "array",
                                              "items": {
                                                "anyOf": [
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "field": {
                                                        "type": "string",
                                                        "maxLength": 120,
                                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                      },
                                                      "op": {
                                                        "type": "string",
                                                        "enum": [
                                                          "eq",
                                                          "neq",
                                                          "gt",
                                                          "gte",
                                                          "lt",
                                                          "lte",
                                                          "exists",
                                                          "not_exists",
                                                          "non_empty",
                                                          "contains",
                                                          "starts_with",
                                                          "ends_with",
                                                          "in",
                                                          "not_in"
                                                        ]
                                                      },
                                                      "value": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          },
                                                          {
                                                            "type": "array",
                                                            "items": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                }
                                                              ]
                                                            },
                                                            "maxItems": 50
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "field",
                                                      "op"
                                                    ]
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "all": {
                                                        "type": "array",
                                                        "items": {
                                                          "type": "object",
                                                          "properties": {
                                                            "field": {
                                                              "type": "string",
                                                              "maxLength": 120,
                                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                            },
                                                            "op": {
                                                              "type": "string",
                                                              "enum": [
                                                                "eq",
                                                                "neq",
                                                                "gt",
                                                                "gte",
                                                                "lt",
                                                                "lte",
                                                                "exists",
                                                                "not_exists",
                                                                "non_empty",
                                                                "contains",
                                                                "starts_with",
                                                                "ends_with",
                                                                "in",
                                                                "not_in"
                                                              ]
                                                            },
                                                            "value": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                },
                                                                {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "anyOf": [
                                                                      {
                                                                        "type": "string",
                                                                        "maxLength": 500
                                                                      },
                                                                      {
                                                                        "type": "number"
                                                                      },
                                                                      {
                                                                        "type": "boolean"
                                                                      },
                                                                      {
                                                                        "type": "null"
                                                                      }
                                                                    ]
                                                                  },
                                                                  "maxItems": 50
                                                                }
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "field",
                                                            "op"
                                                          ]
                                                        },
                                                        "minItems": 1,
                                                        "maxItems": 20
                                                      }
                                                    },
                                                    "required": [
                                                      "all"
                                                    ]
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "any": {
                                                        "type": "array",
                                                        "items": {
                                                          "type": "object",
                                                          "properties": {
                                                            "field": {
                                                              "type": "string",
                                                              "maxLength": 120,
                                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                            },
                                                            "op": {
                                                              "type": "string",
                                                              "enum": [
                                                                "eq",
                                                                "neq",
                                                                "gt",
                                                                "gte",
                                                                "lt",
                                                                "lte",
                                                                "exists",
                                                                "not_exists",
                                                                "non_empty",
                                                                "contains",
                                                                "starts_with",
                                                                "ends_with",
                                                                "in",
                                                                "not_in"
                                                              ]
                                                            },
                                                            "value": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                },
                                                                {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "anyOf": [
                                                                      {
                                                                        "type": "string",
                                                                        "maxLength": 500
                                                                      },
                                                                      {
                                                                        "type": "number"
                                                                      },
                                                                      {
                                                                        "type": "boolean"
                                                                      },
                                                                      {
                                                                        "type": "null"
                                                                      }
                                                                    ]
                                                                  },
                                                                  "maxItems": 50
                                                                }
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "field",
                                                            "op"
                                                          ]
                                                        },
                                                        "minItems": 1,
                                                        "maxItems": 20
                                                      }
                                                    },
                                                    "required": [
                                                      "any"
                                                    ]
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "not": {
                                                        "type": "object",
                                                        "properties": {
                                                          "field": {
                                                            "type": "string",
                                                            "maxLength": 120,
                                                            "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                          },
                                                          "op": {
                                                            "type": "string",
                                                            "enum": [
                                                              "eq",
                                                              "neq",
                                                              "gt",
                                                              "gte",
                                                              "lt",
                                                              "lte",
                                                              "exists",
                                                              "not_exists",
                                                              "non_empty",
                                                              "contains",
                                                              "starts_with",
                                                              "ends_with",
                                                              "in",
                                                              "not_in"
                                                            ]
                                                          },
                                                          "value": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              },
                                                              {
                                                                "type": "array",
                                                                "items": {
                                                                  "anyOf": [
                                                                    {
                                                                      "type": "string",
                                                                      "maxLength": 500
                                                                    },
                                                                    {
                                                                      "type": "number"
                                                                    },
                                                                    {
                                                                      "type": "boolean"
                                                                    },
                                                                    {
                                                                      "type": "null"
                                                                    }
                                                                  ]
                                                                },
                                                                "maxItems": 50
                                                              }
                                                            ]
                                                          }
                                                        },
                                                        "required": [
                                                          "field",
                                                          "op"
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "not"
                                                    ]
                                                  }
                                                ]
                                              },
                                              "minItems": 1,
                                              "maxItems": 20
                                            }
                                          },
                                          "required": [
                                            "any"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "not": {
                                              "anyOf": [
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "field": {
                                                      "type": "string",
                                                      "maxLength": 120,
                                                      "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                    },
                                                    "op": {
                                                      "type": "string",
                                                      "enum": [
                                                        "eq",
                                                        "neq",
                                                        "gt",
                                                        "gte",
                                                        "lt",
                                                        "lte",
                                                        "exists",
                                                        "not_exists",
                                                        "non_empty",
                                                        "contains",
                                                        "starts_with",
                                                        "ends_with",
                                                        "in",
                                                        "not_in"
                                                      ]
                                                    },
                                                    "value": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        },
                                                        {
                                                          "type": "number"
                                                        },
                                                        {
                                                          "type": "boolean"
                                                        },
                                                        {
                                                          "type": "null"
                                                        },
                                                        {
                                                          "type": "array",
                                                          "items": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              }
                                                            ]
                                                          },
                                                          "maxItems": 50
                                                        }
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "field",
                                                    "op"
                                                  ]
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "all": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "field": {
                                                            "type": "string",
                                                            "maxLength": 120,
                                                            "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                          },
                                                          "op": {
                                                            "type": "string",
                                                            "enum": [
                                                              "eq",
                                                              "neq",
                                                              "gt",
                                                              "gte",
                                                              "lt",
                                                              "lte",
                                                              "exists",
                                                              "not_exists",
                                                              "non_empty",
                                                              "contains",
                                                              "starts_with",
                                                              "ends_with",
                                                              "in",
                                                              "not_in"
                                                            ]
                                                          },
                                                          "value": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              },
                                                              {
                                                                "type": "array",
                                                                "items": {
                                                                  "anyOf": [
                                                                    {
                                                                      "type": "string",
                                                                      "maxLength": 500
                                                                    },
                                                                    {
                                                                      "type": "number"
                                                                    },
                                                                    {
                                                                      "type": "boolean"
                                                                    },
                                                                    {
                                                                      "type": "null"
                                                                    }
                                                                  ]
                                                                },
                                                                "maxItems": 50
                                                              }
                                                            ]
                                                          }
                                                        },
                                                        "required": [
                                                          "field",
                                                          "op"
                                                        ]
                                                      },
                                                      "minItems": 1,
                                                      "maxItems": 20
                                                    }
                                                  },
                                                  "required": [
                                                    "all"
                                                  ]
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "any": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "field": {
                                                            "type": "string",
                                                            "maxLength": 120,
                                                            "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                          },
                                                          "op": {
                                                            "type": "string",
                                                            "enum": [
                                                              "eq",
                                                              "neq",
                                                              "gt",
                                                              "gte",
                                                              "lt",
                                                              "lte",
                                                              "exists",
                                                              "not_exists",
                                                              "non_empty",
                                                              "contains",
                                                              "starts_with",
                                                              "ends_with",
                                                              "in",
                                                              "not_in"
                                                            ]
                                                          },
                                                          "value": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              },
                                                              {
                                                                "type": "array",
                                                                "items": {
                                                                  "anyOf": [
                                                                    {
                                                                      "type": "string",
                                                                      "maxLength": 500
                                                                    },
                                                                    {
                                                                      "type": "number"
                                                                    },
                                                                    {
                                                                      "type": "boolean"
                                                                    },
                                                                    {
                                                                      "type": "null"
                                                                    }
                                                                  ]
                                                                },
                                                                "maxItems": 50
                                                              }
                                                            ]
                                                          }
                                                        },
                                                        "required": [
                                                          "field",
                                                          "op"
                                                        ]
                                                      },
                                                      "minItems": 1,
                                                      "maxItems": 20
                                                    }
                                                  },
                                                  "required": [
                                                    "any"
                                                  ]
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "not": {
                                                      "type": "object",
                                                      "properties": {
                                                        "field": {
                                                          "type": "string",
                                                          "maxLength": 120,
                                                          "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                        },
                                                        "op": {
                                                          "type": "string",
                                                          "enum": [
                                                            "eq",
                                                            "neq",
                                                            "gt",
                                                            "gte",
                                                            "lt",
                                                            "lte",
                                                            "exists",
                                                            "not_exists",
                                                            "non_empty",
                                                            "contains",
                                                            "starts_with",
                                                            "ends_with",
                                                            "in",
                                                            "not_in"
                                                          ]
                                                        },
                                                        "value": {
                                                          "anyOf": [
                                                            {
                                                              "type": "string",
                                                              "maxLength": 500
                                                            },
                                                            {
                                                              "type": "number"
                                                            },
                                                            {
                                                              "type": "boolean"
                                                            },
                                                            {
                                                              "type": "null"
                                                            },
                                                            {
                                                              "type": "array",
                                                              "items": {
                                                                "anyOf": [
                                                                  {
                                                                    "type": "string",
                                                                    "maxLength": 500
                                                                  },
                                                                  {
                                                                    "type": "number"
                                                                  },
                                                                  {
                                                                    "type": "boolean"
                                                                  },
                                                                  {
                                                                    "type": "null"
                                                                  }
                                                                ]
                                                              },
                                                              "maxItems": 50
                                                            }
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "field",
                                                        "op"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "not"
                                                  ]
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "not"
                                          ]
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "endpoint_id"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "enum": [
                                        "routed"
                                      ]
                                    },
                                    "provider": {
                                      "type": "object",
                                      "properties": {
                                        "order": {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          },
                                          "maxItems": 20
                                        },
                                        "only": {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          },
                                          "maxItems": 20
                                        },
                                        "ignore": {
                                          "type": "array",
                                          "items": {
                                            "type": "string"
                                          },
                                          "maxItems": 20
                                        },
                                        "allow_fallbacks": {
                                          "type": "boolean"
                                        },
                                        "sort": {
                                          "type": "string",
                                          "enum": [
                                            "price",
                                            "reliability",
                                            "latency",
                                            "throughput",
                                            "quality"
                                          ]
                                        },
                                        "max_cost_micro": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "description": "Skip endpoints whose quote exceeds this"
                                        },
                                        "max_price_micro": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "description": "OpenRouter-style max_price: skip endpoints whose worst-case price is above this"
                                        },
                                        "preferred_max_latency_ms": {
                                          "type": "integer",
                                          "exclusiveMinimum": 0,
                                          "maximum": 120000,
                                          "description": "Endpoints with a p50 above this are tried after the ones under it"
                                        },
                                        "data_policy": {
                                          "type": "object",
                                          "properties": {
                                            "storage": {
                                              "type": "string",
                                              "enum": [
                                                "any",
                                                "reviewed",
                                                "storable"
                                              ],
                                              "default": "any"
                                            },
                                            "zdr": {
                                              "type": "boolean",
                                              "default": false
                                            }
                                          }
                                        },
                                        "require_verified": {
                                          "type": "boolean",
                                          "description": "Only vendors Relaygrid has verified"
                                        }
                                      },
                                      "default": {}
                                    },
                                    "max_endpoints": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 20,
                                      "default": 5
                                    },
                                    "id": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 40,
                                      "pattern": "^[a-z0-9][a-z0-9_-]*$",
                                      "description": "Stable id; defaults to the endpoint id"
                                    },
                                    "timeout_ms": {
                                      "type": "integer",
                                      "minimum": 100,
                                      "maximum": 120000
                                    },
                                    "retries": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 5,
                                      "default": 0,
                                      "description": "Retries on 5xx and timeouts"
                                    },
                                    "retry_backoff_ms": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 30000,
                                      "default": 250
                                    },
                                    "max_cost_micro": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "description": "Skip this step if its quote is above this"
                                    },
                                    "required_fields": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "maxLength": 80,
                                        "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$"
                                      },
                                      "maxItems": 20,
                                      "default": []
                                    },
                                    "min_confidence": {
                                      "type": "number",
                                      "minimum": 0,
                                      "maximum": 100
                                    },
                                    "confidence_field": {
                                      "type": "string",
                                      "maxLength": 80,
                                      "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$",
                                      "default": "confidence"
                                    },
                                    "prefer_verified": {
                                      "type": "boolean",
                                      "default": false
                                    },
                                    "continue_on_hit": {
                                      "type": "boolean",
                                      "default": false
                                    },
                                    "credential": {
                                      "type": "string",
                                      "enum": [
                                        "auto",
                                        "managed",
                                        "byok"
                                      ],
                                      "default": "auto"
                                    },
                                    "on_client_error": {
                                      "type": "string",
                                      "enum": [
                                        "continue",
                                        "fail"
                                      ],
                                      "default": "continue"
                                    },
                                    "when": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "field": {
                                              "type": "string",
                                              "maxLength": 120,
                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                            },
                                            "op": {
                                              "type": "string",
                                              "enum": [
                                                "eq",
                                                "neq",
                                                "gt",
                                                "gte",
                                                "lt",
                                                "lte",
                                                "exists",
                                                "not_exists",
                                                "non_empty",
                                                "contains",
                                                "starts_with",
                                                "ends_with",
                                                "in",
                                                "not_in"
                                              ]
                                            },
                                            "value": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                },
                                                {
                                                  "type": "array",
                                                  "items": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      }
                                                    ]
                                                  },
                                                  "maxItems": 50
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "field",
                                            "op"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "all": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "field": {
                                                    "type": "string",
                                                    "maxLength": 120,
                                                    "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                  },
                                                  "op": {
                                                    "type": "string",
                                                    "enum": [
                                                      "eq",
                                                      "neq",
                                                      "gt",
                                                      "gte",
                                                      "lt",
                                                      "lte",
                                                      "exists",
                                                      "not_exists",
                                                      "non_empty",
                                                      "contains",
                                                      "starts_with",
                                                      "ends_with",
                                                      "in",
                                                      "not_in"
                                                    ]
                                                  },
                                                  "value": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      },
                                                      {
                                                        "type": "array",
                                                        "items": {
                                                          "anyOf": [
                                                            {
                                                              "type": "string",
                                                              "maxLength": 500
                                                            },
                                                            {
                                                              "type": "number"
                                                            },
                                                            {
                                                              "type": "boolean"
                                                            },
                                                            {
                                                              "type": "null"
                                                            }
                                                          ]
                                                        },
                                                        "maxItems": 50
                                                      }
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "field",
                                                  "op"
                                                ]
                                              },
                                              "minItems": 1,
                                              "maxItems": 20
                                            }
                                          },
                                          "required": [
                                            "all"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "any": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "field": {
                                                    "type": "string",
                                                    "maxLength": 120,
                                                    "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                  },
                                                  "op": {
                                                    "type": "string",
                                                    "enum": [
                                                      "eq",
                                                      "neq",
                                                      "gt",
                                                      "gte",
                                                      "lt",
                                                      "lte",
                                                      "exists",
                                                      "not_exists",
                                                      "non_empty",
                                                      "contains",
                                                      "starts_with",
                                                      "ends_with",
                                                      "in",
                                                      "not_in"
                                                    ]
                                                  },
                                                  "value": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      },
                                                      {
                                                        "type": "array",
                                                        "items": {
                                                          "anyOf": [
                                                            {
                                                              "type": "string",
                                                              "maxLength": 500
                                                            },
                                                            {
                                                              "type": "number"
                                                            },
                                                            {
                                                              "type": "boolean"
                                                            },
                                                            {
                                                              "type": "null"
                                                            }
                                                          ]
                                                        },
                                                        "maxItems": 50
                                                      }
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "field",
                                                  "op"
                                                ]
                                              },
                                              "minItems": 1,
                                              "maxItems": 20
                                            }
                                          },
                                          "required": [
                                            "any"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "not": {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "maxLength": 120,
                                                  "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                },
                                                "op": {
                                                  "type": "string",
                                                  "enum": [
                                                    "eq",
                                                    "neq",
                                                    "gt",
                                                    "gte",
                                                    "lt",
                                                    "lte",
                                                    "exists",
                                                    "not_exists",
                                                    "non_empty",
                                                    "contains",
                                                    "starts_with",
                                                    "ends_with",
                                                    "in",
                                                    "not_in"
                                                  ]
                                                },
                                                "value": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    },
                                                    {
                                                      "type": "array",
                                                      "items": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          }
                                                        ]
                                                      },
                                                      "maxItems": 50
                                                    }
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "op"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "not"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "all": {
                                              "type": "array",
                                              "items": {
                                                "anyOf": [
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "field": {
                                                        "type": "string",
                                                        "maxLength": 120,
                                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                      },
                                                      "op": {
                                                        "type": "string",
                                                        "enum": [
                                                          "eq",
                                                          "neq",
                                                          "gt",
                                                          "gte",
                                                          "lt",
                                                          "lte",
                                                          "exists",
                                                          "not_exists",
                                                          "non_empty",
                                                          "contains",
                                                          "starts_with",
                                                          "ends_with",
                                                          "in",
                                                          "not_in"
                                                        ]
                                                      },
                                                      "value": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          },
                                                          {
                                                            "type": "array",
                                                            "items": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                }
                                                              ]
                                                            },
                                                            "maxItems": 50
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "field",
                                                      "op"
                                                    ]
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "all": {
                                                        "type": "array",
                                                        "items": {
                                                          "type": "object",
                                                          "properties": {
                                                            "field": {
                                                              "type": "string",
                                                              "maxLength": 120,
                                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                            },
                                                            "op": {
                                                              "type": "string",
                                                              "enum": [
                                                                "eq",
                                                                "neq",
                                                                "gt",
                                                                "gte",
                                                                "lt",
                                                                "lte",
                                                                "exists",
                                                                "not_exists",
                                                                "non_empty",
                                                                "contains",
                                                                "starts_with",
                                                                "ends_with",
                                                                "in",
                                                                "not_in"
                                                              ]
                                                            },
                                                            "value": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                },
                                                                {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "anyOf": [
                                                                      {
                                                                        "type": "string",
                                                                        "maxLength": 500
                                                                      },
                                                                      {
                                                                        "type": "number"
                                                                      },
                                                                      {
                                                                        "type": "boolean"
                                                                      },
                                                                      {
                                                                        "type": "null"
                                                                      }
                                                                    ]
                                                                  },
                                                                  "maxItems": 50
                                                                }
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "field",
                                                            "op"
                                                          ]
                                                        },
                                                        "minItems": 1,
                                                        "maxItems": 20
                                                      }
                                                    },
                                                    "required": [
                                                      "all"
                                                    ]
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "any": {
                                                        "type": "array",
                                                        "items": {
                                                          "type": "object",
                                                          "properties": {
                                                            "field": {
                                                              "type": "string",
                                                              "maxLength": 120,
                                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                            },
                                                            "op": {
                                                              "type": "string",
                                                              "enum": [
                                                                "eq",
                                                                "neq",
                                                                "gt",
                                                                "gte",
                                                                "lt",
                                                                "lte",
                                                                "exists",
                                                                "not_exists",
                                                                "non_empty",
                                                                "contains",
                                                                "starts_with",
                                                                "ends_with",
                                                                "in",
                                                                "not_in"
                                                              ]
                                                            },
                                                            "value": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                },
                                                                {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "anyOf": [
                                                                      {
                                                                        "type": "string",
                                                                        "maxLength": 500
                                                                      },
                                                                      {
                                                                        "type": "number"
                                                                      },
                                                                      {
                                                                        "type": "boolean"
                                                                      },
                                                                      {
                                                                        "type": "null"
                                                                      }
                                                                    ]
                                                                  },
                                                                  "maxItems": 50
                                                                }
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "field",
                                                            "op"
                                                          ]
                                                        },
                                                        "minItems": 1,
                                                        "maxItems": 20
                                                      }
                                                    },
                                                    "required": [
                                                      "any"
                                                    ]
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "not": {
                                                        "type": "object",
                                                        "properties": {
                                                          "field": {
                                                            "type": "string",
                                                            "maxLength": 120,
                                                            "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                          },
                                                          "op": {
                                                            "type": "string",
                                                            "enum": [
                                                              "eq",
                                                              "neq",
                                                              "gt",
                                                              "gte",
                                                              "lt",
                                                              "lte",
                                                              "exists",
                                                              "not_exists",
                                                              "non_empty",
                                                              "contains",
                                                              "starts_with",
                                                              "ends_with",
                                                              "in",
                                                              "not_in"
                                                            ]
                                                          },
                                                          "value": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              },
                                                              {
                                                                "type": "array",
                                                                "items": {
                                                                  "anyOf": [
                                                                    {
                                                                      "type": "string",
                                                                      "maxLength": 500
                                                                    },
                                                                    {
                                                                      "type": "number"
                                                                    },
                                                                    {
                                                                      "type": "boolean"
                                                                    },
                                                                    {
                                                                      "type": "null"
                                                                    }
                                                                  ]
                                                                },
                                                                "maxItems": 50
                                                              }
                                                            ]
                                                          }
                                                        },
                                                        "required": [
                                                          "field",
                                                          "op"
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "not"
                                                    ]
                                                  }
                                                ]
                                              },
                                              "minItems": 1,
                                              "maxItems": 20
                                            }
                                          },
                                          "required": [
                                            "all"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "any": {
                                              "type": "array",
                                              "items": {
                                                "anyOf": [
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "field": {
                                                        "type": "string",
                                                        "maxLength": 120,
                                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                      },
                                                      "op": {
                                                        "type": "string",
                                                        "enum": [
                                                          "eq",
                                                          "neq",
                                                          "gt",
                                                          "gte",
                                                          "lt",
                                                          "lte",
                                                          "exists",
                                                          "not_exists",
                                                          "non_empty",
                                                          "contains",
                                                          "starts_with",
                                                          "ends_with",
                                                          "in",
                                                          "not_in"
                                                        ]
                                                      },
                                                      "value": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          },
                                                          {
                                                            "type": "array",
                                                            "items": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                }
                                                              ]
                                                            },
                                                            "maxItems": 50
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "field",
                                                      "op"
                                                    ]
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "all": {
                                                        "type": "array",
                                                        "items": {
                                                          "type": "object",
                                                          "properties": {
                                                            "field": {
                                                              "type": "string",
                                                              "maxLength": 120,
                                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                            },
                                                            "op": {
                                                              "type": "string",
                                                              "enum": [
                                                                "eq",
                                                                "neq",
                                                                "gt",
                                                                "gte",
                                                                "lt",
                                                                "lte",
                                                                "exists",
                                                                "not_exists",
                                                                "non_empty",
                                                                "contains",
                                                                "starts_with",
                                                                "ends_with",
                                                                "in",
                                                                "not_in"
                                                              ]
                                                            },
                                                            "value": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                },
                                                                {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "anyOf": [
                                                                      {
                                                                        "type": "string",
                                                                        "maxLength": 500
                                                                      },
                                                                      {
                                                                        "type": "number"
                                                                      },
                                                                      {
                                                                        "type": "boolean"
                                                                      },
                                                                      {
                                                                        "type": "null"
                                                                      }
                                                                    ]
                                                                  },
                                                                  "maxItems": 50
                                                                }
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "field",
                                                            "op"
                                                          ]
                                                        },
                                                        "minItems": 1,
                                                        "maxItems": 20
                                                      }
                                                    },
                                                    "required": [
                                                      "all"
                                                    ]
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "any": {
                                                        "type": "array",
                                                        "items": {
                                                          "type": "object",
                                                          "properties": {
                                                            "field": {
                                                              "type": "string",
                                                              "maxLength": 120,
                                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                            },
                                                            "op": {
                                                              "type": "string",
                                                              "enum": [
                                                                "eq",
                                                                "neq",
                                                                "gt",
                                                                "gte",
                                                                "lt",
                                                                "lte",
                                                                "exists",
                                                                "not_exists",
                                                                "non_empty",
                                                                "contains",
                                                                "starts_with",
                                                                "ends_with",
                                                                "in",
                                                                "not_in"
                                                              ]
                                                            },
                                                            "value": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                },
                                                                {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "anyOf": [
                                                                      {
                                                                        "type": "string",
                                                                        "maxLength": 500
                                                                      },
                                                                      {
                                                                        "type": "number"
                                                                      },
                                                                      {
                                                                        "type": "boolean"
                                                                      },
                                                                      {
                                                                        "type": "null"
                                                                      }
                                                                    ]
                                                                  },
                                                                  "maxItems": 50
                                                                }
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "field",
                                                            "op"
                                                          ]
                                                        },
                                                        "minItems": 1,
                                                        "maxItems": 20
                                                      }
                                                    },
                                                    "required": [
                                                      "any"
                                                    ]
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "not": {
                                                        "type": "object",
                                                        "properties": {
                                                          "field": {
                                                            "type": "string",
                                                            "maxLength": 120,
                                                            "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                          },
                                                          "op": {
                                                            "type": "string",
                                                            "enum": [
                                                              "eq",
                                                              "neq",
                                                              "gt",
                                                              "gte",
                                                              "lt",
                                                              "lte",
                                                              "exists",
                                                              "not_exists",
                                                              "non_empty",
                                                              "contains",
                                                              "starts_with",
                                                              "ends_with",
                                                              "in",
                                                              "not_in"
                                                            ]
                                                          },
                                                          "value": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              },
                                                              {
                                                                "type": "array",
                                                                "items": {
                                                                  "anyOf": [
                                                                    {
                                                                      "type": "string",
                                                                      "maxLength": 500
                                                                    },
                                                                    {
                                                                      "type": "number"
                                                                    },
                                                                    {
                                                                      "type": "boolean"
                                                                    },
                                                                    {
                                                                      "type": "null"
                                                                    }
                                                                  ]
                                                                },
                                                                "maxItems": 50
                                                              }
                                                            ]
                                                          }
                                                        },
                                                        "required": [
                                                          "field",
                                                          "op"
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "not"
                                                    ]
                                                  }
                                                ]
                                              },
                                              "minItems": 1,
                                              "maxItems": 20
                                            }
                                          },
                                          "required": [
                                            "any"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "not": {
                                              "anyOf": [
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "field": {
                                                      "type": "string",
                                                      "maxLength": 120,
                                                      "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                    },
                                                    "op": {
                                                      "type": "string",
                                                      "enum": [
                                                        "eq",
                                                        "neq",
                                                        "gt",
                                                        "gte",
                                                        "lt",
                                                        "lte",
                                                        "exists",
                                                        "not_exists",
                                                        "non_empty",
                                                        "contains",
                                                        "starts_with",
                                                        "ends_with",
                                                        "in",
                                                        "not_in"
                                                      ]
                                                    },
                                                    "value": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        },
                                                        {
                                                          "type": "number"
                                                        },
                                                        {
                                                          "type": "boolean"
                                                        },
                                                        {
                                                          "type": "null"
                                                        },
                                                        {
                                                          "type": "array",
                                                          "items": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              }
                                                            ]
                                                          },
                                                          "maxItems": 50
                                                        }
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "field",
                                                    "op"
                                                  ]
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "all": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "field": {
                                                            "type": "string",
                                                            "maxLength": 120,
                                                            "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                          },
                                                          "op": {
                                                            "type": "string",
                                                            "enum": [
                                                              "eq",
                                                              "neq",
                                                              "gt",
                                                              "gte",
                                                              "lt",
                                                              "lte",
                                                              "exists",
                                                              "not_exists",
                                                              "non_empty",
                                                              "contains",
                                                              "starts_with",
                                                              "ends_with",
                                                              "in",
                                                              "not_in"
                                                            ]
                                                          },
                                                          "value": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              },
                                                              {
                                                                "type": "array",
                                                                "items": {
                                                                  "anyOf": [
                                                                    {
                                                                      "type": "string",
                                                                      "maxLength": 500
                                                                    },
                                                                    {
                                                                      "type": "number"
                                                                    },
                                                                    {
                                                                      "type": "boolean"
                                                                    },
                                                                    {
                                                                      "type": "null"
                                                                    }
                                                                  ]
                                                                },
                                                                "maxItems": 50
                                                              }
                                                            ]
                                                          }
                                                        },
                                                        "required": [
                                                          "field",
                                                          "op"
                                                        ]
                                                      },
                                                      "minItems": 1,
                                                      "maxItems": 20
                                                    }
                                                  },
                                                  "required": [
                                                    "all"
                                                  ]
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "any": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "field": {
                                                            "type": "string",
                                                            "maxLength": 120,
                                                            "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                          },
                                                          "op": {
                                                            "type": "string",
                                                            "enum": [
                                                              "eq",
                                                              "neq",
                                                              "gt",
                                                              "gte",
                                                              "lt",
                                                              "lte",
                                                              "exists",
                                                              "not_exists",
                                                              "non_empty",
                                                              "contains",
                                                              "starts_with",
                                                              "ends_with",
                                                              "in",
                                                              "not_in"
                                                            ]
                                                          },
                                                          "value": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              },
                                                              {
                                                                "type": "array",
                                                                "items": {
                                                                  "anyOf": [
                                                                    {
                                                                      "type": "string",
                                                                      "maxLength": 500
                                                                    },
                                                                    {
                                                                      "type": "number"
                                                                    },
                                                                    {
                                                                      "type": "boolean"
                                                                    },
                                                                    {
                                                                      "type": "null"
                                                                    }
                                                                  ]
                                                                },
                                                                "maxItems": 50
                                                              }
                                                            ]
                                                          }
                                                        },
                                                        "required": [
                                                          "field",
                                                          "op"
                                                        ]
                                                      },
                                                      "minItems": 1,
                                                      "maxItems": 20
                                                    }
                                                  },
                                                  "required": [
                                                    "any"
                                                  ]
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "not": {
                                                      "type": "object",
                                                      "properties": {
                                                        "field": {
                                                          "type": "string",
                                                          "maxLength": 120,
                                                          "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                        },
                                                        "op": {
                                                          "type": "string",
                                                          "enum": [
                                                            "eq",
                                                            "neq",
                                                            "gt",
                                                            "gte",
                                                            "lt",
                                                            "lte",
                                                            "exists",
                                                            "not_exists",
                                                            "non_empty",
                                                            "contains",
                                                            "starts_with",
                                                            "ends_with",
                                                            "in",
                                                            "not_in"
                                                          ]
                                                        },
                                                        "value": {
                                                          "anyOf": [
                                                            {
                                                              "type": "string",
                                                              "maxLength": 500
                                                            },
                                                            {
                                                              "type": "number"
                                                            },
                                                            {
                                                              "type": "boolean"
                                                            },
                                                            {
                                                              "type": "null"
                                                            },
                                                            {
                                                              "type": "array",
                                                              "items": {
                                                                "anyOf": [
                                                                  {
                                                                    "type": "string",
                                                                    "maxLength": 500
                                                                  },
                                                                  {
                                                                    "type": "number"
                                                                  },
                                                                  {
                                                                    "type": "boolean"
                                                                  },
                                                                  {
                                                                    "type": "null"
                                                                  }
                                                                ]
                                                              },
                                                              "maxItems": 50
                                                            }
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "field",
                                                        "op"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "not"
                                                  ]
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "not"
                                          ]
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "type"
                                  ]
                                }
                              ]
                            },
                            "minItems": 1,
                            "maxItems": 25
                          },
                          "speed": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "profile": {
                                    "type": "string",
                                    "enum": [
                                      "fastest"
                                    ]
                                  },
                                  "concurrency": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 10,
                                    "default": 3
                                  },
                                  "hedge_after_ms": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 30000,
                                    "default": 750
                                  },
                                  "deadline_ms": {
                                    "type": "integer",
                                    "minimum": 500,
                                    "maximum": 900000,
                                    "default": 15000
                                  }
                                },
                                "required": [
                                  "profile"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "profile": {
                                    "type": "string",
                                    "enum": [
                                      "balanced"
                                    ]
                                  },
                                  "hedge_after_ms": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 60000,
                                    "default": 3000
                                  },
                                  "deadline_ms": {
                                    "type": "integer",
                                    "minimum": 500,
                                    "maximum": 900000,
                                    "default": 30000
                                  }
                                },
                                "required": [
                                  "profile"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "profile": {
                                    "type": "string",
                                    "enum": [
                                      "cheapest"
                                    ]
                                  },
                                  "deadline_ms": {
                                    "type": "integer",
                                    "minimum": 500,
                                    "maximum": 900000,
                                    "default": 60000
                                  }
                                },
                                "required": [
                                  "profile"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "profile": {
                                    "type": "string",
                                    "enum": [
                                      "custom"
                                    ]
                                  },
                                  "concurrency": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 10,
                                    "default": 1
                                  },
                                  "hedge_after_ms": {
                                    "type": [
                                      "integer",
                                      "null"
                                    ],
                                    "minimum": 0,
                                    "maximum": 60000,
                                    "default": null
                                  },
                                  "step_timeout_ms": {
                                    "type": "integer",
                                    "minimum": 100,
                                    "maximum": 120000
                                  },
                                  "deadline_ms": {
                                    "type": "integer",
                                    "minimum": 500,
                                    "maximum": 900000,
                                    "default": 30000
                                  },
                                  "sort": {
                                    "type": "string",
                                    "enum": [
                                      "declared",
                                      "price",
                                      "latency",
                                      "quality"
                                    ],
                                    "default": "declared"
                                  }
                                },
                                "required": [
                                  "profile"
                                ]
                              }
                            ],
                            "default": {
                              "profile": "balanced"
                            }
                          },
                          "stop": {
                            "type": "array",
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "rule": {
                                      "type": "string",
                                      "enum": [
                                        "first_hit"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "rule"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "rule": {
                                      "type": "string",
                                      "enum": [
                                        "first_verified"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "rule"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "rule": {
                                      "type": "string",
                                      "enum": [
                                        "until_fields_filled"
                                      ]
                                    },
                                    "fields": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "maxLength": 80,
                                        "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$"
                                      },
                                      "minItems": 1,
                                      "maxItems": 50
                                    }
                                  },
                                  "required": [
                                    "rule",
                                    "fields"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "rule": {
                                      "type": "string",
                                      "enum": [
                                        "all_then_merge"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "rule"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "rule": {
                                      "type": "string",
                                      "enum": [
                                        "condition"
                                      ]
                                    },
                                    "condition": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "field": {
                                              "type": "string",
                                              "maxLength": 120,
                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                            },
                                            "op": {
                                              "type": "string",
                                              "enum": [
                                                "eq",
                                                "neq",
                                                "gt",
                                                "gte",
                                                "lt",
                                                "lte",
                                                "exists",
                                                "not_exists",
                                                "non_empty",
                                                "contains",
                                                "starts_with",
                                                "ends_with",
                                                "in",
                                                "not_in"
                                              ]
                                            },
                                            "value": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                },
                                                {
                                                  "type": "array",
                                                  "items": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      }
                                                    ]
                                                  },
                                                  "maxItems": 50
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "field",
                                            "op"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "all": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "field": {
                                                    "type": "string",
                                                    "maxLength": 120,
                                                    "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                  },
                                                  "op": {
                                                    "type": "string",
                                                    "enum": [
                                                      "eq",
                                                      "neq",
                                                      "gt",
                                                      "gte",
                                                      "lt",
                                                      "lte",
                                                      "exists",
                                                      "not_exists",
                                                      "non_empty",
                                                      "contains",
                                                      "starts_with",
                                                      "ends_with",
                                                      "in",
                                                      "not_in"
                                                    ]
                                                  },
                                                  "value": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      },
                                                      {
                                                        "type": "array",
                                                        "items": {
                                                          "anyOf": [
                                                            {
                                                              "type": "string",
                                                              "maxLength": 500
                                                            },
                                                            {
                                                              "type": "number"
                                                            },
                                                            {
                                                              "type": "boolean"
                                                            },
                                                            {
                                                              "type": "null"
                                                            }
                                                          ]
                                                        },
                                                        "maxItems": 50
                                                      }
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "field",
                                                  "op"
                                                ]
                                              },
                                              "minItems": 1,
                                              "maxItems": 20
                                            }
                                          },
                                          "required": [
                                            "all"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "any": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "field": {
                                                    "type": "string",
                                                    "maxLength": 120,
                                                    "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                  },
                                                  "op": {
                                                    "type": "string",
                                                    "enum": [
                                                      "eq",
                                                      "neq",
                                                      "gt",
                                                      "gte",
                                                      "lt",
                                                      "lte",
                                                      "exists",
                                                      "not_exists",
                                                      "non_empty",
                                                      "contains",
                                                      "starts_with",
                                                      "ends_with",
                                                      "in",
                                                      "not_in"
                                                    ]
                                                  },
                                                  "value": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      },
                                                      {
                                                        "type": "array",
                                                        "items": {
                                                          "anyOf": [
                                                            {
                                                              "type": "string",
                                                              "maxLength": 500
                                                            },
                                                            {
                                                              "type": "number"
                                                            },
                                                            {
                                                              "type": "boolean"
                                                            },
                                                            {
                                                              "type": "null"
                                                            }
                                                          ]
                                                        },
                                                        "maxItems": 50
                                                      }
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "field",
                                                  "op"
                                                ]
                                              },
                                              "minItems": 1,
                                              "maxItems": 20
                                            }
                                          },
                                          "required": [
                                            "any"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "not": {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "maxLength": 120,
                                                  "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                },
                                                "op": {
                                                  "type": "string",
                                                  "enum": [
                                                    "eq",
                                                    "neq",
                                                    "gt",
                                                    "gte",
                                                    "lt",
                                                    "lte",
                                                    "exists",
                                                    "not_exists",
                                                    "non_empty",
                                                    "contains",
                                                    "starts_with",
                                                    "ends_with",
                                                    "in",
                                                    "not_in"
                                                  ]
                                                },
                                                "value": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    },
                                                    {
                                                      "type": "array",
                                                      "items": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          }
                                                        ]
                                                      },
                                                      "maxItems": 50
                                                    }
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "op"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "not"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "all": {
                                              "type": "array",
                                              "items": {
                                                "anyOf": [
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "field": {
                                                        "type": "string",
                                                        "maxLength": 120,
                                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                      },
                                                      "op": {
                                                        "type": "string",
                                                        "enum": [
                                                          "eq",
                                                          "neq",
                                                          "gt",
                                                          "gte",
                                                          "lt",
                                                          "lte",
                                                          "exists",
                                                          "not_exists",
                                                          "non_empty",
                                                          "contains",
                                                          "starts_with",
                                                          "ends_with",
                                                          "in",
                                                          "not_in"
                                                        ]
                                                      },
                                                      "value": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          },
                                                          {
                                                            "type": "array",
                                                            "items": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                }
                                                              ]
                                                            },
                                                            "maxItems": 50
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "field",
                                                      "op"
                                                    ]
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "all": {
                                                        "type": "array",
                                                        "items": {
                                                          "type": "object",
                                                          "properties": {
                                                            "field": {
                                                              "type": "string",
                                                              "maxLength": 120,
                                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                            },
                                                            "op": {
                                                              "type": "string",
                                                              "enum": [
                                                                "eq",
                                                                "neq",
                                                                "gt",
                                                                "gte",
                                                                "lt",
                                                                "lte",
                                                                "exists",
                                                                "not_exists",
                                                                "non_empty",
                                                                "contains",
                                                                "starts_with",
                                                                "ends_with",
                                                                "in",
                                                                "not_in"
                                                              ]
                                                            },
                                                            "value": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                },
                                                                {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "anyOf": [
                                                                      {
                                                                        "type": "string",
                                                                        "maxLength": 500
                                                                      },
                                                                      {
                                                                        "type": "number"
                                                                      },
                                                                      {
                                                                        "type": "boolean"
                                                                      },
                                                                      {
                                                                        "type": "null"
                                                                      }
                                                                    ]
                                                                  },
                                                                  "maxItems": 50
                                                                }
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "field",
                                                            "op"
                                                          ]
                                                        },
                                                        "minItems": 1,
                                                        "maxItems": 20
                                                      }
                                                    },
                                                    "required": [
                                                      "all"
                                                    ]
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "any": {
                                                        "type": "array",
                                                        "items": {
                                                          "type": "object",
                                                          "properties": {
                                                            "field": {
                                                              "type": "string",
                                                              "maxLength": 120,
                                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                            },
                                                            "op": {
                                                              "type": "string",
                                                              "enum": [
                                                                "eq",
                                                                "neq",
                                                                "gt",
                                                                "gte",
                                                                "lt",
                                                                "lte",
                                                                "exists",
                                                                "not_exists",
                                                                "non_empty",
                                                                "contains",
                                                                "starts_with",
                                                                "ends_with",
                                                                "in",
                                                                "not_in"
                                                              ]
                                                            },
                                                            "value": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                },
                                                                {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "anyOf": [
                                                                      {
                                                                        "type": "string",
                                                                        "maxLength": 500
                                                                      },
                                                                      {
                                                                        "type": "number"
                                                                      },
                                                                      {
                                                                        "type": "boolean"
                                                                      },
                                                                      {
                                                                        "type": "null"
                                                                      }
                                                                    ]
                                                                  },
                                                                  "maxItems": 50
                                                                }
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "field",
                                                            "op"
                                                          ]
                                                        },
                                                        "minItems": 1,
                                                        "maxItems": 20
                                                      }
                                                    },
                                                    "required": [
                                                      "any"
                                                    ]
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "not": {
                                                        "type": "object",
                                                        "properties": {
                                                          "field": {
                                                            "type": "string",
                                                            "maxLength": 120,
                                                            "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                          },
                                                          "op": {
                                                            "type": "string",
                                                            "enum": [
                                                              "eq",
                                                              "neq",
                                                              "gt",
                                                              "gte",
                                                              "lt",
                                                              "lte",
                                                              "exists",
                                                              "not_exists",
                                                              "non_empty",
                                                              "contains",
                                                              "starts_with",
                                                              "ends_with",
                                                              "in",
                                                              "not_in"
                                                            ]
                                                          },
                                                          "value": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              },
                                                              {
                                                                "type": "array",
                                                                "items": {
                                                                  "anyOf": [
                                                                    {
                                                                      "type": "string",
                                                                      "maxLength": 500
                                                                    },
                                                                    {
                                                                      "type": "number"
                                                                    },
                                                                    {
                                                                      "type": "boolean"
                                                                    },
                                                                    {
                                                                      "type": "null"
                                                                    }
                                                                  ]
                                                                },
                                                                "maxItems": 50
                                                              }
                                                            ]
                                                          }
                                                        },
                                                        "required": [
                                                          "field",
                                                          "op"
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "not"
                                                    ]
                                                  }
                                                ]
                                              },
                                              "minItems": 1,
                                              "maxItems": 20
                                            }
                                          },
                                          "required": [
                                            "all"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "any": {
                                              "type": "array",
                                              "items": {
                                                "anyOf": [
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "field": {
                                                        "type": "string",
                                                        "maxLength": 120,
                                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                      },
                                                      "op": {
                                                        "type": "string",
                                                        "enum": [
                                                          "eq",
                                                          "neq",
                                                          "gt",
                                                          "gte",
                                                          "lt",
                                                          "lte",
                                                          "exists",
                                                          "not_exists",
                                                          "non_empty",
                                                          "contains",
                                                          "starts_with",
                                                          "ends_with",
                                                          "in",
                                                          "not_in"
                                                        ]
                                                      },
                                                      "value": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          },
                                                          {
                                                            "type": "array",
                                                            "items": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                }
                                                              ]
                                                            },
                                                            "maxItems": 50
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "field",
                                                      "op"
                                                    ]
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "all": {
                                                        "type": "array",
                                                        "items": {
                                                          "type": "object",
                                                          "properties": {
                                                            "field": {
                                                              "type": "string",
                                                              "maxLength": 120,
                                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                            },
                                                            "op": {
                                                              "type": "string",
                                                              "enum": [
                                                                "eq",
                                                                "neq",
                                                                "gt",
                                                                "gte",
                                                                "lt",
                                                                "lte",
                                                                "exists",
                                                                "not_exists",
                                                                "non_empty",
                                                                "contains",
                                                                "starts_with",
                                                                "ends_with",
                                                                "in",
                                                                "not_in"
                                                              ]
                                                            },
                                                            "value": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                },
                                                                {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "anyOf": [
                                                                      {
                                                                        "type": "string",
                                                                        "maxLength": 500
                                                                      },
                                                                      {
                                                                        "type": "number"
                                                                      },
                                                                      {
                                                                        "type": "boolean"
                                                                      },
                                                                      {
                                                                        "type": "null"
                                                                      }
                                                                    ]
                                                                  },
                                                                  "maxItems": 50
                                                                }
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "field",
                                                            "op"
                                                          ]
                                                        },
                                                        "minItems": 1,
                                                        "maxItems": 20
                                                      }
                                                    },
                                                    "required": [
                                                      "all"
                                                    ]
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "any": {
                                                        "type": "array",
                                                        "items": {
                                                          "type": "object",
                                                          "properties": {
                                                            "field": {
                                                              "type": "string",
                                                              "maxLength": 120,
                                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                            },
                                                            "op": {
                                                              "type": "string",
                                                              "enum": [
                                                                "eq",
                                                                "neq",
                                                                "gt",
                                                                "gte",
                                                                "lt",
                                                                "lte",
                                                                "exists",
                                                                "not_exists",
                                                                "non_empty",
                                                                "contains",
                                                                "starts_with",
                                                                "ends_with",
                                                                "in",
                                                                "not_in"
                                                              ]
                                                            },
                                                            "value": {
                                                              "anyOf": [
                                                                {
                                                                  "type": "string",
                                                                  "maxLength": 500
                                                                },
                                                                {
                                                                  "type": "number"
                                                                },
                                                                {
                                                                  "type": "boolean"
                                                                },
                                                                {
                                                                  "type": "null"
                                                                },
                                                                {
                                                                  "type": "array",
                                                                  "items": {
                                                                    "anyOf": [
                                                                      {
                                                                        "type": "string",
                                                                        "maxLength": 500
                                                                      },
                                                                      {
                                                                        "type": "number"
                                                                      },
                                                                      {
                                                                        "type": "boolean"
                                                                      },
                                                                      {
                                                                        "type": "null"
                                                                      }
                                                                    ]
                                                                  },
                                                                  "maxItems": 50
                                                                }
                                                              ]
                                                            }
                                                          },
                                                          "required": [
                                                            "field",
                                                            "op"
                                                          ]
                                                        },
                                                        "minItems": 1,
                                                        "maxItems": 20
                                                      }
                                                    },
                                                    "required": [
                                                      "any"
                                                    ]
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "not": {
                                                        "type": "object",
                                                        "properties": {
                                                          "field": {
                                                            "type": "string",
                                                            "maxLength": 120,
                                                            "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                          },
                                                          "op": {
                                                            "type": "string",
                                                            "enum": [
                                                              "eq",
                                                              "neq",
                                                              "gt",
                                                              "gte",
                                                              "lt",
                                                              "lte",
                                                              "exists",
                                                              "not_exists",
                                                              "non_empty",
                                                              "contains",
                                                              "starts_with",
                                                              "ends_with",
                                                              "in",
                                                              "not_in"
                                                            ]
                                                          },
                                                          "value": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              },
                                                              {
                                                                "type": "array",
                                                                "items": {
                                                                  "anyOf": [
                                                                    {
                                                                      "type": "string",
                                                                      "maxLength": 500
                                                                    },
                                                                    {
                                                                      "type": "number"
                                                                    },
                                                                    {
                                                                      "type": "boolean"
                                                                    },
                                                                    {
                                                                      "type": "null"
                                                                    }
                                                                  ]
                                                                },
                                                                "maxItems": 50
                                                              }
                                                            ]
                                                          }
                                                        },
                                                        "required": [
                                                          "field",
                                                          "op"
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "not"
                                                    ]
                                                  }
                                                ]
                                              },
                                              "minItems": 1,
                                              "maxItems": 20
                                            }
                                          },
                                          "required": [
                                            "any"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "not": {
                                              "anyOf": [
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "field": {
                                                      "type": "string",
                                                      "maxLength": 120,
                                                      "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                    },
                                                    "op": {
                                                      "type": "string",
                                                      "enum": [
                                                        "eq",
                                                        "neq",
                                                        "gt",
                                                        "gte",
                                                        "lt",
                                                        "lte",
                                                        "exists",
                                                        "not_exists",
                                                        "non_empty",
                                                        "contains",
                                                        "starts_with",
                                                        "ends_with",
                                                        "in",
                                                        "not_in"
                                                      ]
                                                    },
                                                    "value": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        },
                                                        {
                                                          "type": "number"
                                                        },
                                                        {
                                                          "type": "boolean"
                                                        },
                                                        {
                                                          "type": "null"
                                                        },
                                                        {
                                                          "type": "array",
                                                          "items": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              }
                                                            ]
                                                          },
                                                          "maxItems": 50
                                                        }
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "field",
                                                    "op"
                                                  ]
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "all": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "field": {
                                                            "type": "string",
                                                            "maxLength": 120,
                                                            "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                          },
                                                          "op": {
                                                            "type": "string",
                                                            "enum": [
                                                              "eq",
                                                              "neq",
                                                              "gt",
                                                              "gte",
                                                              "lt",
                                                              "lte",
                                                              "exists",
                                                              "not_exists",
                                                              "non_empty",
                                                              "contains",
                                                              "starts_with",
                                                              "ends_with",
                                                              "in",
                                                              "not_in"
                                                            ]
                                                          },
                                                          "value": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              },
                                                              {
                                                                "type": "array",
                                                                "items": {
                                                                  "anyOf": [
                                                                    {
                                                                      "type": "string",
                                                                      "maxLength": 500
                                                                    },
                                                                    {
                                                                      "type": "number"
                                                                    },
                                                                    {
                                                                      "type": "boolean"
                                                                    },
                                                                    {
                                                                      "type": "null"
                                                                    }
                                                                  ]
                                                                },
                                                                "maxItems": 50
                                                              }
                                                            ]
                                                          }
                                                        },
                                                        "required": [
                                                          "field",
                                                          "op"
                                                        ]
                                                      },
                                                      "minItems": 1,
                                                      "maxItems": 20
                                                    }
                                                  },
                                                  "required": [
                                                    "all"
                                                  ]
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "any": {
                                                      "type": "array",
                                                      "items": {
                                                        "type": "object",
                                                        "properties": {
                                                          "field": {
                                                            "type": "string",
                                                            "maxLength": 120,
                                                            "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                          },
                                                          "op": {
                                                            "type": "string",
                                                            "enum": [
                                                              "eq",
                                                              "neq",
                                                              "gt",
                                                              "gte",
                                                              "lt",
                                                              "lte",
                                                              "exists",
                                                              "not_exists",
                                                              "non_empty",
                                                              "contains",
                                                              "starts_with",
                                                              "ends_with",
                                                              "in",
                                                              "not_in"
                                                            ]
                                                          },
                                                          "value": {
                                                            "anyOf": [
                                                              {
                                                                "type": "string",
                                                                "maxLength": 500
                                                              },
                                                              {
                                                                "type": "number"
                                                              },
                                                              {
                                                                "type": "boolean"
                                                              },
                                                              {
                                                                "type": "null"
                                                              },
                                                              {
                                                                "type": "array",
                                                                "items": {
                                                                  "anyOf": [
                                                                    {
                                                                      "type": "string",
                                                                      "maxLength": 500
                                                                    },
                                                                    {
                                                                      "type": "number"
                                                                    },
                                                                    {
                                                                      "type": "boolean"
                                                                    },
                                                                    {
                                                                      "type": "null"
                                                                    }
                                                                  ]
                                                                },
                                                                "maxItems": 50
                                                              }
                                                            ]
                                                          }
                                                        },
                                                        "required": [
                                                          "field",
                                                          "op"
                                                        ]
                                                      },
                                                      "minItems": 1,
                                                      "maxItems": 20
                                                    }
                                                  },
                                                  "required": [
                                                    "any"
                                                  ]
                                                },
                                                {
                                                  "type": "object",
                                                  "properties": {
                                                    "not": {
                                                      "type": "object",
                                                      "properties": {
                                                        "field": {
                                                          "type": "string",
                                                          "maxLength": 120,
                                                          "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                        },
                                                        "op": {
                                                          "type": "string",
                                                          "enum": [
                                                            "eq",
                                                            "neq",
                                                            "gt",
                                                            "gte",
                                                            "lt",
                                                            "lte",
                                                            "exists",
                                                            "not_exists",
                                                            "non_empty",
                                                            "contains",
                                                            "starts_with",
                                                            "ends_with",
                                                            "in",
                                                            "not_in"
                                                          ]
                                                        },
                                                        "value": {
                                                          "anyOf": [
                                                            {
                                                              "type": "string",
                                                              "maxLength": 500
                                                            },
                                                            {
                                                              "type": "number"
                                                            },
                                                            {
                                                              "type": "boolean"
                                                            },
                                                            {
                                                              "type": "null"
                                                            },
                                                            {
                                                              "type": "array",
                                                              "items": {
                                                                "anyOf": [
                                                                  {
                                                                    "type": "string",
                                                                    "maxLength": 500
                                                                  },
                                                                  {
                                                                    "type": "number"
                                                                  },
                                                                  {
                                                                    "type": "boolean"
                                                                  },
                                                                  {
                                                                    "type": "null"
                                                                  }
                                                                ]
                                                              },
                                                              "maxItems": 50
                                                            }
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "field",
                                                        "op"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "not"
                                                  ]
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "not"
                                          ]
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "rule",
                                    "condition"
                                  ]
                                }
                              ]
                            },
                            "maxItems": 10,
                            "default": [
                              {
                                "rule": "first_hit"
                              }
                            ]
                          },
                          "stop_mode": {
                            "type": "string",
                            "enum": [
                              "any",
                              "all"
                            ],
                            "default": "any"
                          },
                          "merge": {
                            "type": "object",
                            "properties": {
                              "default": {
                                "type": "string",
                                "enum": [
                                  "highest_quality",
                                  "consensus",
                                  "most_recent",
                                  "prefer_verified",
                                  "first_non_null",
                                  "union"
                                ],
                                "default": "first_non_null"
                              },
                              "fields": {
                                "type": "object",
                                "additionalProperties": {
                                  "type": "string",
                                  "enum": [
                                    "highest_quality",
                                    "consensus",
                                    "most_recent",
                                    "prefer_verified",
                                    "first_non_null",
                                    "union"
                                  ]
                                },
                                "default": {}
                              },
                              "recency_field": {
                                "type": "string",
                                "maxLength": 80,
                                "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$",
                                "default": "updated_at"
                              }
                            },
                            "default": {}
                          },
                          "input_map": {
                            "type": "object",
                            "additionalProperties": {
                              "type": "string",
                              "maxLength": 160,
                              "pattern": "^(input|stages\\.[a-z0-9][a-z0-9_-]*)\\.[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                            },
                            "default": {}
                          },
                          "when": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "field": {
                                    "type": "string",
                                    "maxLength": 120,
                                    "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                  },
                                  "op": {
                                    "type": "string",
                                    "enum": [
                                      "eq",
                                      "neq",
                                      "gt",
                                      "gte",
                                      "lt",
                                      "lte",
                                      "exists",
                                      "not_exists",
                                      "non_empty",
                                      "contains",
                                      "starts_with",
                                      "ends_with",
                                      "in",
                                      "not_in"
                                    ]
                                  },
                                  "value": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 500
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "null"
                                      },
                                      {
                                        "type": "array",
                                        "items": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "maxLength": 500
                                            },
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "boolean"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "maxItems": 50
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "field",
                                  "op"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "all": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "field": {
                                          "type": "string",
                                          "maxLength": 120,
                                          "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                        },
                                        "op": {
                                          "type": "string",
                                          "enum": [
                                            "eq",
                                            "neq",
                                            "gt",
                                            "gte",
                                            "lt",
                                            "lte",
                                            "exists",
                                            "not_exists",
                                            "non_empty",
                                            "contains",
                                            "starts_with",
                                            "ends_with",
                                            "in",
                                            "not_in"
                                          ]
                                        },
                                        "value": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "maxLength": 500
                                            },
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "boolean"
                                            },
                                            {
                                              "type": "null"
                                            },
                                            {
                                              "type": "array",
                                              "items": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "maxLength": 500
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "maxItems": 50
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "field",
                                        "op"
                                      ]
                                    },
                                    "minItems": 1,
                                    "maxItems": 20
                                  }
                                },
                                "required": [
                                  "all"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "any": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "field": {
                                          "type": "string",
                                          "maxLength": 120,
                                          "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                        },
                                        "op": {
                                          "type": "string",
                                          "enum": [
                                            "eq",
                                            "neq",
                                            "gt",
                                            "gte",
                                            "lt",
                                            "lte",
                                            "exists",
                                            "not_exists",
                                            "non_empty",
                                            "contains",
                                            "starts_with",
                                            "ends_with",
                                            "in",
                                            "not_in"
                                          ]
                                        },
                                        "value": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "maxLength": 500
                                            },
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "boolean"
                                            },
                                            {
                                              "type": "null"
                                            },
                                            {
                                              "type": "array",
                                              "items": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "maxLength": 500
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "maxItems": 50
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "field",
                                        "op"
                                      ]
                                    },
                                    "minItems": 1,
                                    "maxItems": 20
                                  }
                                },
                                "required": [
                                  "any"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "not": {
                                    "type": "object",
                                    "properties": {
                                      "field": {
                                        "type": "string",
                                        "maxLength": 120,
                                        "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                      },
                                      "op": {
                                        "type": "string",
                                        "enum": [
                                          "eq",
                                          "neq",
                                          "gt",
                                          "gte",
                                          "lt",
                                          "lte",
                                          "exists",
                                          "not_exists",
                                          "non_empty",
                                          "contains",
                                          "starts_with",
                                          "ends_with",
                                          "in",
                                          "not_in"
                                        ]
                                      },
                                      "value": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 500
                                          },
                                          {
                                            "type": "number"
                                          },
                                          {
                                            "type": "boolean"
                                          },
                                          {
                                            "type": "null"
                                          },
                                          {
                                            "type": "array",
                                            "items": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "maxItems": 50
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "field",
                                      "op"
                                    ]
                                  }
                                },
                                "required": [
                                  "not"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "all": {
                                    "type": "array",
                                    "items": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "field": {
                                              "type": "string",
                                              "maxLength": 120,
                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                            },
                                            "op": {
                                              "type": "string",
                                              "enum": [
                                                "eq",
                                                "neq",
                                                "gt",
                                                "gte",
                                                "lt",
                                                "lte",
                                                "exists",
                                                "not_exists",
                                                "non_empty",
                                                "contains",
                                                "starts_with",
                                                "ends_with",
                                                "in",
                                                "not_in"
                                              ]
                                            },
                                            "value": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                },
                                                {
                                                  "type": "array",
                                                  "items": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      }
                                                    ]
                                                  },
                                                  "maxItems": 50
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "field",
                                            "op"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "all": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "field": {
                                                    "type": "string",
                                                    "maxLength": 120,
                                                    "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                  },
                                                  "op": {
                                                    "type": "string",
                                                    "enum": [
                                                      "eq",
                                                      "neq",
                                                      "gt",
                                                      "gte",
                                                      "lt",
                                                      "lte",
                                                      "exists",
                                                      "not_exists",
                                                      "non_empty",
                                                      "contains",
                                                      "starts_with",
                                                      "ends_with",
                                                      "in",
                                                      "not_in"
                                                    ]
                                                  },
                                                  "value": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      },
                                                      {
                                                        "type": "array",
                                                        "items": {
                                                          "anyOf": [
                                                            {
                                                              "type": "string",
                                                              "maxLength": 500
                                                            },
                                                            {
                                                              "type": "number"
                                                            },
                                                            {
                                                              "type": "boolean"
                                                            },
                                                            {
                                                              "type": "null"
                                                            }
                                                          ]
                                                        },
                                                        "maxItems": 50
                                                      }
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "field",
                                                  "op"
                                                ]
                                              },
                                              "minItems": 1,
                                              "maxItems": 20
                                            }
                                          },
                                          "required": [
                                            "all"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "any": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "field": {
                                                    "type": "string",
                                                    "maxLength": 120,
                                                    "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                  },
                                                  "op": {
                                                    "type": "string",
                                                    "enum": [
                                                      "eq",
                                                      "neq",
                                                      "gt",
                                                      "gte",
                                                      "lt",
                                                      "lte",
                                                      "exists",
                                                      "not_exists",
                                                      "non_empty",
                                                      "contains",
                                                      "starts_with",
                                                      "ends_with",
                                                      "in",
                                                      "not_in"
                                                    ]
                                                  },
                                                  "value": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      },
                                                      {
                                                        "type": "array",
                                                        "items": {
                                                          "anyOf": [
                                                            {
                                                              "type": "string",
                                                              "maxLength": 500
                                                            },
                                                            {
                                                              "type": "number"
                                                            },
                                                            {
                                                              "type": "boolean"
                                                            },
                                                            {
                                                              "type": "null"
                                                            }
                                                          ]
                                                        },
                                                        "maxItems": 50
                                                      }
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "field",
                                                  "op"
                                                ]
                                              },
                                              "minItems": 1,
                                              "maxItems": 20
                                            }
                                          },
                                          "required": [
                                            "any"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "not": {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "maxLength": 120,
                                                  "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                },
                                                "op": {
                                                  "type": "string",
                                                  "enum": [
                                                    "eq",
                                                    "neq",
                                                    "gt",
                                                    "gte",
                                                    "lt",
                                                    "lte",
                                                    "exists",
                                                    "not_exists",
                                                    "non_empty",
                                                    "contains",
                                                    "starts_with",
                                                    "ends_with",
                                                    "in",
                                                    "not_in"
                                                  ]
                                                },
                                                "value": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    },
                                                    {
                                                      "type": "array",
                                                      "items": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          }
                                                        ]
                                                      },
                                                      "maxItems": 50
                                                    }
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "op"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "not"
                                          ]
                                        }
                                      ]
                                    },
                                    "minItems": 1,
                                    "maxItems": 20
                                  }
                                },
                                "required": [
                                  "all"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "any": {
                                    "type": "array",
                                    "items": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "field": {
                                              "type": "string",
                                              "maxLength": 120,
                                              "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                            },
                                            "op": {
                                              "type": "string",
                                              "enum": [
                                                "eq",
                                                "neq",
                                                "gt",
                                                "gte",
                                                "lt",
                                                "lte",
                                                "exists",
                                                "not_exists",
                                                "non_empty",
                                                "contains",
                                                "starts_with",
                                                "ends_with",
                                                "in",
                                                "not_in"
                                              ]
                                            },
                                            "value": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 500
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "null"
                                                },
                                                {
                                                  "type": "array",
                                                  "items": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      }
                                                    ]
                                                  },
                                                  "maxItems": 50
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "field",
                                            "op"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "all": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "field": {
                                                    "type": "string",
                                                    "maxLength": 120,
                                                    "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                  },
                                                  "op": {
                                                    "type": "string",
                                                    "enum": [
                                                      "eq",
                                                      "neq",
                                                      "gt",
                                                      "gte",
                                                      "lt",
                                                      "lte",
                                                      "exists",
                                                      "not_exists",
                                                      "non_empty",
                                                      "contains",
                                                      "starts_with",
                                                      "ends_with",
                                                      "in",
                                                      "not_in"
                                                    ]
                                                  },
                                                  "value": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      },
                                                      {
                                                        "type": "array",
                                                        "items": {
                                                          "anyOf": [
                                                            {
                                                              "type": "string",
                                                              "maxLength": 500
                                                            },
                                                            {
                                                              "type": "number"
                                                            },
                                                            {
                                                              "type": "boolean"
                                                            },
                                                            {
                                                              "type": "null"
                                                            }
                                                          ]
                                                        },
                                                        "maxItems": 50
                                                      }
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "field",
                                                  "op"
                                                ]
                                              },
                                              "minItems": 1,
                                              "maxItems": 20
                                            }
                                          },
                                          "required": [
                                            "all"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "any": {
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "field": {
                                                    "type": "string",
                                                    "maxLength": 120,
                                                    "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                  },
                                                  "op": {
                                                    "type": "string",
                                                    "enum": [
                                                      "eq",
                                                      "neq",
                                                      "gt",
                                                      "gte",
                                                      "lt",
                                                      "lte",
                                                      "exists",
                                                      "not_exists",
                                                      "non_empty",
                                                      "contains",
                                                      "starts_with",
                                                      "ends_with",
                                                      "in",
                                                      "not_in"
                                                    ]
                                                  },
                                                  "value": {
                                                    "anyOf": [
                                                      {
                                                        "type": "string",
                                                        "maxLength": 500
                                                      },
                                                      {
                                                        "type": "number"
                                                      },
                                                      {
                                                        "type": "boolean"
                                                      },
                                                      {
                                                        "type": "null"
                                                      },
                                                      {
                                                        "type": "array",
                                                        "items": {
                                                          "anyOf": [
                                                            {
                                                              "type": "string",
                                                              "maxLength": 500
                                                            },
                                                            {
                                                              "type": "number"
                                                            },
                                                            {
                                                              "type": "boolean"
                                                            },
                                                            {
                                                              "type": "null"
                                                            }
                                                          ]
                                                        },
                                                        "maxItems": 50
                                                      }
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "field",
                                                  "op"
                                                ]
                                              },
                                              "minItems": 1,
                                              "maxItems": 20
                                            }
                                          },
                                          "required": [
                                            "any"
                                          ]
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "not": {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "maxLength": 120,
                                                  "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                },
                                                "op": {
                                                  "type": "string",
                                                  "enum": [
                                                    "eq",
                                                    "neq",
                                                    "gt",
                                                    "gte",
                                                    "lt",
                                                    "lte",
                                                    "exists",
                                                    "not_exists",
                                                    "non_empty",
                                                    "contains",
                                                    "starts_with",
                                                    "ends_with",
                                                    "in",
                                                    "not_in"
                                                  ]
                                                },
                                                "value": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    },
                                                    {
                                                      "type": "array",
                                                      "items": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          }
                                                        ]
                                                      },
                                                      "maxItems": 50
                                                    }
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "op"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "not"
                                          ]
                                        }
                                      ]
                                    },
                                    "minItems": 1,
                                    "maxItems": 20
                                  }
                                },
                                "required": [
                                  "any"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "not": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "field": {
                                            "type": "string",
                                            "maxLength": 120,
                                            "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                          },
                                          "op": {
                                            "type": "string",
                                            "enum": [
                                              "eq",
                                              "neq",
                                              "gt",
                                              "gte",
                                              "lt",
                                              "lte",
                                              "exists",
                                              "not_exists",
                                              "non_empty",
                                              "contains",
                                              "starts_with",
                                              "ends_with",
                                              "in",
                                              "not_in"
                                            ]
                                          },
                                          "value": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 500
                                              },
                                              {
                                                "type": "number"
                                              },
                                              {
                                                "type": "boolean"
                                              },
                                              {
                                                "type": "null"
                                              },
                                              {
                                                "type": "array",
                                                "items": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                },
                                                "maxItems": 50
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "field",
                                          "op"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "all": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "maxLength": 120,
                                                  "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                },
                                                "op": {
                                                  "type": "string",
                                                  "enum": [
                                                    "eq",
                                                    "neq",
                                                    "gt",
                                                    "gte",
                                                    "lt",
                                                    "lte",
                                                    "exists",
                                                    "not_exists",
                                                    "non_empty",
                                                    "contains",
                                                    "starts_with",
                                                    "ends_with",
                                                    "in",
                                                    "not_in"
                                                  ]
                                                },
                                                "value": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    },
                                                    {
                                                      "type": "array",
                                                      "items": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          }
                                                        ]
                                                      },
                                                      "maxItems": 50
                                                    }
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "op"
                                              ]
                                            },
                                            "minItems": 1,
                                            "maxItems": 20
                                          }
                                        },
                                        "required": [
                                          "all"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "any": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "maxLength": 120,
                                                  "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                                },
                                                "op": {
                                                  "type": "string",
                                                  "enum": [
                                                    "eq",
                                                    "neq",
                                                    "gt",
                                                    "gte",
                                                    "lt",
                                                    "lte",
                                                    "exists",
                                                    "not_exists",
                                                    "non_empty",
                                                    "contains",
                                                    "starts_with",
                                                    "ends_with",
                                                    "in",
                                                    "not_in"
                                                  ]
                                                },
                                                "value": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 500
                                                    },
                                                    {
                                                      "type": "number"
                                                    },
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    },
                                                    {
                                                      "type": "array",
                                                      "items": {
                                                        "anyOf": [
                                                          {
                                                            "type": "string",
                                                            "maxLength": 500
                                                          },
                                                          {
                                                            "type": "number"
                                                          },
                                                          {
                                                            "type": "boolean"
                                                          },
                                                          {
                                                            "type": "null"
                                                          }
                                                        ]
                                                      },
                                                      "maxItems": 50
                                                    }
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "op"
                                              ]
                                            },
                                            "minItems": 1,
                                            "maxItems": 20
                                          }
                                        },
                                        "required": [
                                          "any"
                                        ]
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "not": {
                                            "type": "object",
                                            "properties": {
                                              "field": {
                                                "type": "string",
                                                "maxLength": 120,
                                                "pattern": "^[a-z_][a-z0-9_]*(\\.[a-z0-9_]+)*$"
                                              },
                                              "op": {
                                                "type": "string",
                                                "enum": [
                                                  "eq",
                                                  "neq",
                                                  "gt",
                                                  "gte",
                                                  "lt",
                                                  "lte",
                                                  "exists",
                                                  "not_exists",
                                                  "non_empty",
                                                  "contains",
                                                  "starts_with",
                                                  "ends_with",
                                                  "in",
                                                  "not_in"
                                                ]
                                              },
                                              "value": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "maxLength": 500
                                                  },
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "boolean"
                                                  },
                                                  {
                                                    "type": "null"
                                                  },
                                                  {
                                                    "type": "array",
                                                    "items": {
                                                      "anyOf": [
                                                        {
                                                          "type": "string",
                                                          "maxLength": 500
                                                        },
                                                        {
                                                          "type": "number"
                                                        },
                                                        {
                                                          "type": "boolean"
                                                        },
                                                        {
                                                          "type": "null"
                                                        }
                                                      ]
                                                    },
                                                    "maxItems": 50
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "field",
                                              "op"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "not"
                                        ]
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "not"
                                ]
                              }
                            ]
                          },
                          "fields": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "maxLength": 80,
                              "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$"
                            },
                            "maxItems": 50
                          }
                        },
                        "required": [
                          "capability",
                          "steps"
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 10
                    },
                    "max_cost_micro": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Total cap across every attempt of a run"
                    },
                    "deadline_ms": {
                      "type": "integer",
                      "minimum": 500,
                      "maximum": 900000,
                      "description": "Total wall-clock cap; overrides stage deadlines"
                    }
                  },
                  "required": [
                    "kind",
                    "stages"
                  ]
                }
              ]
            },
            "template": {
              "type": "string",
              "minLength": 2,
              "maxLength": 60,
              "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
              "description": "Estimate a template instead of a definition"
            },
            "pins": {
              "type": "object",
              "additionalProperties": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 60
                },
                "minItems": 1,
                "maxItems": 20
              },
              "default": {},
              "description": "Stage id -> provider slugs to try first on that stage, e.g. {\"email\": [\"hunter\"]}. The router still falls back to the other vendors unless pins_only."
            },
            "pins_only": {
              "type": "boolean",
              "default": false,
              "description": "Use only the pinned vendors on pinned stages"
            },
            "speed": {
              "type": "string",
              "enum": [
                "fast",
                "balanced",
                "thorough"
              ],
              "description": "Override the template's speed: fast (race vendors; lowest latency, may pay more than one), balanced (one at a time, hedge a slow one), thorough (cheapest first, longest deadline)"
            },
            "max_cost_micro": {
              "type": "integer",
              "minimum": 0,
              "description": "Cap on the whole run's cost in micro-USD (1 USD = 1,000,000); the run stops with its partial record when the next attempt would exceed it"
            },
            "input": {
              "type": "object",
              "additionalProperties": {},
              "default": {}
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "enum": [
                  "waterfall_estimate"
                ]
              },
              "steps": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "stage_id": {
                      "type": "string"
                    },
                    "step_id": {
                      "type": "string"
                    },
                    "endpoint_id": {
                      "type": "string"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "eligible": {
                      "type": "boolean"
                    },
                    "reason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "circuit_open",
                        "over_step_budget",
                        "over_run_budget",
                        "missing_input",
                        "unsupported_mode",
                        "not_eligible",
                        "condition_false",
                        "deadline",
                        "stopped",
                        "low_confidence",
                        "missing_fields",
                        "unverified",
                        "client_error",
                        "rate_limited",
                        "server_error",
                        "timeout",
                        "account",
                        null
                      ]
                    },
                    "quote_micro": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "p50_ms": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0
                    },
                    "fill": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "rps": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "reach": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    }
                  },
                  "required": [
                    "stage_id",
                    "step_id",
                    "endpoint_id",
                    "provider",
                    "eligible",
                    "reason",
                    "quote_micro",
                    "p50_ms",
                    "fill",
                    "rps",
                    "reach"
                  ]
                }
              },
              "worst_case_cost_micro": {
                "type": "integer",
                "minimum": 0
              },
              "expected_cost_micro": {
                "type": "integer",
                "minimum": 0
              },
              "expected_ms": {
                "type": "integer",
                "minimum": 0
              },
              "worst_case_ms": {
                "type": "integer",
                "minimum": 0
              },
              "expected_fill": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "issues": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "path",
                    "message"
                  ]
                }
              }
            },
            "required": [
              "object",
              "steps",
              "worst_case_cost_micro",
              "expected_cost_micro",
              "expected_ms",
              "worst_case_ms",
              "expected_fill",
              "issues"
            ]
          }
        }
      }
    },
    "default": {
      "description": "Error",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "enum": [
                      "invalid_request",
                      "unauthorized",
                      "insufficient_balance",
                      "max_cost_exceeded",
                      "scope_denied",
                      "budget_blocked",
                      "not_found",
                      "idempotency_mismatch",
                      "invalid_meta",
                      "rate_limited",
                      "upstream_error",
                      "response_buffer_limit",
                      "provider_capacity_unavailable",
                      "grid_saturated",
                      "upstream_timeout",
                      "conflict",
                      "internal_error",
                      "account_frozen",
                      "strict_filters",
                      "plan_limit_reached",
                      "validation_failed",
                      "deadline_exceeded",
                      "cancelled"
                    ]
                  },
                  "message": {
                    "type": "string"
                  },
                  "request_id": {
                    "type": "string"
                  },
                  "call_id": {
                    "type": "string"
                  },
                  "retry_after_ms": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "details": {
                    "type": "object",
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "code",
                  "message"
                ]
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    }
  }
}
```
