# exo_validate_flow

> Documentation index: https://exomations.com/llms.txt

Check a flow definition without saving it.

Pass a `definition`, or a `flowId` to check a saved flow. It runs the static checks that `exo_create_flow` and `exo_update_flow` run first, and saves nothing. Steps your plan does not include are reported as warnings; the result stays valid. For a saved flow, the step types it already has are not reported.

Permission: `build`.

## Input

| Name | Type | Required | Description |
|---|---|---|---|
| `definition` | object | no | A flow definition { nodes, edges } to validate. |
| `flowId` | string | no | Validate this existing flow instead of an inline definition. |

## Returns

`valid`, `errors` and `warnings`. Each issue has `level`, `message` and, where it applies, `nodeId`.

## Plan

Each step type belongs to a plan. A create or update that adds a step your workspace's plan does not include is refused before anything is saved, with `code: "PLAN_REQUIRED"`, the plan it needs (`requiredPlan`), the steps involved (`steps`) and the message in English, Arabic and Chinese (`messages`). `exo_get_node_types` marks which steps your plan includes, and `exo_validate_flow` reports them as warnings.

```json
{
  "saved": false,
  "code": "PLAN_REQUIRED",
  "upgradeRequired": true,
  "currentPlan": "starter",
  "requiredPlan": "pro",
  "steps": [
    {
      "nodeId": "sftp_1",
      "type": "sftp",
      "label": "SFTP / FTP Files",
      "family": "advanced_integrations",
      "requiredPlan": "pro"
    }
  ],
  "messages": {
    "en": "Your Starter plan doesn't include these steps: SFTP / FTP Files. They are part of the Professional plan. Nothing was created. Upgrade to Professional, or use steps your plan includes.",
    "ar": "…",
    "zh": "…"
  }
}
```

## Errors

- Tool result with `isError: true`: `Flow "<flowId>" not found.`
- Tool result with `isError: true`: `Pass either `definition` or `flowId` to validate.`
- Tool result with `isError: true`: ``definition` rejected: <reason>.`
- JSON-RPC -32001 (HTTP 403): `API key lacks the 'build' permission required for flow authoring tools`

## Example call

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "exo_validate_flow",
    "arguments": {
      "definition": {
        "nodes": [
          {
            "id": "trigger_1",
            "type": "trigger",
            "position": {
              "x": 0,
              "y": 0
            },
            "data": {
              "nodeType": "trigger",
              "label": "Webhook",
              "config": {}
            }
          },
          {
            "id": "http_1",
            "type": "http_request",
            "position": {
              "x": 260,
              "y": 0
            },
            "data": {
              "nodeType": "http_request",
              "label": "Post order",
              "config": {
                "url": "https://example.com/orders",
                "method": "POST",
                "body": "{{trigger.order_id}}"
              }
            }
          }
        ],
        "edges": [
          {
            "id": "e1",
            "source": "trigger_1",
            "target": "http_1"
          }
        ]
      }
    }
  }
}
```

## Example result

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "Valid. 0 warning(s).\n{ ... }"
      }
    ],
    "structuredContent": {
      "valid": true,
      "errors": [],
      "warnings": []
    },
    "isError": false
  }
}
```
