Skip to content
FLORA DocsGo to app
Resources

Runs

Start generation and technique runs, then poll for status and outputs.

Runs are asynchronous workflow executions. Create a run, keep the returned run ID or poll URL, then poll until the run reaches completed or failed.

The slug-based technique run endpoint is the most common path:

Terminal window
curl -X POST https://app.flora.ai/api/v1/techniques/cctv-cam/runs \
-H "Authorization: Bearer sk_live_XXXX" \
-H "Content-Type: application/json" \
-d '{
"inputs": [
{ "id": "input_image", "type": "imageUrl", "value": "https://example.com/photo.png" }
],
"mode": "async",
"idempotency_key": "request-123"
}'

Response:

{
"runId": "run_...",
"status": "pending",
"progress": 0,
"pollUrl": "https://app.flora.ai/api/v1/techniques/cctv-cam/runs/run_..."
}
Terminal window
curl https://app.flora.ai/api/v1/techniques/cctv-cam/runs/run_XXXX \
-H "Authorization: Bearer sk_live_XXXX"

Poll every 2–5 seconds. Stop when status is completed or failed.

Some workflows use the top-level generation endpoint:

Terminal window
curl -X POST https://app.flora.ai/api/v1/runs/generation \
-H "Authorization: Bearer sk_live_XXXX" \
-H "Content-Type: application/json" \
-d '{
"type": "image",
"prompt": "A small blue flower on a white background",
"workspace_id": "ws_XXXX",
"project_id": "proj_XXXX"
}'

The response includes a run identifier such as run_id, runId, or id, and may include a workflow_run_id.

If you already have a technique ID from GET /api/v1/techniques/{slug}, you can also start a run through the top-level technique endpoint:

Terminal window
curl -X POST https://app.flora.ai/api/v1/runs/technique \
-H "Authorization: Bearer sk_live_XXXX" \
-H "Content-Type: application/json" \
-d '{
"technique_id": "tech_XXXX",
"workspace_id": "ws_XXXX",
"inputs": {
"input_image": "https://example.com/photo.png"
}
}'
StatusMeaning
pendingThe run is queued
runningWork is in progress; check progress
completedOutputs are ready
failedCheck errorCode and errorMessage
MethodPathDescription
POST/api/v1/techniques/{slug}/runsCreate a slug-based technique run
GET/api/v1/techniques/{slug}/runs/{runId}Poll a slug-based technique run
POST/api/v1/runs/generationStart a general generation run
POST/api/v1/runs/techniqueStart a technique run by technique ID
  • Runs are asynchronous. Do not expect final outputs from the create response.
  • Use idempotency_key for slug-based technique runs when retrying after network errors.
  • Permission or credit constraints may return 403 forbidden or 402 insufficient_credits.
  • Output URLs are long-lived but not permanent. Download anything you need to keep.