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:
Stitch OCR Detections,Twilio SMS/MMS Notification,OPC UA Writer Sink,PP-OCR,Qwen 3.6 API,EasyOCR,Anthropic Claude,CSV Formatter,Llama 3.2 Vision,PLC Writer,Stitch OCR Detections,Roboflow Visual Search Classifier,Single-Label Classification Model,Qwen 3.5 API,Current Time,CogVLM,Google Gemini,MQTT Writer,Google Gemini,OCR Model,GLM-OCR,Qwen-VL,Twilio SMS Notification,Instance Segmentation Model,Google Gemma API,MoonshotAI Kimi,Microsoft SQL Server Sink,VLM As Detector,Florence-2 Model,LMM,Google Vision OCR,Webhook Sink,OpenAI,OpenAI,Florence-2 Model,LMM For Classification,S3 Sink,MoonshotAI Kimi,Anthropic Claude,Roboflow Dataset Upload,Event Writer,OpenAI,Keypoint Detection Model,Google Gemma,Slack Notification,Anthropic Claude,Email Notification,Roboflow Custom Metadata,Roboflow Asset Library Attributes,Multi-Label Classification Model,Model Monitoring Inference Aggregator,Clip Comparison,OpenAI-Compatible LLM,Object Detection Model,VLM As Classifier,Google Gemini,Roboflow Vision Events,Roboflow Visual Search,OpenRouter,Llama 3.2 Vision,Qwen3.5-VL,Local File Sink,Email Notification,OpenAI,Roboflow Dataset Upload - outputs:
Keypoint Visualization,Twilio SMS/MMS Notification,OPC UA Writer Sink,Keypoint Detection Model,Perception Encoder Embedding Model,Qwen 3.6 API,SIFT Comparison,Object Detection Model,SAM 3,Grid Visualization,Llama 3.2 Vision,PLC Writer,JSON Parser,Absolute Static Crop,Distance Measurement,Roboflow Visual Search Classifier,Velocity,Image Threshold,Polygon Zone Visualization,CogVLM,BoT-SORT Tracker,MQTT Writer,Contrast Equalization,Google Gemini,Detections List Roll-Up,GLM-OCR,OCR Model,Background Subtraction,Contrast Enhancement,Reference Path Visualization,Google Gemma API,Instance Segmentation Model,Mask Edge Snap,Twilio SMS Notification,PTZ Tracking (ONVIF),Detections Classes Replacement,Detections Merge,Detections Filter,VLM As Detector,Florence-2 Model,Halo Visualization,SAM 3 Interactive,Dynamic Crop,LMM,Image Blur,Seg Preview,SAM 3,Ellipse Visualization,OpenAI,Florence-2 Model,Byte Tracker,Line Counter,LMM For Classification,Time in Zone,Path Deviation,Instance Segmentation Model,OpenAI,Event Writer,Semantic Segmentation Model,Cache Set,Data Aggregator,Time in Zone,Single-Label Classification Model,Keypoint Detection Model,Google Gemma,Byte Tracker,Buffer,Slack Notification,Heatmap Visualization,Semantic Segmentation Model,SORT Tracker,Email Notification,Circle Visualization,Perspective Correction,Camera Focus,Byte Tracker,Keypoint Detection Model,Detections Consensus,Crop Visualization,Polygon Visualization,Line Counter,ByteTrack Tracker,Multi-Label Classification Model,Detections Combine,Stability AI Inpainting,OpenAI-Compatible LLM,SAM 3,Object Detection Model,VLM As Classifier,PLC ModbusTCP,Google Gemini,Image Slicer,Roboflow Vision Events,Detections Transformation,Multi-Label Classification Model,Size Measurement,Qwen3.5,Local File Sink,Delta Filter,Object Detection Model,Inner Workflow,SAM3 Video Tracker,Dot Visualization,QR Code Detection,Line Counter Visualization,Time in Zone,Instance Segmentation Model,Depth Estimation,Expression,Stitch OCR Detections,PP-OCR,Clip Comparison,Blur Visualization,EasyOCR,Anthropic Claude,PLC EthernetIP,Segment Anything 2 Model,CSV Formatter,Color Visualization,Per-Class Confidence Filter,Qwen3-VL,Qwen2.5-VL,Dynamic Zone,Image Convert Grayscale,Motion Detection,Stitch OCR Detections,Rate Limiter,Single-Label Classification Model,Qwen 3.5 API,Trace Visualization,Icon Visualization,Current Time,Cache Get,PLC Reader,Model Comparison Visualization,Camera Focus,QR Code Generator,Google Gemini,Detections Stitch,Image Stack,Instance Segmentation Model,Qwen-VL,Mask Visualization,MoonshotAI Kimi,Microsoft SQL Server Sink,Text Display,Gaze Detection,Stability AI Image Generation,Continue If,Google Vision OCR,Webhook Sink,OpenAI,VLM As Detector,Identify Outliers,Cosine Similarity,Pixelate Visualization,Stitch Images,Detection Offset,S3 Sink,Classification Label Visualization,Switch Case,MoonshotAI Kimi,Polygon Visualization,Overlap Filter,Anthropic Claude,Dimension Collapse,Roboflow Dataset Upload,Morphological Transformation,Detection Event Log,Bounding Box Visualization,SmolVLM2,Template Matching,VLM As Classifier,Image Contours,Image Slicer,Stability AI Outpainting,Anthropic Claude,Roboflow Custom Metadata,Multi-Label Classification Model,SAM2 Video Tracker,Barcode Detection,Camera Calibration,Roboflow Asset Library Attributes,Morphological Transformation,Detections Stabilizer,Path Deviation,Relative Static Crop,Mask Area Measurement,Background Color Visualization,Model Monitoring Inference Aggregator,Clip Comparison,Corner Visualization,GeoTag Detection,SIFT,Track Class Lock,Dominant Color,Moondream2,Property Definition,Roboflow Visual Search,OpenRouter,Identify Changes,Qwen3.5-VL,Overlap Analysis,Llama 3.2 Vision,Bounding Rectangle,Email Notification,Single-Label Classification Model,CLIP Embedding Model,Triangle Visualization,OpenAI,Roboflow Dataset Upload,Pixel Color Count,OC-SORT Tracker,Image Preprocessing,First Non Empty Or Default,SIFT Comparison,YOLO-World Model,Halo Visualization,Label Visualization
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"
}