For the complete documentation index, see llms.txt. This page is also available as Markdown.

Manage Workflows

List, retrieve, create, and update the Workflows in a workspace through the REST API and Python SDK.

About

Roboflow Workflows are visual computer-vision pipelines you build in the web app and deploy as a hosted endpoint. This page covers the management surface - listing, retrieving, creating, and updating the Workflows in a workspace - through the REST API and Python SDK. To run a Workflow against an image or video stream, see the Workflows runtime docs.

HTTP API

Roboflow Workflows are visual computer-vision pipelines you can build in the web app and deploy as a hosted endpoint. The REST API exposes the management surface; for executing a workflow against an image or video stream, see Run a Model on an Image and the Workflows runtime docs.

api_key may be passed as a query parameter or in the request body. Required scopes are noted on each endpoint.

Project Base Workflows

Each Project has a base Workflow that backs its hosted model endpoint. Use these Project-scoped operations to read that Workflow or select the model used by its model step.

Get a Project Base Workflow

GET /:workspace/:project/deploy

Required scope: project:read

curl "https://api.roboflow.com/my-workspace/my-project/deploy?api_key=$ROBOFLOW_API_KEY"

If the Project does not have a base Workflow, this request creates one. The response identifies the Project, its base Workflow, the selected model, its deployability, and its Active Learning state:

{
  "project": {
    "id": "abc123",
    "url": "my-project",
    "name": "My Project",
    "owner": "my-workspace-id",
    "type": "object-detection",
    "classes": ["cat", "dog"],
    "multilabel": false
  },
  "workflow": {
    "id": "wf_xyz",
    "name": "My Project Base Workflow",
    "url": "my-project-base-workflow",
    "workspaceUrl": "my-workspace",
    "inferencePath": "/infer/workflows/my-workspace/my-project-base-workflow"
  },
  "model": {
    "id": "rfdetr-medium",
    "kind": "pretrained",
    "displayName": "RF-DETR Medium",
    "modelId": "rfdetr-medium"
  },
  "deployability": {
    "status": "deployable",
    "modelWasConfigured": false,
    "selectedModelId": null,
    "selectionReason": null
  },
  "activeLearning": {
    "enabled": false,
    "collectionLimits": {
      "dataPercentage": 100,
      "minutelyUsageLimit": 10,
      "hourlyUsageLimit": 100,
      "dailyUsageLimit": 1000,
      "labelingBatchesRecreationFrequency": "daily",
      "usageQuotaName": "upload_quota_active_learning",
      "imageCompressionLevel": 95,
      "maxImageHeight": 1080,
      "maxImageWidth": 1920,
      "persistPredictions": true
    },
    "filters": []
  },
  "baseWorkflowWasCreated": false
}

model is null when no model is configured. deployability.status is "not_deployable" when the Workflow cannot serve inference. baseWorkflowWasCreated tells you whether this request created the base Workflow.

Select a Project Base Workflow Model

POST /:workspace/:project/deploy/model

Required scope: project:update

Set model.type to "model_id", "sam3", or "clip":

For "model_id", modelId is required. displayName and taskType are optional. For "sam3" and "clip", provide a non-empty classes array instead of modelId:

The response has the same shape as Get a Project Base Workflow. A 400 response means the model value is missing or invalid.

To enable data collection, set collection limits, or list images in the review queue, use the Active Learning HTTP API.

List Workflows

GET /:workspace/workflows

Lists all workflows in the workspace.

Query

Name
Type
Description
Required

api_key

string

API key for the workspace.

Example Request

Response

Required scope: workflow:read.

Get a Workflow

GET /:workspace/workflows/:workflowUrl

Returns the workflow's specification, metadata, and (for non-public workflows) authorization status.

Public workflows can be accessed without an api_key. Private workflows require the workflow:read scope.

List Workflow Versions

GET /:workspace/workflows/:workflowUrl/versions

Returns the versioned snapshots of the workflow specification.

Create a Workflow

POST /:workspace/createWorkflow

Headers

Name
Value

Content-Type

application/json

Body

Name
Type
Description
Required

api_key

string

Workspace API key.

name

string

Display name.

url

string

URL slug for the workflow.

config

string

JSON-encoded workflow specification (see note below).

template

string

JSON-encoded template metadata. Pass "{}" if you don't have one.

Note on config: the API expects the stored shape {"specification": {...}}. Passing a bare specification works through the SDK adapter, which auto-wraps it; for direct REST calls, wrap it yourself.

Example Request

You can also send the same fields as query parameters, but then template is required. Use the body for large specifications, since long URLs get cut off.

Response

Required scope: workflow:create.

Update a Workflow

POST /:workspace/updateWorkflow

Headers

Name
Value

Content-Type

application/json

Body

Name
Type
Description
Required

id

string

Workflow's internal ID.

name

string

Display name.

url

string

URL slug.

config

string

JSON-encoded workflow specification (see note on Create).

Required scope: workflow:update.

Fork a Workflow

POST /:workspace/forkWorkflow

Copy a workflow from another workspace into this one.

Body

Name
Type
Description
Required

source_workspace

string

Slug of the workspace that owns the source workflow.

source_workflow

string

URL slug of the source workflow.

name

string

Display name for the fork. Defaults to source name.

url

string

URL slug for the fork. Auto-generated if omitted.

Required scope: workflow:create.

Generate a Workflow Token

POST /:workspace/workflowToken

Generate a short-lived token suitable for executing a workflow from a public client (e.g. a browser).

Delete (soft-delete) a Workflow

DELETE /:workspace/workflows/:workflowUrl

Moves the workflow to Trash. See Manage Trash for the response shape and restore flow.

Run a Workflow

Workflow execution lives at https://serverless.roboflow.com, not the management API. See Run a Model on an Image and the product docs on deploying a workflow.

Python SDK

Roboflow Workflows are visual computer-vision pipelines. The SDK exposes list / get / create directly on Workspace; update, fork, and delete live in the low-level rfapi adapter.

List workflows

Get a workflow

The url argument is the workflow's slug (visible in the web app's URL bar) - not its Firestore id.

Create a workflow

Pass definition=None to create an empty workflow shell that you'll edit in the web app afterwards.

The SDK accepts either a bare specification dict ({"version": ..., "steps": ...}) or a wrapped one ({"specification": {...}}); it normalizes the wrapping for you and strips a UTF-8 BOM if present.

Update a workflow

Workspace doesn't expose update directly - use the low-level adapter:

Fork a workflow

Copy a workflow from another workspace into your own. Useful for adopting a public template:

List workflow versions

Delete (soft-delete) a workflow

This moves the workflow to the workspace Trash where it remains for 30 days before permanent cleanup. Restore via Workspace.restore_from_trash("workflow", id) - see Delete and Restore.

Run a workflow

Workflow execution lives in the Inference SDK and the Workflows runtime, not the roboflow package. From Python:

CLI

You can list, create, update, fork, and version workflows from the command line.

List Workflows

Get Workflow Details

Create a Workflow

With a JSON definition file:

Options

Flag
Description

--name

Workflow name (required)

--definition

Path to JSON definition file

--description

Workflow description

Update a Workflow

Update a workflow's definition:

List Workflow Versions

Fork a Workflow

Fork a workflow from the current workspace:

Fork from another workspace:

JSON Output

All workflow commands support --json for structured output:

Exit codes: 0 = success, 1 = error, 2 = auth error, 3 = not found.

Last updated

Was this helpful?