Trillet AI logo

Validate Node Flow

Check a node flow for problems without saving or publishing.

POSThttps://api.trillet.ai/v2/api/node-graphs/{id}/validate

Checks the effective graph (the draft merged over the live fields, or just the live fields if there is no draft) and lists every problem it finds. Nothing is saved. Run it before Publish: a graph is publishable when none of its problems has severity of error.

To check a graph you have not saved, send it in graph. Its fields are laid over the effective graph for this check only. Fields you leave out come from the effective graph.

Validate also reports one extra warning that Publish does not: ABILITY_NOT_CONNECTED, when a conversation node asks for an ability whose integration is not connected on the companion call flow.

Headers

x-workspace-idstringrequired

Workspace identifier for the API.

Path Parameters

idstringrequired

The graph _id.

Request Body

graphobject

Optional graph fields to check instead of the stored ones: any of name, description, startNodeId, variables, globals, router, nodes, edges and dataSources.

Errors

StatusBodyWhen
400{"code": "WORKSPACE_ID_REQUIRED"}No x-workspace-id
404{"code": "NODE_GRAPH_NOT_FOUND"}No graph with that ID in the workspace
500{"code": "NODE_GRAPH_VALIDATE_FAILED"}Unexpected server error

A graph with problems is not an error: it returns 200 with the problems listed.

Response Fields

problemsarray

Every problem found, errors and warnings.

publishableboolean

true when no problem is an error.

Check the stored graph
curl -X POST "https://api.trillet.ai/v2/api/node-graphs/{id}/validate" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-workspace-id: YOUR_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{}'
Check an unsaved graph
curl -X POST "https://api.trillet.ai/v2/api/node-graphs/{id}/validate" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-workspace-id: YOUR_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "graph": {
      "startNodeId": "start",
      "nodes": [
        {
          "nodeId": "start",
          "type": "conversation",
          "name": "Greeting",
          "config": { "objective": "Greet the caller." }
        }
      ],
      "edges": []
    }
  }'
Not publishable
{
  "problems": [
    { "code": "NO_OUTGOING", "severity": "error", "nodeId": "start" },
    { "code": "NO_END_NODE", "severity": "warning" }
  ],
  "publishable": false
}
Publishable
{
  "problems": [],
  "publishable": true
}

Last updated on