Roboflow Custom Metadata¶
Class: RoboflowCustomMetadataBlockV1
Source: inference.core.workflows.core_steps.sinks.roboflow.custom_metadata.v1.RoboflowCustomMetadataBlockV1
Attach custom metadata fields to inference results in the Roboflow Model Monitoring dashboard by extracting inference IDs from predictions and adding name-value pairs that enable filtering, analysis, and organization of inference data for monitoring workflows, production analytics, and model performance tracking.
How This Block Works¶
This block adds custom metadata to inference results stored in Roboflow Model Monitoring, allowing you to attach contextual information to predictions for filtering and analysis. The block:
- Receives model predictions and metadata configuration:
- Takes predictions from any supported model type (object detection, instance segmentation, keypoint detection, or classification)
- Receives field name and field value for the custom metadata to attach
- Accepts fire-and-forget flag for execution mode
- Validates Roboflow API key:
- Checks that a valid Roboflow API key is available (required for API access)
- Raises an error if API key is missing with instructions on how to retrieve one
- Extracts inference IDs from predictions:
- For supervision Detections objects: extracts inference IDs from the data dictionary
- For classification predictions: extracts inference ID from the prediction dictionary
- Collects all unique inference IDs that need metadata attached
- Handles cases where no inference IDs are found (returns error message)
- Retrieves workspace information:
- Gets workspace ID from Roboflow API using the provided API key
- Uses caching (15-minute expiration) to avoid repeated API calls for workspace lookup
- Caches workspace name using MD5 hash of API key as cache key
- Adds custom metadata via API:
- Calls Roboflow API to attach custom metadata field to each inference ID
- Associates the field name and field value with the inference results
- Metadata becomes available in the Model Monitoring dashboard for filtering and analysis
- Executes synchronously or asynchronously:
- Asynchronous mode (fire_and_forget=True): Submits task to background thread pool or FastAPI background tasks, allowing workflow to continue without waiting for API call to complete
- Synchronous mode (fire_and_forget=False): Waits for API call to complete and returns immediate status, useful for debugging and error handling
- Returns status information:
- Outputs error_status indicating success (False) or failure (True)
- Outputs message with upload status or error details
- Provides feedback on whether metadata was successfully attached
The block enables attaching custom metadata to inference results, making it easier to filter and analyze predictions in the Model Monitoring dashboard. For example, you can attach location labels, quality scores, processing flags, or any other contextual information that helps organize and analyze your inference data.
Common Use Cases¶
- Location-Based Filtering: Attach location metadata to inferences for geographic analysis and filtering (e.g., tag inferences with location labels like "toronto", "warehouse_a", "production_line_1"), enabling location-based monitoring workflows
- Quality Control Tagging: Attach quality or validation metadata to inferences for quality tracking (e.g., tag inferences as "pass", "fail", "requires_review", "approved"), enabling quality control workflows
- Contextual Annotation: Add contextual information to inferences for better organization and analysis (e.g., tag with camera ID, time period, batch number, operator ID, environmental conditions), enabling contextual analysis workflows
- Classification Enhancement: Attach custom labels or categories to inference results beyond model predictions (e.g., tag with business logic outcomes, workflow decisions, user feedback, manual corrections), enabling enhanced classification workflows
- Production Analytics: Track production metrics by attaching metadata that represents operational context (e.g., tag with shift information, production batch, equipment status, performance metrics), enabling production analytics workflows
- Filtering and Segmentation: Enable advanced filtering in Model Monitoring dashboard by attaching metadata that represents data segments (e.g., tag with customer segment, product category, use case type, deployment environment), enabling segmentation workflows
Connecting to Other Blocks¶
This block receives predictions and outputs status information:
- After model blocks (Object Detection Model, Instance Segmentation Model, Classification Model, Keypoint Detection Model) to attach metadata to inference results (e.g., add location tags to detections, attach quality labels to classifications, tag keypoint detections with context), enabling model-to-metadata workflows
- After filtering or analytics blocks (DetectionsFilter, ContinueIf, OverlapFilter) to tag filtered or analyzed results with metadata (e.g., tag filtered detections with filter criteria, attach analytics results as metadata, label processed results with workflow state), enabling analysis-to-metadata workflows
- After conditional execution blocks (ContinueIf, Expression) to attach metadata based on workflow decisions (e.g., tag with decision outcomes, attach conditional branch labels, mark results based on conditions), enabling conditional-to-metadata workflows
- In parallel with other sink blocks to combine metadata tagging with other data storage operations (e.g., tag while uploading to dataset, attach metadata while logging, combine with webhook notifications), enabling parallel sink workflows
- Before or after visualization blocks to ensure metadata is attached before or after visualization operations (e.g., tag visualizations with context, attach metadata to visualized results), enabling visualization workflows with metadata
- At workflow endpoints to ensure all inference results are tagged with metadata before workflow completion (e.g., final metadata attachment, comprehensive result tagging, complete metadata coverage), enabling end-to-end metadata workflows
Requirements¶
This block requires a valid Roboflow API key configured in the environment or workflow configuration. The API key is required to authenticate with Roboflow API and access Model Monitoring features. Visit https://docs.roboflow.com/api-reference/authentication#retrieve-an-api-key to learn how to retrieve an API key. The block requires predictions that contain inference IDs (predictions must have been generated by models that include inference IDs). Supported prediction types: object detection, instance segmentation, keypoint detection, and classification. The block uses workspace caching (15-minute expiration) to optimize API calls. For more information on Model Monitoring at Roboflow, see https://docs.roboflow.com/deploy/model-monitoring.
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/roboflow_custom_metadata@v1to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
field_name |
str |
Name of the custom metadata field to create in Roboflow Model Monitoring. This becomes the field name that can be used for filtering and analysis in the Model Monitoring dashboard. Field names should be descriptive and represent the type of metadata being attached (e.g., 'location', 'quality', 'camera_id', 'batch_number'). The field name is used to organize and categorize metadata values.. | ❌ |
field_value |
str |
Value to assign to the custom metadata field. This is the actual data that will be attached to inference results and can be used for filtering and analysis in the Model Monitoring dashboard. Can be a string literal or a selector that references workflow outputs. Common values: location identifiers (e.g., 'toronto', 'warehouse_a'), quality labels (e.g., 'pass', 'fail', 'review'), identifiers (e.g., camera IDs, batch numbers), or any other contextual information relevant to your use case.. | ✅ |
fire_and_forget |
bool |
Execution mode flag. When True (default), the block runs asynchronously in the background, allowing the workflow to continue processing without waiting for the API call to complete. This provides faster workflow execution but errors are not immediately available. When False, the block runs synchronously and waits for the API call to complete, returning immediate status and error information. Use False for debugging and error handling, True for production workflows where performance is prioritized.. | ✅ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow runtime. See Bindings for more info.
Runtime compatibility¶
-
requires_internet— air-gapped / offline deployments - This block depends on a service that is not reachable from fully offline / air-gapped deployments.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to Roboflow Custom Metadata in version v1.
- inputs:
PLC Writer,Track Class Lock,Byte Tracker,Mask Edge Snap,Path Deviation,VLM As Detector,Object Detection Model,Roboflow Visual Search Classifier,Detections Stabilizer,Qwen3.5-VL,Webhook Sink,VLM As Classifier,Motion Detection,SAM 3 Interactive,Keypoint Detection Model,YOLO-World Model,OC-SORT Tracker,Slack Notification,MoonshotAI Kimi,PLC Reader,Stitch OCR Detections,Instance Segmentation Model,S3 Sink,Keypoint Detection Model,Email Notification,Velocity,BoT-SORT Tracker,Detection Event Log,Single-Label Classification Model,OPC UA Writer Sink,CSV Formatter,Path Deviation,Detection Offset,Qwen-VL,JSON Parser,Bounding Rectangle,Seg Preview,Google Gemini,Roboflow Custom Metadata,LMM For Classification,PP-OCR,SIFT Comparison,Object Detection Model,Local File Sink,Llama 3.2 Vision,SAM3 Video Tracker,Llama 3.2 Vision,Dynamic Zone,SAM2 Video Tracker,Google Vision OCR,Google Gemma API,Detections Filter,Google Gemma,Microsoft SQL Server Sink,Detections Transformation,Identify Changes,Twilio SMS/MMS Notification,OpenAI,Object Detection Model,Keypoint Detection Model,Clip Comparison,OpenAI,Qwen 3.6 API,Instance Segmentation Model,Single-Label Classification Model,Moondream2,Nearest Neighbor Detection Match,OpenAI,Byte Tracker,Instance Segmentation Model,OpenAI-Compatible LLM,Roboflow Visual Search,VLM As Detector,Multi-Label Classification Model,Frame Delay,Roboflow Dataset Upload,OpenAI,Anthropic Claude,Google Gemini,Detections Stitch,Event Writer,Stitch OCR Detections,CogVLM,Time in Zone,VLM As Classifier,Email Notification,Current Time,Template Matching,Mask Area Measurement,Perspective Correction,Detections List Roll-Up,Overlap Filter,Multi-Label Classification Model,Dynamic Crop,OpenRouter,Detections Consensus,OCR Model,Per-Class Confidence Filter,Time in Zone,Time in Zone,Roboflow Asset Library Attributes,Multi-Label Classification Model,LMM,Detections Combine,SIFT Comparison,SAM 3,ByteTrack Tracker,GLM-OCR,EasyOCR,Florence-2 Model,Google Gemini,Roboflow Dataset Upload,Segment Anything 2 Model,Qwen 3.5 API,MoonshotAI Kimi,SAM 3,Line Counter,Instance Segmentation Model,Detections Merge,Google Gemini,Detections Classes Replacement,Model Monitoring Inference Aggregator,Single-Label Classification Model,Roboflow Vision Events,Twilio SMS Notification,Cosmos 3,MQTT Writer,SAM 3,Anthropic Claude,SORT Tracker,Gaze Detection,Anthropic Claude,PTZ Tracking (ONVIF),Florence-2 Model,Identify Outliers,Byte Tracker - outputs:
PLC Writer,Image Blur,Path Deviation,Crop Visualization,Object Detection Model,Polygon Visualization,Roboflow Visual Search Classifier,Qwen3.5-VL,CLIP Embedding Model,Webhook Sink,Motion Detection,SAM 3 Interactive,Keypoint Detection Model,YOLO-World Model,Slack Notification,Label Visualization,MoonshotAI Kimi,Stitch OCR Detections,Label Visualization,Instance Segmentation Model,S3 Sink,Perception Encoder Embedding Model,Email Notification,Keypoint Detection Model,BoT-SORT Tracker,Pixel Color Count,Single-Label Classification Model,OPC UA Writer Sink,Ellipse Visualization,Path Deviation,Corner Visualization,Triangle Visualization,Qwen-VL,Distance Measurement,Camera Calibration,Google Gemini,Seg Preview,Polygon Zone Visualization,Roboflow Custom Metadata,LMM For Classification,SIFT Comparison,Trace Visualization,Object Detection Model,Color Visualization,Local File Sink,Llama 3.2 Vision,SAM3 Video Tracker,Llama 3.2 Vision,Dynamic Zone,Morphological Transformation,Google Vision OCR,Google Gemma API,Google Gemma,Microsoft SQL Server Sink,Polygon Visualization,Icon Visualization,Rich Label Visualization,Twilio SMS/MMS Notification,Keypoint Visualization,OpenAI,Object Detection Model,Keypoint Detection Model,OpenAI,Clip Comparison,Qwen 3.6 API,Instance Segmentation Model,Single-Label Classification Model,Mask Visualization,Moondream2,Nearest Neighbor Detection Match,OpenAI,OpenAI-Compatible LLM,Instance Segmentation Model,Roboflow Visual Search,Stability AI Outpainting,Blur Visualization,Multi-Label Classification Model,Bounding Box Visualization,Roboflow Dataset Upload,Reference Path Visualization,OpenAI,Anthropic Claude,Google Gemini,Detections Stitch,Event Writer,Cache Set,Stitch OCR Detections,CogVLM,Time in Zone,Email Notification,Current Time,Template Matching,Perspective Correction,Halo Visualization,Semantic Segmentation Model,Multi-Label Classification Model,Cache Get,OpenRouter,Dynamic Crop,Detections Consensus,Halo Visualization,Line Counter Visualization,Time in Zone,Time in Zone,Roboflow Asset Library Attributes,Multi-Label Classification Model,Size Measurement,LMM,Depth Estimation,SAM 3,Dot Visualization,GLM-OCR,Florence-2 Model,Background Color Visualization,Google Gemini,Roboflow Dataset Upload,Segment Anything 2 Model,Qwen 3.5 API,MoonshotAI Kimi,Stability AI Inpainting,Contrast Equalization,Morphological Transformation,Image Threshold,SAM 3,Line Counter,Stability AI Image Generation,Instance Segmentation Model,Circle Visualization,QR Code Generator,Google Gemini,Detections Classes Replacement,Roboflow Vision Events,Model Monitoring Inference Aggregator,Single-Label Classification Model,Heatmap Visualization,Twilio SMS Notification,Cosmos 3,Auto Rotate on Edges,MQTT Writer,SAM 3,Anthropic Claude,Image Preprocessing,Gaze Detection,Line Counter,Anthropic Claude,Text Display,Image Stack,PTZ Tracking (ONVIF),Model Comparison Visualization,Florence-2 Model,Classification Label Visualization,Pixelate Visualization
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Roboflow Custom Metadata in version v1 has.
Bindings
-
input
predictions(Union[instance_segmentation_prediction,keypoint_detection_prediction,classification_prediction,object_detection_prediction]): Model predictions (object detection, instance segmentation, keypoint detection, or classification) to attach custom metadata to. The predictions must contain inference IDs that are used to associate metadata with specific inference results in Roboflow Model Monitoring. Inference IDs are automatically extracted from supervision Detections objects or classification prediction dictionaries. The metadata will be attached to all inference IDs found in the predictions..field_value(string): Value to assign to the custom metadata field. This is the actual data that will be attached to inference results and can be used for filtering and analysis in the Model Monitoring dashboard. Can be a string literal or a selector that references workflow outputs. Common values: location identifiers (e.g., 'toronto', 'warehouse_a'), quality labels (e.g., 'pass', 'fail', 'review'), identifiers (e.g., camera IDs, batch numbers), or any other contextual information relevant to your use case..fire_and_forget(boolean): Execution mode flag. When True (default), the block runs asynchronously in the background, allowing the workflow to continue processing without waiting for the API call to complete. This provides faster workflow execution but errors are not immediately available. When False, the block runs synchronously and waits for the API call to complete, returning immediate status and error information. Use False for debugging and error handling, True for production workflows where performance is prioritized..
-
output
Example JSON definition of step Roboflow Custom Metadata in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/roboflow_custom_metadata@v1",
"predictions": "$steps.object_detection.predictions",
"field_name": "location",
"field_value": "toronto",
"fire_and_forget": true
}