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
| Field | Description |
|---|---|
| Prompt | Natural 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
| Field | Type | Description |
|---|---|---|
valid | boolean | Whether all validation rules passed |
errors | array | List of human-readable error messages for failed rules (empty when valid) |
error | boolean | Whether a system error occurred |
error_message | string | Error description if the step itself failed |