> For the complete documentation index, see [llms.txt](https://docs.flora.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flora.ai/api/reference/canvas/runcanvasaction.md).

# 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.

```http
POST https://app.flora.ai/api/v1/projects/{projectId}/actions/{nodeId}/run
```

* **Auth:** API key as a bearer token, `Authorization: Bearer $FLORA_API_KEY`. See [Authentication](https://docs.flora.ai/api/platform/authentication.md).
* **TypeScript SDK:** `client.projects.actions.run()`.
* **Operation ID:** `runCanvasAction`.

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
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": {}
}'
```

{% endtab %}

{% tab title="TypeScript SDK" %}

```typescript
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);
```

{% endtab %}
{% endtabs %}

## Path parameters

| Name        | Type   | Required | Description                                                                                                          |
| ----------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------- |
| `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.

| Field    | Type   | Required | Description                                                                                                                                                                                                                 |
| -------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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.

| Field                    | Type                 | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------------------------ | -------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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 in USD. For a generation run, the list price of this request's parameters before any plan discount, and an estimate for usage-priced models; when the request cannot be priced in time, the model's price at default settings. GET /runs/{run\_id} reports the settled amount once the run completes. 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](https://docs.flora.ai/api/platform/errors.md) for how to recover from each code.

| Status | Code                                         | Meaning                                                                             |
| ------ | -------------------------------------------- | ----------------------------------------------------------------------------------- |
| 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.                              |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flora.ai/api/reference/canvas/runcanvasaction.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
