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

Cloud Streaming Quickstart

Connect one camera, start cloud processing for an object detection Workflow, and view its results in the Web App, the Roboflow Agent, or the HTTP API.

Connect one camera and run a Workflow that detects objects and draws its predictions. Follow the Web App, Roboflow Agent, or HTTP API steps.

Before you start

You need a Roboflow workspace with credits for processing and a camera to connect. For an RTSP or USB camera, keep a computer running on the camera's network with the Video Connector installed. The connector must reach the camera and the internet.

Create and save a Workflow with:

  • One image input.

  • An Object Detection Model block named model, using a model your workspace can run (ex: rfdetr-nano).

  • A Bounding Box Visualization block that receives the input image and model predictions.

  • A predictions output and an image output from the visualization block, named bounding_box_visualization for this guide.

Test the Workflow on video before you point it at a live camera. Put a short video of a scene the model recognizes in a folder and start the connector with --files-dir to loop the file as a live source. The file appears as a source you can run the Workflow on.

In the editor's run panel, "Enable Sinks" starts on. Turn it off while testing unless you want the Workflow to write to outside systems.

Publish the Workflow before you deploy it. A preview can run unpublished changes.

Web App

Connect the camera

Cloud Streaming source list with offline sources and Add Video Source.
Open Cloud Streaming to view sources and add a camera. Sources in this example are offline.
  1. Open "Deployments", then "Cloud Streaming".

  2. Click "Add Video Source", then "Connect a Camera".

  3. Follow "Run the Connector" on a computer that can reach your camera. Keep the command's API key private.

  4. Wait for "Confirm It's Connected" to show the connector online, then click "Done".

  5. Select the camera from the source list. For a network camera, add its RTSP URL or choose an ONVIF profile. USB cameras appear automatically on supported platforms.

Connector setup dialog with its API key redacted and a successful connection.
Run the connector and wait for the connection confirmation.

Confirm that the source preview shows the intended camera. A thumbnail can be an older still, so do not use the thumbnail alone to confirm live video.

Start processing

  1. Open the source and choose "Run a Workflow".

  2. Select your saved Workflow under "Workflow".

  3. Set the Workflow's options, if the form shows them. Fill required "Workflow Inputs" and leave optional ones blank to use their defaults. "Visual Preview Output" selects the first image output; choose bounding_box_visualization if the Workflow has more than one.

  4. Review the processing estimate and any confirmation shown, then click "Start Processing".

Run a Workflow panel with a selected Workflow, visual output and Start Processing.
Choose your Workflow and image output before starting. Output names and pricing in this example are illustrative.

The app picks a GPU size from the Workflow's models. If the Workflow needs more GPU memory than that size has, the app moves it to a larger GPU automatically and the hourly rate changes to match. Starting can take time while a processor loads the model. The estimate is an hourly rate, not a fixed total. See pricing and limits.

Check the result

The source page shows the input and Workflow output. Check that boxes appear on the expected objects. Use the processing metrics to inspect performance, "Latest Result" for the newest structured output, and "Activity" for lifecycle events.

Running Workflow with annotated video and Latest Result.
Compare input video with annotated output and inspect Latest Result. Displayed pricing is illustrative.

An image output is needed for annotated video, but not for a JSON-only Workflow. See consume results for output delivery and external integrations.

The run keeps processing after you leave the page or close the player. See manage and monitor to track your runs.

Start from the Workflow editor

You can also click "Deploy" in the Workflow editor (or "Use" when you open the Workflow in the Agent), choose "Cloud Streaming", and pick a connected source. This leads to the same flow.

To test unpublished changes instead, click "Run" in the editor and select a stream. This runs your changes for a short time, and any running deployment keeps going. Review Workflow lifecycle before making that preview continuous.

Roboflow Agent

  1. Open the Agent and ask: "Help me connect a camera and preview my object detection Workflow."

  2. Choose an existing camera, or use "Network Streams" to set up the connector. For a short test without a connector, choose "Webcam" or "Phone" and complete the camera or QR setup.

  3. Ask the Agent to preview your saved Workflow's draft on the selected camera. Check the video and predictions. A preview does not replace the current deployment.

  4. For a camera connected through the connector or RTMP, click "Deploy Stream" above the chat box, or ask: "Deploy this running preview continuously." Review the price and confirm. The deployment keeps the exact Workflow, state, and sink settings from the preview. It does not publish your draft or turn disabled sinks back on.

