Trillet AI logo

Get Node Flow

Retrieve a node flow: the graph, the effective graph and its companion call flow.

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

This is where you find the companion call flow's ID: it is pathway._id. Use that ID with Update Call Flow and for phone numbers and calls. Going the other way, Get Call Flow returns nodeGraphId.

If the graph has no companion call flow or agent (for example, an older graph), this request creates the missing pieces so voice, model and phone settings can be edited. If that fails, pathway is null and the graph is still returned.

Headers

x-workspace-idstringrequired

Workspace identifier for the API.

Path Parameters

idstringrequired

The graph _id (not the call flow ID).

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_FETCH_FAILED"}Unexpected server error, including a malformed ID

Response Fields

graphobject

The stored graph. Besides the fields in Graph fields, it has _id, workspaceId, status (draft, active or archived), hasDraft, draftData (the saved draft, or null), lastDraftSavedAt, publishedVersion, publishedAt, compiled (what calls run, null until the first publish), versions, stats, createdAt and updatedAt. The document can be large.

effectiveobject

The graph with the draft merged over the live fields: what the editor shows and what Validate and Publish act on. Equal to graph when there is no draft.

pathwayobject

The companion call flow, or null.

curl -X GET "https://api.trillet.ai/v2/api/node-graphs/{id}" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-workspace-id: YOUR_WORKSPACE_ID"
{
  "graph": {
    "_id": "a1a1a1a1a1a1a1a1a1a1a1a1",
    "workspaceId": "c1c1c1c1c1c1c1c1c1c1c1c1",
    "name": "Front desk",
    "status": "draft",
    "startNodeId": "start",
    "nodes": [],
    "edges": [],
    "hasDraft": false,
    "publishedVersion": 0
  },
  "effective": {
    "_id": "a1a1a1a1a1a1a1a1a1a1a1a1",
    "name": "Front desk",
    "startNodeId": "start",
    "nodes": [],
    "edges": []
  },
  "pathway": {
    "_id": "b1b1b1b1b1b1b1b1b1b1b1b1",
    "name": "Front desk",
    "description": "Node Flow",
    "direction": "bidirectional",
    "promptType": "nodes",
    "settings": {},
    "webhooks": [],
    "codeActions": [],
    "dynamicVariableCollections": [],
    "agent": { "_id": "d1d1d1d1d1d1d1d1d1d1d1d1", "name": "Front desk" }
  }
}

Last updated on