Skip to main content

Workflow Blocks

A workflow is a directed graph of blocks executed on supplied inputs, typically one image. The current engine does not provide a video source or temporal SAM tracking block.

Block source: lib/workflow_blocks/

Block categories​

FileCategoryExamples
detection.pyDetectionYOLO image inference
specialized.pySpecializedOCR, license-plate reader, line and zone counters
classical_cv.pyClassical CVGrayscale, contours, dominant color, resize
crop.pyCropDetection crops with optional padding
filter_block.pyFilterClass, confidence, and area filtering
io.pyI/OImage input, serialized output
llm.pyLLMText generation through the configured agent provider
logic.pyLogicConditional routing, expressions
platform.pyPlatformDataset image input, model selection, training trigger, webhook
visualization.pyVisualizationBounding boxes, blur, detection counts

Block contract​

Every block subclasses BlockBase from lib/workflow_blocks/base.py and declares:

  • input_ports and output_ports — Port metadata with names, type strings, and required flags
  • config — a configuration dictionary; _config_schema() describes editor controls
  • execute(inputs) -> BlockResult — returns output and metadata dictionaries

The engine in lib/workflow_engine.py validates node IDs, edges, port names/types, required inputs and cycles before executing nodes in topological order. A closed conditional branch or failed dependency skips downstream nodes. Port metadata and config schemas are not full runtime payload validation; failures remain visible in the workflow's errors list.

Saved workflows and resource-bearing blocks use the authenticated workspace. Model selection uses the owned model pool entry without replacing a global active engine. LLM blocks snapshot the workspace provider configuration for the run; see agent configuration. Graph JSON cannot supply provider credentials. Webhook destinations default to public addresses with redirects disabled; private networks require the operator's WALDO_WORKFLOW_ALLOW_PRIVATE_WEBHOOKS=1 override.

Editor​

The visual editor at /workflows/editor uses @xyflow/react for the canvas. The block palette is populated from GET /api/v1/workflows/blocks, so any new block class registered server-side appears automatically.