Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

validation

Evaluates a list of rules. Each rule’s logic must evaluate to exactly true; any other result records the rule’s message in the response’s error list. validate is an accepted alias for validation.

Synopsis

{
  "name": "validation",
  "input": {
    "rules": []
  }
}

Description

validation is an engine built-in from dataflow-rs. Orion declares no input schema for it, so a mistake in input surfaces when the task runs rather than when the workflow is saved.

Retry safety: pure. An engine built-in reads and writes the message and nothing else. Validation is non-destructive: it never mutates the data context.

Fields

FieldTypeRequiredDefaultDescription
rulesarrayyesList of { "logic", "message" } rules
rules[].logicJSONLogicyesMust evaluate to true to pass
rules[].messagestringyesError message recorded when the rule fails

Examples

{
  "name": "validation",
  "input": {
    "rules": [
      { "logic": { "!!": [{ "var": "data.order.customer_id" }] }, "message": "customer_id is required" },
      { "logic": { ">": [{ "var": "data.order.total" }, 0] },        "message": "total must be positive" }
    ]
  }
}

Caveats

A failed rule records an error and carries on

A failed rule records an error; it does not stop the workflow unless you say so. The task returns a 400 and the message lands in the response’s errors array. The engine’s rule is that 4xx warns and carries on; continue_on_error governs 5xx and handler errors only. So a validation followed by unguarded tasks proceeds exactly as if it had passed.

Collecting every failure and carrying on is a legitimate shape, which is why it is the default. When you meant a gate, add halt_on:

{ "id": "check", "name": "Check", "halt_on": "failure",
  "function": { "name": "validation", "input": { "rules": [
    { "logic": { "==": [1, 1] }, "message": "…" } ] } } }

The task keeps its own 400 on the audit trail and in metadata.progress. Two older spellings still work and are better when you need something else. filter halts with no body and records 299. A later task with a condition on the failure plus terminal: true is the only form that can answer with a status of its own.

terminal: true on the validation itself does not help — it is about position, not outcome, so it halts whether the rules passed or failed. orion-server lint reports the unguarded shape as engine.unguarded_validation.

Last verified 14 September 2026