Get a project graph
Get a project graph with the FLORA API: GET /workspaces/{workspaceId}/projects/{projectId}/graph.
Returns the full state of a project canvas: every node's short id, node UUID, type, label, prompt, model, parameters, absolute position, generation status, current output and, for document-bearing nodes such as timelines and decks, a summary of its authored content with the document revision, plus the edges between them and a revision marker. Full documents are read per node from the node document endpoint. 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.
GET https://app.flora.ai/api/v1/workspaces/{workspaceId}/projects/{projectId}/graphAuth: API key as a bearer token,
Authorization: Bearer $FLORA_API_KEY. See Authentication.TypeScript SDK:
client.projects.canvas.getGraph().Operation ID:
getProjectGraph.
Example
curl -X GET 'https://app.flora.ai/api/v1/workspaces/ws_abc123/projects/prj_abc123/graph' \
-H "Authorization: Bearer $FLORA_API_KEY"import { FloraClient } from '@flora-ai/flora';
const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });
const canvas = await client.projects.canvas.getGraph({
workspaceId: 'ws_abc123',
projectId: 'prj_abc123',
});
console.log(canvas);Path parameters
workspaceId
string
Yes
Workspace identifier. Pattern: ^ws_\S+$. Example: ws_abc123.
projectId
string
Yes
Project identifier. Pattern: ^prj_\S+$. Example: prj_abc123.
Responses
200: Project graph returned.
project_id
string
Yes
Project identifier. Pattern: ^prj_\S+$. Example: prj_abc123.
canvas_url
string (uri)
Yes
Project canvas URL
revision
string
Yes
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. At least 1 character. Example: 4f2c8ab19e3d7c05.
nodes
array of objects
Yes
Complete canvas node list
nodes[].id
string
Yes
Short node identifier. Stable across reads and the vocabulary canvas edges use. At least 1 character. Example: n1.
nodes[].node_id
string
Yes
Canvas node UUID. Stable for the node's life. At least 1 character. Example: 7f6ae6da-4a0e-4a2f-9c6a-2c1c6b8d1f21.
nodes[].type
string
Yes
Node type in agent vocabulary, for example image, video, text, model3d, action, batch, or group. At least 1 character. Example: image.
nodes[].label
string
Yes
Node display label
nodes[].group
string or null
No
Direct parent group short id (n7), or null for top-level nodes and pinned labels. Use this to verify existing field membership; omitted on older API deployments.
nodes[].prompt
string or null
Yes
Configured generation prompt, or null when the node has none
nodes[].model
string or null
Yes
Configured model name, or null when the node generates nothing
nodes[].model_id
string or null
Yes
Configured model endpoint identifier. Preferred over model because it survives catalog renames.
nodes[].params
object or null
Yes
Configured model parameters excluding prompt, which is reported separately. Null when the node sets none.
nodes[].action
object or null
Yes
Action-node configuration. Null for every node type other than action.
nodes[].action.action_id
string or null
Yes
Prebuilt action slug the node runs, for example rotate-image. Null when the node runs custom code.
nodes[].action.params
object or null
Yes
Configured action parameter values, keyed by the snake_case parameter ids the actions endpoints expose. Null when none are set.
nodes[].position
object
Yes
Absolute canvas position of the node's anchor, with parent groups resolved. Every node type except group anchors at the top-center of its box, so its visual left edge is x minus half its width; a group anchors top-left.
nodes[].position.x
number
Yes
Horizontal canvas coordinate
nodes[].position.y
number
Yes
Vertical canvas coordinate
nodes[].size
object
Yes
The node's on-canvas footprint: the rendered box once the node has painted, else its stored or default size. With position this is the box the arrange endpoint lays out, so neighbours can be placed without guessing card sizes.
nodes[].size.width
number
Yes
Node width in canvas units. At least 0.
nodes[].size.height
number
Yes
Node height in canvas units. At least 0.
nodes[].status
string or null
Yes
Derived generation status. Null for node types that carry no generation lifecycle, such as groups, comments, batches, routers, switches, exports, and labels. One of: idle, generating, done, error.
nodes[].error_code
string
No
Machine-readable failure code. Present only when status is error.
nodes[].error_message
string
No
User-facing failure message. Present only when status is error.
nodes[].output_url
string or null
Yes
URL of the node's current media output, or null when it has none or its output is not externally addressable
nodes[].output_text
string or null
Yes
The node's current text output, or null when it has none
nodes[].text
string or null
Yes
Annotation body for a notes or label node — the text a reader sees on the canvas, in full. Null on every node type that carries none. Distinct from output_text, which is generated output.
nodes[].document
object or null
Yes
Summary of the node's authored content for document-bearing nodes (timeline), or null when the node carries no document or none has been written yet. Read the full document from the node document endpoint.
nodes[].document.kind
string
Yes
Document kind, for example "timeline". Kinds you do not recognise may appear on newer nodes: keep the wrapper and ignore the body.
nodes[].document.schema_version
integer
Yes
Version of the document schema the body follows
nodes[].document.revision
integer
Yes
Revision of this node's document. Pass it as base_revision on a changeset update to reject a stale write.
nodes[].document.updated_at
integer
No
Last document write, Unix milliseconds; absent for Deck documents
nodes[].document.summary
map of string or number or boolean
Yes
Kind-specific one-line facts. A timeline reports duration_in_frames, duration_in_seconds, fps, composition_width, composition_height, track_count, item_count and asset_count.
edges
array of objects
Yes
Complete canvas edge list
edges[].from
string
Yes
Short identifier of the source node. At least 1 character. Example: n1.
edges[].to
string
Yes
Short identifier of the target node. At least 1 character. Example: n2.
edges[].in
string or null
Yes
Input slot the edge lands in on the target node, for example "image" or "enabled". Null when the edge names no slot.
Errors
Every error has the same body: error.code, error.message, and error.fields on validation errors. See Errors for how to recover from each code.
400
invalid_json, input_validation_error
The body isn't valid JSON, or an input failed validation (fields lists each one).
401
unauthorized, invalid_api_key
The API key is missing, invalid or revoked.
402
insufficient_credits
The workspace balance is too low for this request.
403
forbidden, paid_plan_required
The key can't do this, or the workspace plan doesn't include it.
404
not_found
The resource doesn't exist or isn't visible to this key.
409
idempotency_duplicate, revision_conflict
Duplicate Idempotency-Key or a stale base_revision.
429
rate_limited
Too many requests. Back off and retry.
500
unknown_error, internal_error
Something failed on FLORA's side. Retry with backoff.
503
temporarily_unavailable
Authorization is temporarily unavailable. Retry later.
Last updated
Was this helpful?