Skip to main content

Overview

The Validator step acts as a quality gate in your workflow. It takes the output from previous steps and checks it against validation rules you describe in natural language. The AI evaluates each rule and returns a boolean valid result plus an array of specific error messages for any rules that failed. This is useful when you need to:
  • Verify required fields are present before writing to a database
  • Check that API response data meets expected formats or ranges
  • Enforce business rules (e.g. “royalty rate must be between 0 and 1”)
  • Catch bad data early before it flows to downstream steps

How It Works

At runtime, the Validator receives the full execution context as input. Your prompt defines the rules to check. The AI returns a structured result with valid (true/false) and errors (an array of human-readable error strings). When valid is false, you can use branches to route the workflow to an error-handling path.
Prompt:
Validate the contract data:
- "title" must be a non-empty string
- "effective_date" must be a valid date in YYYY-MM-DD format
- "royalty_rate" must be a number between 0 and 1
- "parties" must be an array with at least 2 entries
Output when valid:
{
  "valid": true,
  "errors": []
}
Output when invalid:
{
  "valid": false,
  "errors": [
    "royalty_rate is 1.5, which exceeds the maximum of 1",
    "parties has only 1 entry, minimum is 2"
  ]
}

Configuration

FieldDescription
PromptNatural language validation rules to check against the input data. Use template variables to reference specific data from previous steps.

Writing Good Prompts

  • List rules explicitly — each rule on its own line makes it easier for the AI to evaluate and report individually
  • Include expected types and ranges — “must be a number between 0 and 100” is better than “must be reasonable”
  • Be specific about what counts as failure — e.g. “empty strings and null values should fail the non-empty check”

Using Libraries

The prompt editor has built-in library integration. Click Library above the editor to load a saved prompt, or click Save to store the current prompt as a reusable library item. This is useful when the same validation rules apply across multiple automations.

Output

FieldTypeDescription
validbooleanWhether all validation rules passed
errorsarrayList of human-readable error messages for failed rules (empty when valid)
errorbooleanWhether a system error occurred
error_messagestringError description if the step itself failed
Combine with branches to create conditional paths: add a branch on output.valid equals false to route to error handling, and let the default connector continue the happy path.