A browser webcam or phone QR session cannot be promoted. Keep the controlling browser open while using a temporary preview. For continuous use, connect a camera through the connector or RTMP instead. If you only ask to disconnect a preview, a separate deployment keeps running.

HTTP API

Use a workspace API key with the video-inference-job:create, video-inference-job:read, workflow:read, and model:infer scopes. See API authentication. Your workspace and Workflow slugs are in the Workflow editor's URL: app.roboflow.com/YOUR_WORKSPACE/workflows/edit/YOUR_WORKFLOW_SLUG.

Find the source

List your sources and copy the id of a camera whose status is connected.

List Cloud Streaming sources

get

Lists registered sources without stream credentials. Temporary sessions are excluded unless requested. The response contains sources only, not jobs or a webcam-availability flag. Requires video-inference-job:read. Use a workspace API key or OAuth access token for the workspace in the path. Device-bound keys are not accepted.

Authorizations
AuthorizationstringRequired

Roboflow API key or OAuth access token.

Path parameters
workspacestringRequired

Workspace URL slug.

Query parameters
includeTemporarybooleanOptional

Include workspace temporary sessions.

Default: false
Responses
200

Successful response.

application/json
get/{workspace}/video-sources/v1
GET /{workspace}/video-sources/v1 HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "sources": [
    {
      "id": "SOURCE_ID",
      "workspace": "WORKSPACE_ID",
      "kind": "usb",
      "name": "Warehouse camera",
      "status": "connected",
      "availableProcessorSizes": [
        "gpu-s-v1",
        "gpu-m-v1",
        "gpu-l-v1"
      ],
      "persistentWorkflowsAvailable": true
    }
  ]
}

Check the Workflow's inputs and outputs

Pick an output with isImage: true (ex: bounding_box_visualization) to get annotated video. Set other inputs with workflowParameters. The camera supplies the image input.

Inspect a Workflow interface

get

Inspect a saved Workflow before selecting imageOutput and workflowParameters. This does not start processing. Requires video-inference-job:read. Use a workspace API key or OAuth access token for the workspace in the path. Device-bound keys are not accepted.

Authorizations
AuthorizationstringRequired

Roboflow API key or OAuth access token.

Path parameters
workspacestringRequired

Workspace URL slug.

Query parameters
workflowUrlstring · min: 1Required

The saved Workflow's URL slug: the last part of its editor URL (ex: app.roboflow.com/YOUR_WORKSPACE/workflows/edit/YOUR_WORKFLOW_SLUG).

Example: YOUR_WORKFLOW_SLUG
Responses
200

Successful response.

application/json
degradedbooleanRequired

True when static analysis was used because interface discovery failed. In that case, isImage=false is not proof that the output is not an image.

get/{workspace}/video-sources/v1/workflow-interface
GET /{workspace}/video-sources/v1/workflow-interface?workflowUrl=YOUR_WORKFLOW_SLUG HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "outputs": [
    {
      "name": "label_visualization_output",
      "kinds": [
        "image"
      ],
      "isImage": true
    }
  ],
  "degraded": false,
  "parameters": []
}

Start the job

Send a new Idempotency-Key for each run. With only workflowUrl, the job is a deployment on a Small GPU that keeps running after your script exits. Add processorSize for heavier models (see GPU sizes).

Start a Workflow job

post

Starts metered processing. Send a new Idempotency-Key for one intentional run; retry uncertain responses with the same key, body and API key. Different keys can create separate billable jobs. A successful start can be queued or waiting, not yet running. API requests (authenticated with your API key) use the processorSize you send, or the default profile. The app's automatic sizing, automatic resizing and priced validation are not available through this API. Requires a workspace API key with video-inference-job:create, workflow:read and model:infer. OAuth access tokens and device-bound keys cannot start jobs. A folder-scoped key can start jobs only on sources in its folders, and only with recoveryPolicy none. The same admitted API key supplies execution authority.

Authorizations
AuthorizationstringRequired

Roboflow API key or OAuth access token.

Path parameters
workspacestringRequired

Workspace URL slug.

sourceIdstring · min: 1 · max: 256Required

Cloud Streaming source ID from the source list.

Pattern: ^[^/\\]+$
Header parameters
Idempotency-Keystring · min: 8 · max: 128Required

