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 booleanvalid 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 withvalid (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.
Example: validate contract data
Example: validate contract data
Prompt:Output when valid:Output when invalid:
Configuration
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
The Validator returns only
valid and errors. A failing rule is a normal result (valid: false) — not a step error. If the underlying AI call itself fails, the step throws and is marked errored in the run logs; there are no error or error_message output fields.