Expression¶
Class: ExpressionBlockV1
Source: inference.core.workflows.core_steps.formatters.expression.v1.ExpressionBlockV1
Creates specific output based on defined input variables and configured rules - which is useful while creating business logic in workflows.
Based on configuration, block takes input data, optionally performs operation on data, save it as variables and evaluate switch-case like statements to get the final result.
Type identifier¶
Use the following identifier in step "type"
field: roboflow_core/expression@v1
to add the block as
as step in your workflow.
Properties¶
Name | Type | Description | Refs |
---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
data_operations |
Dict[str, List[Union[ClassificationPropertyExtract, ConvertDictionaryToJSON, ConvertImageToBase64, ConvertImageToJPEG, DetectionsFilter, DetectionsOffset, DetectionsPropertyExtract, DetectionsRename, DetectionsSelection, DetectionsShift, DetectionsToDictionary, Divide, ExtractDetectionProperty, ExtractFrameMetadata, ExtractImageProperty, LookupTable, Multiply, NumberRound, NumericSequenceAggregate, PickDetectionsByParentClass, RandomNumber, SequenceAggregate, SequenceApply, SequenceElementsCount, SequenceLength, SequenceMap, SortDetections, StringMatches, StringSubSequence, StringToLowerCase, StringToUpperCase, TimestampToISOFormat, ToBoolean, ToNumber, ToString]]] |
UQL definitions of operations to be performed on defined data before switch-case instruction. | ❌ |
switch |
CasesDefinition |
Define the logic to be executed.. | ❌ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow
runtime. See Bindings for more info.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to Expression
in version v1
.
- inputs:
Crop Visualization
,SIFT
,Stitch OCR Detections
,Blur Visualization
,PTZ Tracking (ONVIF)
.md),Cache Set
,Property Definition
,Camera Focus
,Mask Visualization
,VLM as Classifier
,Object Detection Model
,Keypoint Detection Model
,Image Preprocessing
,Qwen2.5-VL
,Object Detection Model
,Bounding Rectangle
,Cache Get
,JSON Parser
,SmolVLM2
,LMM
,Polygon Zone Visualization
,QR Code Generator
,Size Measurement
,Florence-2 Model
,Moondream2
,Template Matching
,Label Visualization
,Pixel Color Count
,Segment Anything 2 Model
,Stability AI Image Generation
,Keypoint Detection Model
,Relative Static Crop
,Slack Notification
,Corner Visualization
,Multi-Label Classification Model
,Overlap Filter
,Image Blur
,Gaze Detection
,Model Comparison Visualization
,VLM as Detector
,Time in Zone
,Image Threshold
,Roboflow Dataset Upload
,CogVLM
,Byte Tracker
,Barcode Detection
,Single-Label Classification Model
,First Non Empty Or Default
,Polygon Visualization
,Stability AI Outpainting
,Keypoint Visualization
,Time in Zone
,Grid Visualization
,Delta Filter
,OpenAI
,Florence-2 Model
,Image Slicer
,Instance Segmentation Model
,Twilio SMS Notification
,Detections Stitch
,Identify Changes
,Continue If
,Dynamic Crop
,Anthropic Claude
,QR Code Detection
,Line Counter
,Line Counter
,Rate Limiter
,LMM For Classification
,Line Counter Visualization
,Color Visualization
,Image Contours
,Image Convert Grayscale
,Circle Visualization
,Google Gemini
,Data Aggregator
,Cosine Similarity
,Absolute Static Crop
,Expression
,Dynamic Zone
,Multi-Label Classification Model
,Environment Secrets Store
,Byte Tracker
,Detections Consensus
,Stitch Images
,Detections Filter
,Trace Visualization
,Roboflow Custom Metadata
,OCR Model
,Detections Transformation
,Clip Comparison
,YOLO-World Model
,CLIP Embedding Model
,Halo Visualization
,Perspective Correction
,Buffer
,Stability AI Inpainting
,Velocity
,Webhook Sink
,Distance Measurement
,VLM as Detector
,Perception Encoder Embedding Model
,Triangle Visualization
,Background Color Visualization
,Detections Stabilizer
,Byte Tracker
,Path Deviation
,Icon Visualization
,SIFT Comparison
,Pixelate Visualization
,CSV Formatter
,Instance Segmentation Model
,Llama 3.2 Vision
,Google Vision OCR
,Reference Path Visualization
,VLM as Classifier
,Image Slicer
,Identify Outliers
,Depth Estimation
,Roboflow Dataset Upload
,Detection Offset
,OpenAI
,Classification Label Visualization
,Dot Visualization
,Email Notification
,Local File Sink
,OpenAI
,Single-Label Classification Model
,Bounding Box Visualization
,Camera Calibration
,Detections Classes Replacement
,Ellipse Visualization
,Detections Merge
,Path Deviation
,Model Monitoring Inference Aggregator
,Dimension Collapse
,SIFT Comparison
,Dominant Color
,Clip Comparison
- outputs:
Crop Visualization
,Stitch OCR Detections
,SIFT
,Blur Visualization
,PTZ Tracking (ONVIF)
.md),Cache Set
,Property Definition
,Camera Focus
,Mask Visualization
,VLM as Classifier
,Object Detection Model
,Keypoint Detection Model
,Image Preprocessing
,Qwen2.5-VL
,Object Detection Model
,Bounding Rectangle
,Cache Get
,JSON Parser
,SmolVLM2
,Polygon Zone Visualization
,LMM
,QR Code Generator
,Size Measurement
,Florence-2 Model
,Moondream2
,Template Matching
,Label Visualization
,Pixel Color Count
,Segment Anything 2 Model
,Stability AI Image Generation
,Keypoint Detection Model
,Slack Notification
,Relative Static Crop
,Corner Visualization
,Multi-Label Classification Model
,Overlap Filter
,Image Blur
,Gaze Detection
,Model Comparison Visualization
,VLM as Detector
,Time in Zone
,Image Threshold
,Roboflow Dataset Upload
,CogVLM
,Byte Tracker
,Barcode Detection
,Single-Label Classification Model
,First Non Empty Or Default
,Polygon Visualization
,Keypoint Visualization
,Stability AI Outpainting
,Time in Zone
,Grid Visualization
,Delta Filter
,OpenAI
,Florence-2 Model
,Image Slicer
,Instance Segmentation Model
,Twilio SMS Notification
,Detections Stitch
,Identify Changes
,Continue If
,Dynamic Crop
,Anthropic Claude
,QR Code Detection
,Line Counter
,Line Counter
,LMM For Classification
,Rate Limiter
,Line Counter Visualization
,Color Visualization
,Image Contours
,Image Convert Grayscale
,Circle Visualization
,Data Aggregator
,Google Gemini
,Cosine Similarity
,Absolute Static Crop
,Expression
,Multi-Label Classification Model
,Dynamic Zone
,Byte Tracker
,Detections Consensus
,Stitch Images
,Trace Visualization
,Detections Filter
,Roboflow Custom Metadata
,OCR Model
,Detections Transformation
,Clip Comparison
,YOLO-World Model
,CLIP Embedding Model
,Halo Visualization
,Perspective Correction
,Stability AI Inpainting
,Buffer
,Velocity
,Webhook Sink
,Distance Measurement
,VLM as Detector
,Perception Encoder Embedding Model
,Triangle Visualization
,Background Color Visualization
,Detections Stabilizer
,Byte Tracker
,Path Deviation
,Icon Visualization
,SIFT Comparison
,Pixelate Visualization
,Llama 3.2 Vision
,Instance Segmentation Model
,CSV Formatter
,VLM as Classifier
,Google Vision OCR
,Reference Path Visualization
,Image Slicer
,Identify Outliers
,Depth Estimation
,Roboflow Dataset Upload
,Detection Offset
,OpenAI
,Classification Label Visualization
,Dot Visualization
,Email Notification
,Local File Sink
,OpenAI
,Single-Label Classification Model
,Bounding Box Visualization
,Camera Calibration
,Detections Classes Replacement
,Ellipse Visualization
,Detections Merge
,Path Deviation
,Model Monitoring Inference Aggregator
,Dimension Collapse
,SIFT Comparison
,Dominant Color
,Clip Comparison
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Expression
in version v1
has.
Bindings
Example JSON definition of step Expression
in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/expression@v1",
"data": {
"predictions": "$steps.model.predictions",
"reference": "$inputs.reference_class_names"
},
"data_operations": {
"predictions": [
{
"property_name": "class_name",
"type": "DetectionsPropertyExtract"
}
]
},
"switch": {
"cases": [
{
"condition": {
"statements": [
{
"comparator": {
"type": "=="
},
"left_operand": {
"operand_name": "class_name",
"type": "DynamicOperand"
},
"right_operand": {
"operand_name": "reference",
"type": "DynamicOperand"
},
"type": "BinaryStatement"
}
],
"type": "StatementGroup"
},
"result": {
"type": "StaticCaseResult",
"value": "PASS"
},
"type": "CaseDefinition"
}
],
"default": {
"type": "StaticCaseResult",
"value": "FAIL"
},
"type": "CasesDefinition"
}
}