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