# uip flow validate

> `uip flow validate` validates a `.flow` file against the Flow schema with structural cross-field checks. An optional `--governance` pass additionally validates agent nodes against your organization's governance policies.

`uip flow validate` validates a `.flow` file against the Flow schema with structural cross-field checks. An optional `--governance` pass additionally validates agent nodes against your organization's governance policies.

## Synopsis

```
uip flow validate <flowFile> [--governance]
```

Honors [global options](./global-options.md). Exit codes follow the [standard contract](./exit-codes.md).

## Arguments

- `<flowFile>` *(required)* — path to the `.flow` file (or a JSON file conforming to the Flow schema).

## Options

- `--governance` — also validate agent nodes against organization governance policies. **Requires `uip login`**; the CLI fetches `enforcements` and the allowed `modelNames` from the platform before running the check. If the fetch fails, the command errors out — omit `--governance` to skip policy checks.

## Behavior

- Schema validation runs locally and does not require login.
- Structural checks ensure references between nodes, edges, bindings, variables, and definitions are consistent.
- With `--governance`, any agent node whose configuration (model, tools, policies) conflicts with the fetched enforcements is flagged.

## Examples

```bash
# Structural validation only (no login required)
uip flow validate invoice-flow.flow

# Full validation including governance policy for agent nodes
uip flow validate invoice-flow.flow --governance
```

## Data shape (--output json)

On success:

```json
{
  "Code": "FlowValidate",
  "Data": {
    "File": "invoice-flow.flow",
    "Status": "Valid"
  }
}
```

On validation failure, the command exits non-zero and returns a `Failure` result with error details in `Message` / `Instructions`.

:::note
The exact shape of the failure payload (per-error list, paths, rule IDs) may evolve across releases. For scripts that parse failure details programmatically, run a known-bad validation once with `--output json` to capture the current shape and pin `@uipath/cli` in CI.
:::

## See also

- [`uip flow debug`](./uip-flow-debug.md) — dynamic validation via Studio Web
- [`uip flow pack`](./uip-flow-pack.md) — pack a validated project
- [Flow overview](./uip-flow.md)
