remagicaDocs home
API referenceWorkflows

Run nodes

POST
/workflows/{workflowId}/runs

Needs a key withworkflows:run

Runs nodes of a workflow in the background. Each node runs count times (per item, when an iterator or a splitter feeds it) and adds that many results to the ones it has; its results show up pending at once. Only the nodes asked for run: what's upstream (one hop, and one more past a Router) is read as the result it shows and never run again. Nodes of the run that feed each other run in dependency order.

A run is refused with 409 RUN_REFUSED when a node asked for is already running, a required input isn't connected, or something upstream is still processing, has failed or has nothing to give (data.code says which, data.nodeIds names the nodes). An auto version of the workflow is saved with every run.

The response is 202 Accepted with the run. Follow it with GET /workflows/{workflowId}/events, or poll GET /workflow-runs/{runId}.

Requires scope workflows:run.

Authorization

apiKey
headerx-api-key<token>

An API key of your workspace (rmg_…), created in the web app. It acts for that workspace, not for a person, and keeps working when its creator leaves.

Path Parameters

workflowId*string
Length1 <= length <= 128

Header Parameters

Idempotency-Key?string

Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is 409 CONFLICT. A request that fails frees its key.

Length1 <= length <= 255

Request Body

application/json
  1. body
count?integer

How many results each node makes (per item, when an iterator or a splitter feeds it), 1–20.

Range1 <= value <= 20
Default1
fromDraft?

Render final: run the one Video node in nodeIds as the final (1080p, billed in full) of its draft result resultId, rather than with its settings. Drafts can be rendered for 7 days.

idempotencyKey?string

Send the same key again (a retry after a timeout) and you get the run the first request started, not a second one.

Length1 <= length <= 200
nodeIds*array<>

The nodes to run (node, selection), or the Sections whose runnable nodes run (section).

Items1 <= items <= 500
pageId?string

The page they're on; the first page when left out.

Length1 <= length <= 128
priceVersion?integer

The price book version (GET /pricing) your estimate came from. If prices went up since, the run is refused with 409 PRICE_CHANGED and its new estimate, rather than charged more than you showed.

Range0 <= value
runType?string
Default"node"
Value in"node""selection""section"

Response Body

Accepted: the run is going.

application/json
  1. response

One run of nodes of a workflow.

completedAt*|null
count*integer
createdAt*string
Formatdate-time
creditsEstimated*integer

What the run was estimated to cost when it started: Σ per node of one result's price × count × items.

creditsSpent*integer

What its results have cost so far (refunds taken off).

error*string|null
id*string
nodeIds*array<string>

The nodes it runs, each after the ones of them it reads.

pageId*string
results?array<>

Its results so far (with the run on its own).

runType*string
Value in"node""selection""section"
status*string

running → completed (every result finished), failed (some really failed), cancelled (stopped, nothing kept) or stopped (stopped, or some results cancelled, with what was kept said in error: results already rendering finish and are charged).

Value in"running""completed""failed""cancelled""stopped"
workflowId*string
Example Request
curl -X POST 'https://api.remagica.com/api/v1/workflows/cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05/runs' \  -H 'Content-Type: application/json' \  -d '{  "nodeIds": [    "string"  ]}'
Example Response
{  "completedAt": "2026-10-21T12:00:00.000Z",  "count": 1,  "createdAt": "2026-10-21T12:00:00.000Z",  "creditsEstimated": 12,  "creditsSpent": 12,  "error": null,  "id": "8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08",  "nodeIds": [    "string"  ],  "pageId": "c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05",  "results": [    {      "createdAt": "string",      "credits": 12,      "error": null,      "id": "a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05",      "outputs": {},      "provider": "string",      "runId": "599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05",      "settings": {},      "status": "pending",      "stop": "kept",      "item": 1,      "nodeId": "7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05",      "variation": 1    }  ],  "runType": "node",  "status": "running",  "workflowId": "cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"}