rf validate
Synopsis
Section titled “Synopsis”rf validate [options]Description
Section titled “Description”rf validate checks a pipeline definition for structural and type errors without executing any nodes. Run it before rf run to catch problems early, or add it to your CI pipeline.
Options
Section titled “Options”| Flag | Default | Description |
|---|---|---|
--strict | — | Treat warnings as errors. |
--fix | — | Auto-fix common issues (e.g., missing output schemas inferred from upstream). |
--schema-only | — | Check only schema compatibility, skip other validations. |
--format <fmt> | text | Output format: text or json. |
Examples
Section titled “Examples”Basic validate
Section titled “Basic validate”$ rf validate
Validating flow.yaml...
read-leads OK score-leads OK filter-top OK write-output OK
4 nodes validated. No errors.Strict mode
Section titled “Strict mode”Promotes warnings to errors. Useful in CI to enforce clean pipelines.
$ rf validate --strict
Validating flow.yaml...
read-leads OK score-leads OK filter-top WARNING Unused output port 'count' (strict: treated as error) write-output OK
1 error found.Auto-fix
Section titled “Auto-fix”$ rf validate --fix
Validating flow.yaml...
read-leads OK score-leads FIXED Added inferred output schema from upstream filter-top OK write-output OK
4 nodes validated. 1 fix applied. No errors.Validation checks
Section titled “Validation checks”rf validate runs these checks against your flow.yaml:
| Check | Description |
|---|---|
| Schema compatibility | Output port schemas are compatible with connected input port schemas. Field names and types must match. |
| Edge compatibility | A Value output cannot connect to a Table input. Port data types must be compatible. |
| Cycle detection | The node graph must be a DAG. Circular dependencies are rejected. |
| Missing references | Every ref() points to a node and port that exist. |
| Duplicate node IDs | Every node has a unique slug. |
| Required fields | Nodes have the required type, op, and port declarations. |
| Unknown operations | The op value is a recognized built-in or registered custom operation. |
Error example
Section titled “Error example”$ rf validate
Validating flow.yaml...
read-leads OK score-leads OK filter-top ERROR Type mismatch on input 'data': expected Table, got Value from ref(score-leads.count) write-output ERROR Missing reference: ref(transform.result) node 'transform' does not exist
2 errors found.Cycle detection
Section titled “Cycle detection”$ rf validate
Validating flow.yaml...
ERROR Cycle detected: node-a -> node-b -> node-c -> node-a
1 error found.JSON output
Section titled “JSON output”Use --format json for machine-readable output in CI.
$ rf validate --format json{ "valid": false, "errors": [ { "type": "type_mismatch", "node": "filter-top", "port": "data", "expected": "Table", "actual": "Value", "source": "ref(score-leads.count)" }, { "type": "missing_ref", "node": "write-output", "port": "data", "ref": "ref(transform.result)", "message": "node 'transform' does not exist" } ], "nodes_checked": 4}CI integration
Section titled “CI integration”Add validation to your CI pipeline:
rf validate --strict --format json || exit 1Pair with rf inspect to review the full graph structure after validation passes.
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
0 | Pipeline is valid. |
1 | Errors found. |
2 | Warnings found (only with --strict). |