Run a canvas action
import { FloraClient } from '@flora-ai/flora';
const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });
const action = await client.projects.actions.run({ projectId: '<projectId>', nodeId: '<nodeId>', params: {}, state: '<state>',});console.log(action);curl -X POST 'https://app.flora.ai/api/v1/projects/<projectId>/actions/<nodeId>/run' \ -H 'Authorization: Bearer $FLORA_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "params": {}, "state": "<state>"}'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.
Error responses use the standard error body.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Project identifier
Project identifier
Canvas action node identifier: the persisted short id (n7) or the node UUID
Canvas action node identifier: the persisted short id (n7) or the node UUID
Request Body
Section titled “Request Body ”object
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.
object
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.
Example generated
{ "params": {}, "state": "example"}Responses
Section titled “ Responses ”Canvas action run started.
object
Run identifier
Run type
Cost charged in USD
Warnings for accepted input (unknown parameters and applied preprocessing changes)
object
Stable warning code
Human-readable warning message
Feature or parameter the warning relates to
Example
{ "run_id": "run_abc123", "type": "generation", "model": { "model_id": "t2i-flux-2-pro" }, "technique": { "technique_id": "tech_abcd1234" }, "action": { "action_id": "color-grade-image-browser" }, "project_id": "prj_abc123"}