Validate Node Flow
Check a node flow for problems without saving or publishing.
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-idstringrequiredWorkspace identifier for the API.
Path Parameters
idstringrequiredThe graph _id.
Request Body
graphobjectOptional graph fields to check instead of the stored ones: any of name, description, startNodeId, variables, globals, router, nodes, edges and dataSources.
Errors
| Status | Body | When |
|---|---|---|
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
problemsarrayEvery problem found, errors and warnings.
publishablebooleantrue when no problem is an error.
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 '{}'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": []
}
}'{
"problems": [
{ "code": "NO_OUTGOING", "severity": "error", "nodeId": "start" },
{ "code": "NO_END_NODE", "severity": "warning" }
],
"publishable": false
}{
"problems": [],
"publishable": true
}Last updated on