Skip to content

Get a project graph

GET
/workspaces/{workspaceId}/projects/{projectId}/graph
import { FloraClient } from '@flora-ai/flora';
const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });
const canva = await client.projects.canvas.getGraph({
workspaceId: '<workspaceId>',
projectId: '<projectId>',
});
console.log(canva);

Returns the full state of a project canvas: every node’s short id, node UUID, type, label, prompt, model, parameters, absolute position, generation status and current output, plus the edges between them and a revision marker. This is the lossless counterpart of the Mermaid canvas rendering, which collapses node types and truncates labels. Short ids are persisted as part of the read, so the id reported for a node is the same on every subsequent read and is the id canvas write operations accept. The revision is opaque: an identical value means nothing this endpoint reports has changed, a different value means something has, and no ordering can be inferred from two values.

Error responses use the standard error body.

workspaceId
required

Workspace identifier

string
/^ws_\S+$/

Workspace identifier

projectId
required

Project identifier

string
/^prj_\S+$/

Project identifier

Project graph returned.

Media type application/json
object
project_id
required

Project identifier

string
/^prj_\S+$/
canvas_url
required

Project canvas URL

string format: uri
revision
required

Opaque change-detection marker for the reported graph. An identical value means nothing this endpoint reports has changed; a different value means something has. It is not a counter, so no ordering can be inferred from two values.

string
>= 1 characters
nodes
required

Complete canvas node list

Array<object>
<= 2000 items
object
id
required

Short node identifier. Stable across reads and the vocabulary canvas edges use.

string
>= 1 characters
node_id
required

Canvas node UUID. Stable for the node’s life.

string
>= 1 characters
type
required

Node type in agent vocabulary, for example image, video, text, action, batch, or group

string
>= 1 characters
label
required

Node display label

string
prompt
required
Any of:
string
model
required
Any of:
string
model_id
required
Any of:
string
params
required
Any of:
object
key
additional properties
any
action
required
Any of:
object
action_id
required
Any of:
string
params
required
Any of:
object
key
additional properties
any
position
required

Absolute canvas position with parent groups resolved

object
x
required

Horizontal canvas coordinate

number
y
required

Vertical canvas coordinate

number
status
required
Any of:
string
Allowed values: idle generating done error
error_code

Machine-readable failure code. Present only when status is error.

string
error_message

User-facing failure message. Present only when status is error.

string
output_url
required
Any of:
string
output_text
required
Any of:
string
edges
required

Complete canvas edge list

Array<object>
<= 10000 items
object
from
required

Short identifier of the source node

string
>= 1 characters
to
required

Short identifier of the target node

string
>= 1 characters
in
required
Any of:
string
Example
{
"project_id": "prj_abc123",
"revision": "4f2c8ab19e3d7c05",
"nodes": [
{
"id": "n1",
"node_id": "7f6ae6da-4a0e-4a2f-9c6a-2c1c6b8d1f21",
"type": "image",
"status": "idle"
}
],
"edges": [
{
"from": "n1",
"to": "n2"
}
]
}