Run a Workflow
Preview, deploy, update, and stop a Workflow on a Cloud Streaming source, with clear version and sink behavior.
Run a Workflow on a connected source to turn live video into predictions, annotated video, and downstream actions. Choose a bounded preview when testing a draft, or a deployment when you want processing to continue without a viewer.
Use the quickstart for a complete first run. Processing uses credits for both previews and deployments.
Web App
Preview a draft
Open your saved Workflow, click "Run", and select a connected stream or a temporary webcam or phone session. The editor can have "Sinks" on: turn it off when the test must not write to external systems.

Deploy a published Workflow
Open "Deployments" → "Cloud Streaming", select the source, and choose "Run a Workflow", or start from "Use Workflow" → "Cloud Streaming" in the Workflow editor. Pick an image output under "Visual Preview Output" to get annotated video; a JSON-only Workflow runs without one but produces no video. Review the estimate and click "Start Processing".

The app can choose processing resources for the Workflow. The estimate is not a fixed cost for a continuous deployment; see pricing and limits.
Promote a running preview
When the app offers to deploy your running preview, review the billing confirmation and continue. The preview keeps running as a deployment, with no restart, and existing deployments on the source keep running too. See promotion for what it keeps and which previews qualify.

Apply Workflow changes
Publishing a Workflow does not change a running deployment. Publish, then restart the deployment, or stop it and start a new run. See restart behavior and restart controls.
Stop or replace a run
Click "Stop Processing", confirm, and wait for the job to stop. Closing the player or leaving the page does not stop a deployment or its charges. After replacing a deployment, check that the new job runs and the old one stopped: not every entry point cancels other jobs on the source.
Workflow lifecycle
A preview runs a draft for testing while you watch. A deployment runs a published Workflow continuously, with no viewer needed. Each action below decides which Workflow version runs and whether runtime state carries over.
Draft preview
The supplied draft snapshot
A separate bounded run. Agent previews disable sinks by default unless you explicitly enable them.
Persistent published assignment
The published revision pinned when the deployment is created
New runtime state and the published sink settings.
Promote preview
The exact running preview snapshot
Same execution and state. Disabled sinks stay disabled. No publication or restart.
Ordinary restart
The latest published revision
New execution with retained inputs/settings. Runtime state resets.
Unfinished paid-validation restart
The tested snapshot and configuration
New execution and validation progress. Use a new run for edits.
GPU memory retry
The failed snapshot
New execution on the selected resources. State resets.
Automatic recovery
The deployment's pinned snapshot
New execution generation. Stateful blocks reset; recovery can wait or become blocked.
Finite uploads and nonpersistent saved-Workflow jobs resolve the published configuration when claimed instead of using a persistent deployment's creation-time pin. Do not use those paths to infer continuous deployment version behavior.
Previews
A preview runs the draft without publishing it, and it can run beside a deployment on the same source. A newer preview of the same Workflow on a source can replace your earlier preview, but not a teammate's deployment. Previews stop when their owner or viewers go idle, when stopped, or after one hour. Temporary previews also end when their browser publisher disconnects. Do not use a preview for unattended production processing.
Deployments
A new deployment pins the Workflow's published version when it is created; unpublished editor changes do not run, and its inputs must match that version. Saving or publishing the Workflow later does not change the deployment until you restart it.
Promotion
Promotion turns a running preview into a deployment without restarting it. It keeps the exact running Workflow snapshot, parameters, allocation, outputs, runtime state, and sink settings, and billing continues at the current rate. It does not publish the draft, load a newer published version, or turn disabled sinks back on. It does not stop other jobs on the source, so check for existing deployments to avoid two runs where you wanted one.
You can promote a preview only when all of these are true:
You are the member who started it. API-key previews with no recorded member cannot be promoted in the app.
It uses a saved Workflow and a durable camera source. Temporary webcam and phone sessions cannot be promoted.
It has no stop, restart, or resource change in progress.
Restarts
A restart loads the latest published Workflow and starts a new execution with the same inputs and settings. Saving an unpublished draft is not enough. Trackers, counters, cooldown timers, and other in-memory state start fresh, and results have a gap while the old execution stops and the new one starts. Automatic recovery after that uses the newly pinned version.
Two cases keep the old snapshot instead:
Restarting a run whose paid background validation has not finished keeps the snapshot and settings under test and restarts validation. Start a new run to test different Workflow content or inputs. Once validation finishes and recovery is on, a restart uses the latest published version.
A retry on a larger GPU after a confirmed GPU memory failure keeps the failed snapshot, even after validation has finished.
Stopping
Stopping a job, ending a temporary session, disabling a camera, and deleting a source are different actions. To end processing, stop the job. Closing a player, leaving the page, disconnecting a viewer, unplugging a camera, or stopping its publisher does not stop a deployment or its charges: an enabled deployment with recovery waits and resumes when video returns. Automatic cleanup of an old preview does not stop a promoted deployment. Deleting or removing a camera is not a way to update its Workflow.
Agent assignment can replace the current deployment, while promotion leaves other jobs running. When you replace a deployment, check the new job and the old job's final state.
Roboflow Agent
Ask the Agent to select a source and preview your Workflow's draft. It can inspect the live result and help you iterate without changing the active deployment.

