Buffer¶
Class: BufferBlockV1
Source: inference.core.workflows.core_steps.fusion.buffer.v1.BufferBlockV1
Maintain a sliding window buffer of the last N values by storing recent inputs in a FIFO (First-In-First-Out) queue, with newest elements added to the beginning and oldest elements automatically removed when the buffer exceeds the specified length, enabling temporal data collection, frame history tracking, batch processing preparation, and sliding window analysis workflows.
How This Block Works¶
This block maintains a rolling buffer that stores the most recent values passed to it, creating a sliding window of data over time. The block:
- Receives input data of any type (images, detections, values, etc.) and configuration parameters (buffer length and padding option)
- Maintains an internal buffer that persists across workflow executions:
- Buffer is initialized as an empty list when the block is first created
- Buffer state persists for the lifetime of the workflow execution
- Each buffer block instance maintains its own separate buffer
- Adds new data to the buffer:
- Inserts the newest value at the beginning (index 0) of the buffer array
- Most recent values appear first in the buffer
- Older values are shifted to later positions in the array
- Manages buffer size:
- When buffer length exceeds the specified
lengthparameter, removes the oldest elements - Keeps only the most recent
lengthvalues - Automatically maintains the sliding window size
- Applies optional padding:
- If
padis True: Fills the buffer withNonevalues until it reaches exactlylengthelements - Ensures consistent buffer size even when fewer than
lengthvalues have been received - If
padis False: Buffer size grows from 0 tolengthas values are added, then stays atlength - Returns the buffered array:
- Outputs a list containing the buffered values in order (newest first)
- List length equals
length(if padding enabled) or current buffer size (if padding disabled) - Values are ordered from most recent (index 0) to oldest (last index)
The buffer implements a sliding window pattern where new data enters at the front and old data exits at the back when capacity is reached. This creates a temporal history of recent values, useful for operations that need to look back at previous frames, detections, or measurements. The buffer works with any data type, making it flexible for images, detections, numeric values, or other workflow outputs.
Common Use Cases¶
- Frame History Tracking: Maintain a history of recent video frames for temporal analysis (e.g., track frame sequences, maintain recent image history, collect frames for comparison), enabling temporal frame analysis workflows
- Detection History: Buffer recent detections for trend analysis or comparison (e.g., track detection changes over time, compare current vs previous detections, analyze detection patterns), enabling detection history workflows
- Batch Processing Preparation: Collect multiple values before processing them together (e.g., batch process recent images, aggregate multiple detections, prepare data for batch operations), enabling batch processing workflows
- Sliding Window Analysis: Perform analysis on a rolling window of data (e.g., analyze trends over recent frames, calculate moving averages, detect changes in sequences), enabling sliding window analysis workflows
- Visualization Sequences: Maintain recent data for animation or sequence visualization (e.g., create frame sequences, visualize temporal changes, display recent history), enabling temporal visualization workflows
- Temporal Comparison: Compare current values with recent historical values (e.g., compare current frame with previous frames, detect changes over time, analyze temporal patterns), enabling temporal comparison workflows
Connecting to Other Blocks¶
This block receives data of any type and produces a buffered output array:
- After any block that produces values to buffer (e.g., buffer images from image sources, buffer detections from detection models, buffer values from analytics blocks), enabling data buffering workflows
- Before blocks that process arrays to provide batched or historical data (e.g., process buffered images, analyze detection arrays, work with value sequences), enabling array processing workflows
- Before visualization blocks to display sequences or temporal data (e.g., visualize frame sequences, display detection history, show temporal patterns), enabling temporal visualization workflows
- Before analysis blocks that require historical data (e.g., analyze trends over time, compare current vs historical, process temporal sequences), enabling temporal analysis workflows
- Before aggregation blocks to provide multiple values for aggregation (e.g., aggregate buffered values, process multiple detections, combine recent data), enabling aggregation workflows
- In temporal processing pipelines where maintaining recent history is required (e.g., track changes over time, maintain frame sequences, collect data for temporal analysis), enabling temporal processing workflows
Requirements¶
This block works with any data type (images, detections, values, etc.). The buffer maintains state across workflow executions within the same workflow instance. The length parameter determines the maximum number of values to keep in the buffer. When pad is enabled, the buffer will always return exactly length elements (padded with None if needed). When pad is disabled, the buffer grows from 0 to length elements as values are added, then maintains length elements by removing oldest values. The buffer persists for the lifetime of the workflow execution and resets when the workflow is restarted.
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/buffer@v1to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
length |
int |
Maximum number of elements to keep in the buffer. When the buffer exceeds this length, the oldest elements are automatically removed. Determines the size of the sliding window. Must be greater than 0. Typical values range from 2-10 for frame sequences, or higher for longer histories.. | ❌ |
pad |
bool |
Enable padding to maintain consistent buffer size. If True, the buffer is padded with None values until it reaches exactly length elements, ensuring the output always has length items even when fewer values have been received. If False, the buffer grows from 0 to length as values are added, then maintains length by removing oldest values. Use padding when downstream blocks require a fixed-size array.. |
❌ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow runtime. See Bindings for more info.
Runtime compatibility¶
-
soft— runtimehosted_serverless,dedicated_deployment; executionremote; inputvideo - Block keeps per-video state in process memory (keyed by video_metadata.video_identifier). With remote step execution on stateless or multi-replica HTTP runtimes, successive requests may be served by different worker processes, so the state resets between calls and the output is meaningless for tracking / counting / aggregation. Use local step execution in an InferencePipeline for stable cross-frame results.
-
soft— inputimage - Block depends on temporal context from video or repeated-frame workflows. With a still image/photo, there is no meaningful history to track, compare, aggregate, or visualize, so the block provides little or no benefit.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to Buffer in version v1.
- inputs:
Detections Filter,Absolute Static Crop,VLM As Classifier,Qwen-VL,Gaze Detection,Cache Get,Byte Tracker,Triangle Visualization,EasyOCR,Model Comparison Visualization,Detection Event Log,Stitch OCR Detections,Track Class Lock,YOLO-World Model,OC-SORT Tracker,Llama 3.2 Vision,Anthropic Claude,Heatmap Visualization,Stitch Images,Keypoint Visualization,Webhook Sink,Detections Stabilizer,Continue If,Dominant Color,Google Gemini,MoonshotAI Kimi,GLM-OCR,Instance Segmentation Model,VLM As Detector,QR Code Generator,SAM2 Video Tracker,Multi-Label Classification Model,Twilio SMS/MMS Notification,Line Counter,PLC ModbusTCP,Distance Measurement,Ellipse Visualization,Single-Label Classification Model,SmolVLM2,Keypoint Detection Model,Pixelate Visualization,Detections Transformation,Corner Visualization,Overlap Analysis,Rate Limiter,Switch Case,Buffer,Bounding Rectangle,Template Matching,Llama 3.2 Vision,Qwen2.5-VL,JSON Parser,Qwen 3.5 API,Per-Class Confidence Filter,LMM,Inner Workflow,Velocity,Roboflow Visual Search,Semantic Segmentation Model,OpenAI-Compatible LLM,Morphological Transformation,Color Visualization,Roboflow Dataset Upload,Dimension Collapse,Morphological Transformation,Camera Calibration,Motion Detection,Detection Offset,Google Vision OCR,Clip Comparison,Bounding Box Visualization,OpenAI,Halo Visualization,SAM3 Video Tracker,Object Detection Model,Identify Changes,First Non Empty Or Default,Detections Combine,Contrast Equalization,CSV Formatter,Environment Secrets Store,Mask Area Measurement,Expression,Detections Classes Replacement,Instance Segmentation Model,Model Monitoring Inference Aggregator,Multi-Label Classification Model,MQTT Writer,Cache Set,Delta Filter,PLC Reader,Image Threshold,Blur Visualization,Line Counter Visualization,Google Gemini,Microsoft SQL Server Sink,Single-Label Classification Model,Background Subtraction,VLM As Classifier,Object Detection Model,Identify Outliers,Path Deviation,QR Code Detection,Polygon Zone Visualization,Instance Segmentation Model,SAM 3,Twilio SMS Notification,Google Gemma API,OPC UA Writer Sink,Keypoint Detection Model,Image Stack,Reference Path Visualization,SAM 3 Interactive,Qwen3-VL,Stability AI Inpainting,Multi-Label Classification Model,Perception Encoder Embedding Model,Crop Visualization,Anthropic Claude,Dynamic Zone,Image Convert Grayscale,Camera Focus,Image Slicer,Overlap Filter,Florence-2 Model,Polygon Visualization,Time in Zone,MoonshotAI Kimi,Dynamic Crop,Qwen 3.6 API,Event Writer,Perspective Correction,Segment Anything 2 Model,Line Counter,Polygon Visualization,Clip Comparison,OCR Model,Roboflow Visual Search Classifier,Circle Visualization,Slack Notification,CogVLM,Contrast Enhancement,PLC EthernetIP,Grid Visualization,Mask Edge Snap,Barcode Detection,Byte Tracker,LMM For Classification,Florence-2 Model,OpenAI,Time in Zone,Roboflow Custom Metadata,Local File Sink,SORT Tracker,Image Blur,Label Visualization,ByteTrack Tracker,Qwen3.5-VL,Seg Preview,Path Deviation,Object Detection Model,Anthropic Claude,Cosine Similarity,Pixel Color Count,Roboflow Vision Events,Image Preprocessing,Trace Visualization,Email Notification,SIFT Comparison,Stability AI Outpainting,Detections Consensus,PTZ Tracking (ONVIF),Current Time,Dot Visualization,Roboflow Asset Library Attributes,Keypoint Detection Model,Halo Visualization,SAM 3,Classification Label Visualization,Property Definition,Image Contours,Camera Focus,Single-Label Classification Model,OpenRouter,Data Aggregator,S3 Sink,Stability AI Image Generation,VLM As Detector,CLIP Embedding Model,Relative Static Crop,Roboflow Dataset Upload,Google Gemma,OpenAI,Moondream2,Image Slicer,Detections Merge,Stitch OCR Detections,Google Gemini,BoT-SORT Tracker,Email Notification,Byte Tracker,SAM 3,Detections Stitch,Text Display,Semantic Segmentation Model,Size Measurement,Qwen3.5,Depth Estimation,Icon Visualization,OpenAI,Time in Zone,GeoTag Detection,PLC Writer,SIFT Comparison,SIFT,Instance Segmentation Model,Background Color Visualization,Detections List Roll-Up,Mask Visualization - outputs:
SAM 3,Path Deviation,Polygon Zone Visualization,Instance Segmentation Model,VLM As Classifier,Google Gemma API,Keypoint Detection Model,Qwen-VL,Reference Path Visualization,Triangle Visualization,Crop Visualization,Anthropic Claude,YOLO-World Model,Llama 3.2 Vision,Anthropic Claude,Keypoint Visualization,Webhook Sink,Florence-2 Model,Polygon Visualization,Time in Zone,MoonshotAI Kimi,Qwen 3.6 API,Perspective Correction,Google Gemini,Line Counter,Polygon Visualization,MoonshotAI Kimi,Instance Segmentation Model,VLM As Detector,Clip Comparison,Twilio SMS/MMS Notification,Line Counter,Circle Visualization,PLC EthernetIP,Grid Visualization,Ellipse Visualization,Time in Zone,LMM For Classification,Keypoint Detection Model,Florence-2 Model,Corner Visualization,Buffer,Label Visualization,Llama 3.2 Vision,Seg Preview,Path Deviation,Object Detection Model,Anthropic Claude,Qwen 3.5 API,Trace Visualization,Color Visualization,Roboflow Dataset Upload,Email Notification,Detections Consensus,Keypoint Detection Model,Dot Visualization,Motion Detection,Roboflow Asset Library Attributes,Halo Visualization,SAM 3,Classification Label Visualization,Clip Comparison,Mask Visualization,Bounding Box Visualization,OpenAI,Halo Visualization,SAM3 Video Tracker,OpenRouter,Object Detection Model,VLM As Detector,Google Gemma,Roboflow Dataset Upload,OpenAI,Google Gemini,Detections Classes Replacement,Instance Segmentation Model,Email Notification,SAM 3,Cache Set,PLC Reader,Size Measurement,OpenAI,Line Counter Visualization,Time in Zone,Google Gemini,Instance Segmentation Model,Object Detection Model,Detections List Roll-Up,VLM As Classifier
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Buffer in version v1 has.
Bindings
-
input
data(Union[list_of_values,*,image]): Input data of any type to add to the buffer. Can be images, detections, values, or any other workflow output. Newest values are added to the beginning of the buffer array. The buffer maintains a sliding window of the most recent values..
-
output
output(list_of_values): List of values of any type.
Example JSON definition of step Buffer in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/buffer@v1",
"data": "$steps.visualization",
"length": 5,
"pad": true
}