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