To keep an eligible preview running, explicitly ask to deploy that preview. The Agent uses promotion rather than publishing a different version. It should explain continuous processing and billing, including any sinks that remain disabled. The "Deploy Stream" action appears above the chat composer, outside the video player.
To start a different published Workflow, ask to deploy that saved Workflow to the camera. This is an assignment, not promotion. To apply the Agent's latest edits to an existing deployment, explicitly ask to update the deployment: that path publishes the matching draft and restarts processing, with a gap and reset runtime state.
Be specific when stopping: name the deployed Workflow or job you want stopped. "Disconnect the preview" ends a viewing or temporary-preview activity, not an unrelated continuous deployment.
HTTP API
Use a workspace API key for job creation, with video-inference-job:create, workflow:read, and model:infer. Read operations require video-inference-job:read; job control operations require their mutation scope. Device-bound and folder-bound credentials do not provide a workspace-wide job-control path. See API authentication.
Every API request is authenticated with your credential. The API has no restart, promotion, automatic sizing, or price-acknowledgment operations: use the Web App for those. Requests with app-only fields (ex: autoSize) are rejected.
Inspect Workflow inputs and outputs
Before you start a job, check what your saved Workflow needs and returns. Pass its URL slug as workflowUrl: the last part of its editor URL (ex: app.roboflow.com/YOUR_WORKSPACE/workflows/edit/YOUR_WORKFLOW_SLUG). In the response, outputs entries with isImage: true are image outputs: use one as imageOutput to get annotated video. parameters lists the non-image inputs to send in workflowParameters. If degraded is true, the list can be incomplete, so check the running job's output.
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.
Roboflow API key or OAuth access token.
Workspace URL slug.
The saved Workflow's URL slug: the last part of its editor URL (ex: app.roboflow.com/YOUR_WORKSPACE/workflows/edit/YOUR_WORKFLOW_SLUG).
YOUR_WORKFLOW_SLUGSuccessful response.
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.
The request is invalid.
Authentication is missing or invalid.
The credential does not have access to this resource.
The resource does not exist or is not accessible.
The request rate is too high.
A required upstream service is temporarily unavailable.
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 a job
Create one logical run with one idempotency key. Reuse that key only when retrying the same request after an uncertain response. Use a new key for a new run, even when the source, Workflow, and inputs are unchanged.
Send either workflowUrl to run a saved Workflow's published version, or workflowSpecification to run an inline specification as a snapshot. The schema below lists each field's default and allowed values. API previews do not automatically disable Workflow sinks: configure the specification's side effects deliberately before starting. Temporary sources accept previews only.
Set processorSize to choose a GPU. API jobs use the size you send, or Small (gpu-s-v1) if you send none. Unlike app starts, they are not sized from the Workflow and do not move to a larger GPU after a GPU memory error. A size does not guarantee a frame rate or immediate capacity.
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, device-bound keys and folder-scoped keys cannot start jobs. The same admitted API key supplies execution authority.
Roboflow API key or OAuth access token.
Workspace URL slug.
Cloud Streaming source ID from the source list.
^[^/\\]+$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.
run-warehouse-camera-001Pattern: ^[A-Za-z0-9._:-]+$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.
YOUR_WORKFLOW_SLUGDeclared 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.
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.
label_visualization_outputUploaded 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.
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.
Saved Workflow identifier associated with a draft preview. This is provenance, not permission to promote or automatically replace another preview.
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 and temporary sources 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.
Optional. Processing tier. The only documented value is gpu, which is also the default.
gpuPossible values: 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.
gpu-s-v1Possible values: 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.
15Optional 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.
rtsp_transport;tcpOptional capture queue depth. Null or omission uses the runtime default for the processing mode.
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.
^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$Compatibility field. External calls are always recorded as api, regardless of this value. Omit it.
Identical request replayed under the same key and credential; returns the original job.
New job created. Read its state before assuming processing has started.
Invalid or unknown field, conflicting Workflow fields, excessive specification/parameter size, invalid capture options, or incompatible source, lifetime, recovery or compute settings.
Authentication is missing or invalid.
Required scopes, eligible workspace credit standing or environment capability are missing, or an OAuth, folder-scoped or device-bound credential cannot start this job. Some access denials are hidden as 404.
The resource does not exist or is not accessible.
The idempotency key belongs to different parameters or credentials, the prior job is no longer available, or source/cell placement or capacity conflicts.
The request rate is too high.
A required upstream service is temporarily unavailable.
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
}
}Read jobs and wait for processing
Keep the returned job ID and read its state. A successful create is not proof that the model has loaded or that video is being processed. Wait until it runs or reaches a terminal state, with bounded polling and backoff on transient errors. Check errors rather than starting another job to work around an uncertain start.
Lists workspace job records. This route does not expose source, processor or execution credentials. It does not accept source or state filters. 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.
Roboflow API key or OAuth access token.
Workspace URL slug.
Successful response.
The request is invalid.
Authentication is missing or invalid.
The credential does not have access to this resource.
The resource does not exist or is not accessible.
The request rate is too high.
A required upstream service is temporarily unavailable.
GET /{workspace}/video-jobs/v1 HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"jobs": [
{
"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
}
]
}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.
Roboflow API key or OAuth access token.
Workspace URL slug.
Job ID.
^[^/\\]+$Successful response.
The request is invalid.
Authentication is missing or invalid.
The credential does not have access to this resource.
The resource does not exist or is not accessible.
The request rate is too high.
A required upstream service is temporarily unavailable.
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
}
}When running, consume video and results. A current job rate is not accumulated spend, and latest live output is not durable result history.
Hold a temporary preview
A temporary preview needs an active owner lease in addition to a publishing source. Renew the preview while your application owns it. Renewal does not revive an expired or terminal job, make a session persistent, or replace output watch renewal.
Extends an active temporary-source preview's owner lease to at least two minutes from now, including while queued. It never revives an expired or stopped job and cannot extend the one-hour preview maximum. Keep this lease renewed while the temporary preview is in use; a video watch is a separate lease. 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.
Roboflow API key or OAuth access token.
Workspace URL slug.
Job ID.
^[^/\\]+$Successful response.
True if renewed; false if the job is expired, stopping or terminal. Stop using an expired job rather than assuming it was revived.
This is not a preview job on a temporary source.
Authentication is missing or invalid.
The credential does not have access to this resource.
The resource does not exist or is not accessible.
The request rate is too high.
A required upstream service is temporarily unavailable.
POST /{workspace}/video-jobs/v1/{jobId}/hold-preview HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"held": true
}Stop a job
Request cancellation, then read the job until it reaches a terminal state. An active processor may need to observe the request before stopping. Explicit cancellation prevents the deployment from automatically recovering.
Requests an explicit stop. Persistent intent is disabled; queued jobs can be cancelled immediately. Active processors learn of cancellation through status updates, so the response is not a guarantee that shutdown has already finished. Re-read the job and any replacement identified by successorJobId. Repeating cancellation does not start a new job. 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.
Roboflow API key or OAuth access token.
Workspace URL slug.
Job ID.
^[^/\\]+$Successful response.
The request is invalid.
Authentication is missing or invalid.
The credential does not have access to this resource.
The resource does not exist or is not accessible.
The request rate is too high.
A required upstream service is temporarily unavailable.
POST /{workspace}/video-jobs/v1/{jobId}/cancel 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
}
}For a temporary camera, also stop its session when you want to end publishing rather than just one Workflow run.
Last updated
Was this helpful?