A unique key for one start attempt. Reuse the same key, request and credential after a lost response. Use a new key only for a new attempt.

Example: run-warehouse-camera-001Pattern: ^[A-Za-z0-9._:-]+$
Body
workflowUrlstring · min: 1 · max: 512Optional

Required unless you send workflowSpecification. The saved Workflow's URL slug in this workspace: the last part of its editor URL (ex: app.roboflow.com/YOUR_WORKSPACE/workflows/edit/YOUR_WORKFLOW_SLUG). The job runs the Workflow's published version. Send either workflowUrl or workflowSpecification, not both.

Example: YOUR_WORKFLOW_SLUG
workflowParametersobject · nullableOptional

Declared non-image inputs, fixed for this job's lifetime. Maximum JSON-encoded UTF-8 size: 256 KiB. Image inputs come from the source. Inspect workflow-interface for declared names and defaults. Job records expose only these key names, not the values.

imageOutputstring · min: 1 · max: 256 · nullableOptional

Optional. Name of the Workflow image output to publish when watched (ex: label_visualization_output). Find it with Inspect a Workflow interface. Null or omission leaves the default selection to the runtime. A JSON-only Workflow does not need an image output.

Example: label_visualization_output
modestring · enumOptional

Uploaded sources default to batch, processing every frame in order as fast as inference allows. stream uses real-time pacing and can drop frames under load. Non-uploaded sources always use stream, even if batch is requested.

Possible values:
purposestring · enumOptional

Optional. deployment keeps processing without a viewer until you stop it. preview is a bounded test run: it never recovers, ends when idle, and stops after one hour. Default: deployment for durable sources, preview for temporary sources. A temporary source accepts only preview. API-created previews cannot be promoted in the app.

Possible values:
previewWorkflowIdstring · min: 1 · max: 128 · nullableOptional

Saved Workflow identifier associated with a draft preview. This is provenance, not permission to promote or automatically replace another preview.

recoveryPolicystring · enumOptional

Optional. always makes a deployment wait and resume automatically after an interruption (ex: the source goes offline). none ends the job instead. Default: always for deployments on durable live sources where recovery is enabled, otherwise none. Uploaded files, temporary sources and jobs started with a folder-scoped key do not recover. A preview requires none. A persistent saved Workflow pins its published specification when created; nonpersistent saved Workflows resolve it at claim time.

Possible values:
tierstring · enumOptional

Optional. Processing tier. The only documented value is gpu, which is also the default.

Default: gpuPossible values:
processorSizestring · enumOptional

Optional. GPU profile: gpu-s-v1 (Small, 4 GiB GPU memory), gpu-m-v1 (Medium, 8 GiB) or gpu-l-v1 (Large, 16 GiB). Pick a larger profile for heavier Workflows; larger profiles cost more per hour. Default: gpu-s-v1 (Small). The source record's availableProcessorSizes lists the profiles you can use. API-created jobs are not sized from the Workflow and do not move to a larger profile after a GPU memory error, so send an explicit size. Availability can vary by source and cell.

Example: gpu-s-v1Possible values:
maxFpsnumber · max: 240 · nullableOptional

Optional. Processing rate cap in frames per second, greater than 0 and at most 240. Default: null, which adds no job-specific cap. This is not a throughput guarantee.

Example: 15
captureOptionsstring · min: 1 · max: 512 · nullableOptional

Optional ingest tuning in key;value|key;value format. Keys: rtsp_transport, buffer_size, max_delay, reorder_queue_size, stimeout, timeout, probesize, analyzeduration, fflags, flags. Each value contains 1-64 letters, digits, underscores, plus signs, dots or hyphens. Null uses runtime defaults.

Example: rtsp_transport;tcp
captureBufferSizeinteger · min: 1 · max: 1024 · nullableOptional

Optional capture queue depth. Null or omission uses the runtime default for the processing mode.

cellstring · nullableOptional

Optional processing cell allowed for this workspace and source. Omit it for server placement; do not infer a cell from a connector download host. An active or fixed source cannot move freely between cells.

Pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$
processingEntrySurfacestring · enumOptional

Compatibility field. External calls are always recorded as api, regardless of this value. Omit it.

Possible values:
Responses
200

Identical request replayed under the same key and credential; returns the original job.

