This is the strongest integration reference in the repository for running Roboflow Workflows against live DepthAI camera frames with a custom frontend. Use it when you need a standalone-only frontend/backend app where external inference owns the detections and the local backend owns stream delivery, schema probing, and frontend parameter updates.
- You need a custom frontend around Roboflow Workflow inference.
- You want runtime updates to Roboflow credentials, workflow identity, or workflow parameters from the UI.
- You need a reference for adapting arbitrary Roboflow workflow outputs into DepthAI topics.
- You want an app-shaped standalone example rather than a simple integration script.
- You need a peripheral-mode custom frontend example.
- You need dataset export rather than live workflow inference.
- You need a device-side NN baseline with repo-local models.
Category:integrations/roboflow-workflowShape:frontendPrimary task:run Roboflow Workflow inference on live DepthAI frames and surface outputs in a custom frontendEntrypoint:backend/src/main.pyStandalone path:backend-run.sh and oakapp.tomlFrontend:frontend/src/App.tsxRuns on:documented as RVC4 standalone onlyRequires:valid Roboflow workflow config in backend/src/config/yaml_configs/config.yaml, Python 3.11 runtime, theinferencepackage, and static frontend assetsInput:live camera frames from the device plus optional parameter-update payloads from the frontendOutput:passthroughplus any workflow-derived*visualization*or*predictions*topics that the schema exposesModels:external Roboflow Workflow models, not repo-local model YAMLsVisualizer / UI:custom frontend built on@luxonis/depthai-viewer-common
- README.md: workflow setup expectations and naming rules
- backend/src/main.py: startup order, service registration, and shutdown flow
- backend/src/config/config.py: config schema and load path
- backend/src/config/yaml_configs/config.yaml: initial Roboflow and pipeline configuration
- backend/src/core/depthai_pipeline.py: local camera pipeline and generator-backed capture bridge
- backend/src/core/annotation_node.py: workflow-output parsing and topic creation
- backend/src/core/manager.py: runtime update service and rebuild logic
- backend/src/core/roboflow_runner.py: Roboflow
InferencePipelinewrapper and schema probe - backend/src/core/visualizer_wrapper.py: topic/service wrapper around
dai.RemoteConnection - frontend/src/App.tsx: UI shell and stream layout
- frontend/src/MessageInput.tsx: runtime parameter update form
- oakapp.toml: backend service entrypoint and static frontend build path
- Backend startup loads backend/src/config/yaml_configs/config.yaml into a Pydantic config object.
RoboflowRunnerwrapsInferencePipeline.init_with_workflow(...).- Before the live app starts,
probe_workflow_schema()runs the workflow once on dummy frames to discover the output schema. DepthAIPipelinecreates a local camera pipeline, registers topics based on the probed schema, and monkey-patchescv2.VideoCaptureso Roboflow reads frames from a generator backed by DepthAI.AnnotationNodeclassifies Roboflow outputs by name:- keys containing
visualizationbecome image topics - keys containing
predictionsbecome detection topics - everything else is ignored
- keys containing
RoboflowManagerregisters theRoboflow Parameter Update Serviceand decides whether an update only restarts the Roboflow runner or fully rebuilds the DepthAI pipeline and topics.- The frontend renders
Streamsand posts update payloads back to the backend service.
DepthAI camera -> DepthAIPipeline queue -> generator-backed cv2.VideoCapture -> Roboflow InferencePipelineRoboflow prediction callback -> AnnotationNode.on_prediction() -> passthrough/image/detection topicstopics -> VisualizerWrapper -> frontend Streams viewfrontend form -> Roboflow Parameter Update Service -> RoboflowManager -> runner restart or full pipeline rebuild
Safe to change:frontend copy/layout, service success/error UX, initial config values, topic labels exposed from the backendRequires care:schema-probe behavior, monkey-patchedcv2.VideoCapture, naming-based output parsing, and the restart-versus-rebuild distinction in backend/src/core/manager.pyLikely to break if changed blindly:workflow output naming, service payload shape between frontend/src/MessageInput.tsx and backend/src/core/manager.py, or the static frontend build path in oakapp.toml
To support additional workflow output types:extend backend/src/core/annotation_node.pyTo make pipeline settings updateable from the UI:extend frontend/src/MessageInput.tsx, backend/src/core/manager.py, and the config model in backend/src/config/config.pyTo reuse only the backend workflow bridge:keep backend/src/core/ and replace the frontend with another service clientTo step down to a smaller frontend/backend baseline:compare with custom-frontend/raw-stream
- This example is documented and packaged as RVC4 standalone only.
- Workflow outputs whose names contain neither
visualizationnorpredictionsare ignored by the backend. - The current frontend/backend update path only supports
api_key,workspace_name,workflow_id, andworkflow_parameters; it does not updatedevice,output_size, orfps. - The backend intentionally runs on Python
3.11, as noted in the README, because of dependency constraints around the inference stack.
DepthAIPipeline.start()temporarily monkey-patchescv2.VideoCaptureso the Roboflow inference package reads DepthAI frames as if they were a normal video source.- If only workflow parameters change, backend/src/core/manager.py restarts just the Roboflow runner; if the workflow identity or credentials change, it rebuilds the full DepthAI topic surface.
passthroughis always present as a local topic because backend/src/core/annotation_node.py seedsoutput_frameswith that key.- The frontend’s service name must stay aligned with the backend registration string
Roboflow Parameter Update Service.
- integrations/roboflow-dataset: use this when Roboflow is the dataset sink instead of the inference engine
- custom-frontend/raw-stream: use this when you need a much smaller frontend/backend baseline
- custom-frontend/open-vocabulary-object-detection: use this when you need another standalone custom frontend with richer backend-owned inference state
- apps/default-app: use this when you want a packaged app baseline with repo-local inference instead of external workflows
Run:populate backend/src/config/yaml_configs/config.yaml, then runoakctl app run .Success looks like:the frontend loads,passthroughplus recognized workflow outputs appear as streams/topics, and submitting the form updates Roboflow workflow settings without breaking the connectionCommon failure meaning:the initial Roboflow config is invalid, the workflow output names do not match the backend naming rules, the frontend/backend service contract drifted, or the current static frontend build path issues in oakapp.toml and frontend/package.json were not accounted for