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