Cache Get¶
Class: CacheGetBlockV1
Source: inference.core.workflows.core_steps.cache.cache_get.v1.CacheGetBlockV1
Retrieve a previously stored value from an in-memory cache by key, using the image's video identifier as a namespace to enable data sharing between workflow steps, caching intermediate results, and avoiding redundant computations within the same workflow execution context.
How This Block Works¶
This block retrieves values from an in-memory cache that was previously stored using the Cache Set block. The block:
- Receives image and cache key:
- Takes an input image to determine the cache namespace
- Receives a cache key (string) identifying which value to retrieve
- Determines cache namespace:
- Extracts video identifier from the image's video metadata
- Uses the video identifier as the cache namespace (isolates cache entries per video/stream)
- Falls back to "default" namespace if no video identifier is present
- Looks up cached value:
- Accesses the in-memory cache dictionary for the determined namespace
- Searches for the specified key in the cache
- Returns the cached value if found, or False if the key does not exist
- Returns retrieved value:
- Outputs the cached value (can be any data type: strings, numbers, lists, detections, etc.)
- Returns False if the key was not found in the cache
- The output type matches whatever was originally stored with Cache Set
The cache is namespaced by video identifier, meaning different videos or streams have separate cache storage. This allows workflows processing multiple videos to maintain separate caches for each video. The cache is stored in memory and is cleared when the workflow execution completes or when the block is destroyed. Cache Get must be used in conjunction with Cache Set - values are stored with Cache Set and retrieved with Cache Get using the same key and namespace (determined by the same video identifier).
Common Use Cases¶
- Shared State Between Steps: Store intermediate results in one workflow step and retrieve them in another step (e.g., store detection results for later analysis, cache classification predictions for filtering, share metadata between blocks), enabling state sharing workflows
- Avoid Redundant Computations: Cache expensive computation results and reuse them across multiple workflow steps (e.g., cache model predictions, store processed images, reuse transformation results), enabling computation caching workflows
- Video Frame Context: Maintain context across video frames by storing frame-specific data (e.g., cache previous frame detections, store frame sequence metadata, maintain tracking state), enabling frame context workflows
- Conditional Workflow Logic: Store decision results or flags that control workflow execution in subsequent steps (e.g., cache filtering decisions, store validation results, maintain workflow state), enabling conditional execution workflows
- Data Aggregation: Accumulate data across workflow steps by storing values in cache and retrieving/updating them (e.g., aggregate detection counts, accumulate statistics, build result collections), enabling data aggregation workflows
- Temporary Storage: Use cache as temporary storage for values that need to be accessed by multiple workflow steps without passing through the workflow graph (e.g., store cross-step data, maintain temporary state, share non-linear workflow data), enabling temporary storage workflows
Connecting to Other Blocks¶
This block retrieves cached values and can be used throughout workflows:
- After Cache Set block to retrieve values that were previously stored (e.g., retrieve stored detections, get cached predictions, access stored metadata), enabling cache retrieval workflows
- In workflow branches to access shared cache values from parallel or conditional execution paths (e.g., retrieve shared state, access cached results, get common data), enabling branch coordination workflows
- Before blocks that need cached data to provide cached values as input (e.g., provide cached detections to analysis, use cached predictions for filtering, pass cached metadata to processing), enabling cached input workflows
- In conditional logic workflows to retrieve flags or decisions stored by Cache Set (e.g., get cached validation results, retrieve decision flags, access conditional state), enabling conditional logic workflows
- With video processing workflows to maintain frame-specific or video-specific cache namespaces (e.g., retrieve frame context, access video-specific cache, get stream-specific data), enabling video context workflows
- Before output or sink blocks to include cached data in final results (e.g., include cached aggregations, output cached statistics, return cached results), enabling output workflows
Requirements¶
This block requires an input image (used to determine the cache namespace via video identifier) and a cache key (string) to look up the stored value. The block only works in LOCAL execution mode - it will raise a NotImplementedError if used in other execution modes. Values must be previously stored using the Cache Set block with the same key and namespace (same video identifier). The cache is stored in memory and is automatically cleared when the workflow execution completes. The cache is namespaced by video identifier, so different videos have separate cache storage. If a key is not found in the cache, the block returns False. The cached value can be any data type (strings, numbers, lists, detections, images, etc.) depending on what was originally stored.
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/cache_get@v1to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | โ |
key |
str |
Cache key (string) identifying which value to retrieve from the cache. The key must match the key used when storing the value with the Cache Set block. If the key does not exist in the cache, the block returns False. Keys are case-sensitive and must be exact matches. Use descriptive keys to identify different cached values (e.g., 'detections', 'classification_result', 'frame_metadata').. | โ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow runtime. See Bindings for more info.
Runtime compatibility¶
-
hardโ executionremote - Cache blocks only support LOCAL workflow step execution; remote step execution raises NotImplementedError.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to Cache Get in version v1.
- inputs:
Google Gemini,MoonshotAI Kimi,LMM,Single-Label Classification Model,Roboflow Asset Library Attributes,MoonshotAI Kimi,Twilio SMS Notification,CogVLM,Multi-Label Classification Model,Qwen3.5-VL,Keypoint Detection Model,Email Notification,S3 Sink,Stitch OCR Detections,Anthropic Claude,OPC UA Writer Sink,Slack Notification,Event Writer,VLM As Classifier,Google Gemma,Qwen 3.6 API,Roboflow Dataset Upload,Qwen 3.5 API,LMM For Classification,Llama 3.2 Vision,Email Notification,OCR Model,OpenAI,OpenAI-Compatible LLM,Google Gemini,Qwen-VL,Anthropic Claude,Florence-2 Model,OpenAI,Google Gemma API,Twilio SMS/MMS Notification,Anthropic Claude,Roboflow Vision Events,Microsoft SQL Server Sink,EasyOCR,OpenAI,Instance Segmentation Model,Roboflow Dataset Upload,Current Time,Stitch OCR Detections,Llama 3.2 Vision,Roboflow Custom Metadata,Clip Comparison,OpenAI,Florence-2 Model,Google Gemini,Object Detection Model,GLM-OCR,OpenRouter,VLM As Detector,CSV Formatter,Webhook Sink,Model Monitoring Inference Aggregator,MQTT Writer,Google Vision OCR,Local File Sink - outputs:
Cache Set,MoonshotAI Kimi,Roboflow Asset Library Attributes,Path Deviation,Image Blur,SmolVLM2,Keypoint Detection Model,Overlap Filter,PTZ Tracking (ONVIF),SIFT Comparison,Reference Path Visualization,Event Writer,Slack Notification,SAM2 Video Tracker,Halo Visualization,VLM As Classifier,Image Stack,CLIP Embedding Model,Clip Comparison,Qwen 3.6 API,Google Gemma,Object Detection Model,Dot Visualization,Bounding Rectangle,Label Visualization,Background Color Visualization,Llama 3.2 Vision,Email Notification,SAM 3 Interactive,Rate Limiter,Velocity,Pixelate Visualization,OpenAI-Compatible LLM,Qwen3-VL,Google Gemini,JSON Parser,Anthropic Claude,Track Class Lock,Cache Get,OpenAI,Trace Visualization,Llama 3.2 Vision,Detection Event Log,ByteTrack Tracker,OpenAI,Camera Focus,Clip Comparison,Qwen3.5,GLM-OCR,PLC ModbusTCP,Buffer,MQTT Writer,Webhook Sink,SIFT Comparison,CSV Formatter,QR Code Detection,Image Contours,Motion Detection,Local File Sink,Google Gemini,MoonshotAI Kimi,Polygon Visualization,Dimension Collapse,SIFT,Classification Label Visualization,Multi-Label Classification Model,First Non Empty Or Default,Instance Segmentation Model,Keypoint Detection Model,Keypoint Visualization,Template Matching,Instance Segmentation Model,Icon Visualization,Seg Preview,Dynamic Crop,Stability AI Inpainting,BoT-SORT Tracker,Bounding Box Visualization,Stability AI Outpainting,Multi-Label Classification Model,Crop Visualization,Detections Transformation,Polygon Zone Visualization,Continue If,Image Convert Grayscale,Byte Tracker,Mask Visualization,Halo Visualization,Delta Filter,Detections Stitch,Distance Measurement,Detection Offset,SORT Tracker,Barcode Detection,PLC EthernetIP,Expression,Anthropic Claude,Morphological Transformation,Text Display,VLM As Classifier,Inner Workflow,Overlap Analysis,Roboflow Dataset Upload,VLM As Detector,Detections Consensus,Object Detection Model,Detections Filter,Ellipse Visualization,Detections Merge,Keypoint Detection Model,SAM3 Video Tracker,Time in Zone,SAM 3,Size Measurement,Circle Visualization,Semantic Segmentation Model,Path Deviation,Twilio SMS Notification,Email Notification,S3 Sink,Camera Focus,Identify Changes,Byte Tracker,Single-Label Classification Model,SAM 3,Image Slicer,LMM For Classification,Dominant Color,OCR Model,Mask Area Measurement,Heatmap Visualization,Switch Case,Google Gemma API,OpenAI,Stitch Images,Identify Outliers,Time in Zone,Morphological Transformation,EasyOCR,Single-Label Classification Model,YOLO-World Model,Current Time,Blur Visualization,Stitch OCR Detections,Moondream2,Detections List Roll-Up,Florence-2 Model,Google Gemini,Corner Visualization,OpenRouter,Detections Stabilizer,Pixel Color Count,Model Comparison Visualization,SAM 3,Model Monitoring Inference Aggregator,Google Vision OCR,Image Threshold,Byte Tracker,Instance Segmentation Model,Single-Label Classification Model,LMM,Polygon Visualization,Segment Anything 2 Model,Time in Zone,Mask Edge Snap,Line Counter Visualization,Line Counter,CogVLM,Stability AI Image Generation,Relative Static Crop,Qwen3.5-VL,Per-Class Confidence Filter,Grid Visualization,Image Preprocessing,Property Definition,Stitch OCR Detections,Gaze Detection,Anthropic Claude,OPC UA Writer Sink,Color Visualization,Dynamic Zone,Detections Combine,Triangle Visualization,Data Aggregator,QR Code Generator,Qwen 3.5 API,Roboflow Dataset Upload,Absolute Static Crop,Contrast Enhancement,Background Subtraction,Multi-Label Classification Model,OC-SORT Tracker,OpenAI,Image Slicer,Semantic Segmentation Model,Qwen-VL,Florence-2 Model,Perspective Correction,Roboflow Vision Events,Twilio SMS/MMS Notification,Microsoft SQL Server Sink,Cosine Similarity,Perception Encoder Embedding Model,Instance Segmentation Model,Depth Estimation,Roboflow Custom Metadata,Contrast Equalization,Camera Calibration,Detections Classes Replacement,VLM As Detector,Qwen2.5-VL,Line Counter,Object Detection Model
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Cache Get in version v1 has.
Bindings
-
input
image(image): Input image used to determine the cache namespace. The block extracts the video identifier from the image's video metadata and uses it as the cache namespace. If no video identifier is present, the block uses 'default' as the namespace. The namespace isolates cache entries so different videos or streams have separate cache storage. Use the same image (with the same video identifier) for both Cache Set and Cache Get blocks to access the same cache namespace..key(string): Cache key (string) identifying which value to retrieve from the cache. The key must match the key used when storing the value with the Cache Set block. If the key does not exist in the cache, the block returns False. Keys are case-sensitive and must be exact matches. Use descriptive keys to identify different cached values (e.g., 'detections', 'classification_result', 'frame_metadata')..
-
output
output(*): Equivalent of any element.
Example JSON definition of step Cache Get in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/cache_get@v1",
"image": "$inputs.image",
"key": "my_cache_key"
}