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:
Cache Set,Roboflow Asset Library Attributes,MoonshotAI Kimi,Path Deviation,Image Blur,SmolVLM2,Keypoint Detection Model,Overlap Filter,SIFT Comparison,Reference Path Visualization,PTZ Tracking (ONVIF),Event Writer,Slack Notification,SAM2 Video Tracker,Halo Visualization,CLIP Embedding Model,Image Stack,VLM As Classifier,Clip Comparison,Google Gemma,Bounding Rectangle,Object Detection Model,Dot Visualization,Qwen 3.6 API,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,Clip Comparison,Camera Focus,OpenAI,Qwen3.5,GLM-OCR,PLC ModbusTCP,Buffer,QR Code Detection,SIFT Comparison,CSV Formatter,Webhook Sink,MQTT Writer,Image Contours,Motion Detection,Local File Sink,Google Gemini,MoonshotAI Kimi,Polygon Visualization,Dimension Collapse,SIFT,Classification Label Visualization,First Non Empty Or Default,Multi-Label Classification Model,Instance Segmentation Model,Keypoint Detection Model,Template Matching,Keypoint Visualization,Instance Segmentation Model,Icon Visualization,Seg Preview,Dynamic Crop,Stability AI Inpainting,Detections Transformation,Bounding Box Visualization,Polygon Zone Visualization,Stability AI Outpainting,Crop Visualization,BoT-SORT Tracker,Multi-Label Classification Model,Continue If,Image Convert Grayscale,Byte Tracker,Mask Visualization,Halo Visualization,Delta Filter,Expression,Detection Offset,Detections Stitch,Distance Measurement,Barcode Detection,SORT Tracker,PLC EthernetIP,Anthropic Claude,Text Display,Morphological Transformation,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,Environment Secrets Store,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,OpenAI,Google Gemma API,Stitch Images,Identify Outliers,Time in Zone,Morphological Transformation,Single-Label Classification Model,EasyOCR,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,LMM,Single-Label Classification Model,Polygon Visualization,Segment Anything 2 Model,Time in Zone,Stability AI Image Generation,Line Counter,Line Counter Visualization,CogVLM,Mask Edge Snap,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,Roboflow Dataset Upload,Qwen 3.5 API,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,Twilio SMS/MMS Notification,Roboflow Vision Events,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 - outputs:
Cache Set,SAM 3,Size Measurement,MoonshotAI Kimi,Roboflow Asset Library Attributes,Circle Visualization,Path Deviation,Path Deviation,Email Notification,Reference Path Visualization,Halo Visualization,VLM As Classifier,Clip Comparison,Qwen 3.6 API,Google Gemma,Object Detection Model,Dot Visualization,SAM 3,Label Visualization,LMM For Classification,Llama 3.2 Vision,Email Notification,Google Gemini,Anthropic Claude,Google Gemma API,Time in Zone,OpenAI,YOLO-World Model,Trace Visualization,Llama 3.2 Vision,Clip Comparison,OpenAI,Detections List Roll-Up,Florence-2 Model,Google Gemini,Corner Visualization,OpenRouter,Buffer,Webhook Sink,SAM 3,Motion Detection,Instance Segmentation Model,Google Gemini,MoonshotAI Kimi,Polygon Visualization,Polygon Visualization,Time in Zone,Classification Label Visualization,Line Counter,Line Counter Visualization,Instance Segmentation Model,Keypoint Detection Model,Grid Visualization,Keypoint Visualization,Anthropic Claude,Instance Segmentation Model,Color Visualization,Seg Preview,Triangle Visualization,Qwen 3.5 API,Roboflow Dataset Upload,Object Detection Model,Bounding Box Visualization,Polygon Zone Visualization,Crop Visualization,OpenAI,Mask Visualization,Halo Visualization,Qwen-VL,Florence-2 Model,Perspective Correction,PLC EthernetIP,Twilio SMS/MMS Notification,Anthropic Claude,Line Counter,VLM As Classifier,Instance Segmentation Model,Roboflow Dataset Upload,VLM As Detector,Detections Consensus,Object Detection Model,Ellipse Visualization,Detections Classes Replacement,VLM As Detector,Keypoint Detection Model,SAM3 Video Tracker,Keypoint Detection Model,Time in Zone
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[image,list_of_values,*]): 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
}