application/json
post/{workspace}/video-sources/v1/{sourceId}/jobs
POST /{workspace}/video-sources/v1/{sourceId}/jobs HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Idempotency-Key: text
Content-Type: application/json
Accept: */*
Content-Length: 180

{
  "workflowUrl": "YOUR_WORKFLOW_SLUG",
  "imageOutput": "label_visualization_output",
  "purpose": "deployment",
  "recoveryPolicy": "always",
  "tier": "gpu",
  "processorSize": "gpu-s-v1",
  "maxFps": 15
}
{
  "job": {
    "id": "JOB_ID",
    "sourceId": "SOURCE_ID",
    "state": "running",
    "purpose": "deployment",
    "mode": "stream",
    "tier": "gpu",
    "processorSize": "gpu-s-v1",
    "workflowUrl": "YOUR_WORKFLOW_SLUG",
    "imageOutput": "label_visualization_output",
    "executionGeneration": 1,
    "cancelRequested": false
  }
}

Check the job

Read the job until state is running.

Get a Workflow job

get

Read the current job without changing its state. Follow executionGeneration and successorJobId when observing replacement executions. A persistent waiting or blocked job still represents enabled intent until explicitly cancelled. Requires video-inference-job:read. Use a workspace API key or OAuth access token for the workspace in the path. Device-bound keys are not accepted.

Authorizations
AuthorizationstringRequired

Roboflow API key or OAuth access token.

Path parameters
workspacestringRequired

Workspace URL slug.

jobIdstring · min: 1 · max: 256Required

Job ID.

Pattern: ^[^/\\]+$
Responses
200

Successful response.

application/json
get/{workspace}/video-jobs/v1/{jobId}
GET /{workspace}/video-jobs/v1/{jobId} HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "job": {
    "id": "JOB_ID",
    "sourceId": "SOURCE_ID",
    "state": "running",
    "purpose": "deployment",
    "mode": "stream",
    "tier": "gpu",
    "processorSize": "gpu-s-v1",
    "workflowUrl": "YOUR_WORKFLOW_SLUG",
    "imageOutput": "label_visualization_output",
    "executionGeneration": 1,
    "cancelRequested": false
  }
}

Get the results

Request a watch grant for the image output and open whepUrl in a WHEP-compatible player. Repeat the request every 30 seconds while you watch. Keep these URLs private.

Watch annotated Workflow output

post

Requests publication for at least 60 seconds on a claimed or running job. Renew at least every 30 seconds while viewing; renewal never shortens the lease. One image output is selected for the whole job, so another viewer's output selection changes every viewer's stream. Request a fresh grant after a new execution; match executionGeneration when provided. This does not create durable frame history. Requires video-inference-job:create. Use a workspace API key or OAuth access token for the workspace in the path. Device-bound and folder-scoped credentials are not accepted.

Authorizations
AuthorizationstringRequired

Roboflow API key or OAuth access token.

Path parameters
workspacestringRequired

Workspace URL slug.

jobIdstring · min: 1 · max: 256Required

Job ID.

Pattern: ^[^/\\]+$
Body
outputstring · min: 1 · max: 256 · nullableOptional

Name of a Workflow image output, without a selector prefix. Null or omission uses the job's default selection.

Example: label_visualization_output
Responses
200

Successful response.

application/json
executionGenerationintegerOptional

Generation associated with this grant, when present on the job. Match it to the current job and request a fresh grant after execution changes.

whepUrlstring · uriRequired

Credentialed WHEP URL for annotated output. Use unchanged; do not log, persist or share it.

rtspsUrlstring · nullableRequired

Credentialed RTSPS URL for the same output, or null when the cell has no public RTSPS listener.

processorAccessTokenstringRequired

Opaque execution-scoped credential. It changes on a new claim. Do not log, persist or share it. Its presence does not establish a public processor polling contract.

post/{workspace}/video-jobs/v1/{jobId}/watch
POST /{workspace}/video-jobs/v1/{jobId}/watch HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 39

{
  "output": "label_visualization_output"
}
{
  "watch": {
    "requestedUntil": 1800000060000,
    "output": "label_visualization_output"
  },
  "executionGeneration": 1,
  "whepUrl": "https://relay.example.invalid/out-JOB_ID-g1/whep?key=JOB_READ_GRANT",
  "rtspsUrl": null,
  "processorAccessToken": "EXECUTION_SCOPED_TOKEN"
}

To send predictions to your own application, add a Webhook Sink to the Workflow.

Last updated

Was this helpful?