Canvas

Update a canvas action

Changed on

Changes a canvas action node in place: replacement code for a custom action (fix a broken action without adding a second node), a label, or stored parameter values. Custom code needs the workspace plan to include custom actions. Returns the node's description after the change.

patch/projects/{projectId}/actions/{nodeId}

Request

  • Base URL
    https://app.flora.ai/api/v1
  • URL
    https://app.flora.ai/api/v1/projects/{projectId}/actions/{nodeId}
  • Auth
    HTTP bearer

Path parameters

projectIdstring required

Project identifier

Example:prj_abc123
nodeIdstring required

Canvas action node identifier: the persisted short id (n7) or the node UUID

Request body

codestring

Replacement source for a custom action node, annotated like a create. The node keeps its id and wiring; its parameter values survive where the new code still declares them, its preview state is reset. Rejected on a prebuilt node. Limits: at most 1048576 bytes of UTF-8 source; each @flora-inputs, @flora-outputs and @flora-params JSON array at most 131072 bytes, with up to 64 inputs, 64 outputs, 128 params and 256 options per select. A multiple bounds object takes nonnegative integer min and max with min (1 when absent) at most max, and each declared default must be a value its param accepts.

language'javascript' | 'python'

Language of the replacement code; defaults to the node's current language.

runtime'node' | 'python' | 'browser'

Where custom code runs. python code runs on python; javascript runs on node (the harness with getInput/getParam/writeOutput) or browser (an ES module exporting execute and optionally preview, which hosts can mount live). Defaults to browser for JavaScript that exports execute, otherwise the language's sandbox. Ignored with action_id.

labelstring

New node label on the canvas.

paramsobject

Action parameters (snake_case keys). For a prebuilt action the accepted keys depend on action_id; see GET /actions/{actionId} or POST /runs/action for the per-action schema. For a custom action they are the keys its @flora-params annotation declares, as GET /projects/{projectId}/actions/{nodeId} lists them, in at most 262144 bytes of JSON.

Response

Canvas action updated.

project_idstring required

Project identifier

node_idstring required

Canvas action node UUID

short_idstring nullable required

Persisted short id (n7) of the node, when settled

action_id'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' | 'split-audio-from-video' | 'merge-audio-into-video' nullable required

Action identifier

customboolean required

True when the node runs its own code rather than a prebuilt action

namestring required

Action name

descriptionstring required

Action description

language'javascript' | 'python' required

Action source language

runtime'node' | 'python' | 'browser' required

Where the action executes: a server sandbox (node, python) or the browser runtime (browser), which a host can also run live

has_previewboolean required

True when the code is a browser-runtime module exporting preview, so a host can mount it live and re-render edits without a run

codestring nullable required

The action's source. For a browser-runtime action, mount it in the FLORA action runtime frame for a live preview; a run replays the same code on the server.

tool_stateunknown
charged_costnumber required

Cost per execution in USD

lockedboolean required

True when the node is locked and cannot be run or edited

param_valuesobject required

Parameter values stored on the node, keyed like params[].key; defaults apply for missing keys

canvas_urlstring uri required

Project canvas URL

Example response

{
  "project_id": "prj_abc123",
  "node_id": "4d2f7c7e-1b1a-4c7f-9e1d-5b9d1f3b2c10",
  "action_id": "color-grade-image-browser",
  "name": "Poster palette",
  "inputs": [
    {
      "name": "image"
    }
  ],
  "outputs": [
    {
      "name": "image"
    }
  ],
  "params": [
    {
      "key": "angle",
      "type": "select",
      "label": "Angle",
      "info_tooltip": "Rotation angle in degrees."
    }
  ],
  "connected_inputs": [
    {
      "node_id": "n3"
    }
  ]
}

Changes

    • warning

      added the new not_configured enum value to the / response property for the response status

    • warning

      added the new not_configured enum value to the / response property for the response status

    • warning

      added the new not_configured enum value to the / response property for the response status

    • warning

      added the new not_configured enum value to the / response property for the response status

    • warning

      added the new not_configured enum value to the / response property for the response status

    • warning

      added the new not_configured enum value to the / response property for the response status

    • warning

      added the new not_configured enum value to the / response property for the response status

    • warning

      added the new not_configured enum value to the / response property for the response status

    • warning

      added the new not_configured enum value to the / response property for the response status

    • info

      endpoint added