Run a canvas action
Run a canvas action with the FLORA API: POST /projects/{projectId}/actions/{nodeId}/run.
Runs an existing canvas action node, prebuilt or custom, through the action execution workflow. Pass params to update the node's stored parameter values first; the run uses the merged values.
POST https://app.flora.ai/api/v1/projects/{projectId}/actions/{nodeId}/runAuth: API key as a bearer token,
Authorization: Bearer $FLORA_API_KEY. See Authentication.TypeScript SDK:
client.projects.actions.run().Operation ID:
runCanvasAction.
Example
curl -X POST 'https://app.flora.ai/api/v1/projects/prj_abc123/actions/<nodeId>/run' \
-H "Authorization: Bearer $FLORA_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"params": {}
}'import { FloraClient } from '@flora-ai/flora';
const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });
const action = await client.projects.actions.run({
projectId: 'prj_abc123',
nodeId: '<nodeId>',
params: {},
});
console.log(action);Path parameters
projectId
string
Yes
Project identifier. Pattern: ^prj_\S+$. Example: prj_abc123.
nodeId
string
Yes
Canvas action node identifier: the persisted short id (n7) or the node UUID. At least 1 character. Pattern: ^\S+$.
Request body
Optional.
params
object
No
Parameter values to store on the node before running, merged key by key into the values it already holds (a named key is overwritten, omitted keys survive). Keys as GET /projects/{projectId}/actions/{nodeId} lists them.
state
any
No
Interaction state committed by the action's live preview (JSON, at most 256 KiB), replayed by the run exactly as the canvas replays a node's own state. Only meaningful for browser-runtime actions; omit otherwise.
Responses
201: Canvas action run started.
run_id
string
Yes
Run identifier. Pattern: ^run_\S+$. Example: run_abc123.
type
string
Yes
Run type. One of: generation, technique, action.
model
object or null
No
model.model_id
string
Yes
Model identifier. At least 1 character. Example: t2i-flux-2-pro.
technique
object or null
No
technique.technique_id
string
Yes
Technique identifier. Pattern: ^tech_\S+$. Example: tech_abcd1234.
technique.name
string
Yes
Technique name
action
object or null
No
action.action_id
string
Yes
Action identifier. One of: color-grade-image-browser, overlay-image-browser, draw-image-browser, pixel-remover-image-browser, magic-eraser-image-browser, crop-image-browser, scene-3d-image-browser, blur-image-browser, change-image-ar-browser, rotate-image-browser, color-filter-image-browser, color-tint-image-browser, filter-color-image-browser, duplicate-image-browser, side-by-side-composite-browser, add-shape-to-image-browser, add-text-to-image-browser, qr-code-generator-browser, resize-image-browser, shader-effect-browser, split-text-browser, find-and-replace-text-browser, concat-text-browser, ken-burns-video, stitch-videos, split-video, extract-video-frames, color-grade-video, video-to-frame-grid, boomerang-video, reverse-video, video-to-long-exposure, video-effect, color-filter-video, speed-up-video, slow-down-video, duplicate-video, greenscreen-video, resize-video, change-video-ar, and 2 more.
estimated_seconds
integer or null
Yes
At least 0.
charged_cost
number
Yes
Cost charged in USD. At least 0.
poll_url
string (uri) or null
No
URL to poll pending/running runs or fetch completed/failed run details.
project_id
string or null
No
Project identifier. Pattern: ^prj_\S+$. Example: prj_abc123.
canvas_url
string (uri) or null
No
Link to the project canvas. Hand this to the user as-is; a URL built from project_id does not resolve.
warnings
array of objects
No
Warnings for accepted input (unknown parameters and applied preprocessing changes)
warnings[].code
string
Yes
Stable warning code
warnings[].message
string
Yes
Human-readable warning message
warnings[].field
string
No
Feature or parameter the warning relates to
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?