Local File Sink¶
Class: LocalFileSinkBlockV1
Source: inference.core.workflows.core_steps.sinks.local_file.v1.LocalFileSinkBlockV1
The Local File Sink block saves workflow data as files on a local file system. It allows users to configure how the data is stored, either:
-
aggregating multiple entries into a single file
-
or saving each entry as a separate file.
This block is useful for logging, data export, or preparing files for subsequent processing.
File Content, File Type and Output Mode¶
content
is expected to be the output from another block producing string values of specific types
denoted by file_type
.
output_mode
set into append_log
will make the block appending single file with consecutive entries
passed to content
input up to max_entries_per_file
. In this mode it is important that
file_type
in append_log
mode
Contrary to separate_files
output mode, append_log
mode may introduce subtle changes into
the structure of the content
to properly append it into existing file, hence setting proper
file_type
is crucial:
-
file_type=json
: inappend_log
mode, the block will create*.jsonl
file in JSON Lines format - for that to be possible, each JSON document will be parsed and dumped to ensure that it will fit into single line. -
file_type=csv
: inappend_log
mode, the block will deduct the first line from the content (making it required for CSV content to always be shipped with header row) of consecutive updates into the content of already created file.
Security considerations
The block has an ability to write to the file system. If you find this unintended in your system,
you can disable the block setting environmental variable ALLOW_WORKFLOW_BLOCKS_ACCESSING_LOCAL_STORAGE=False
in the environment which host Workflows Execution Engine.
If you want to restrict the directory which may be used to write data - set
environmental variable WORKFLOW_BLOCKS_WRITE_DIRECTORY
to the absolute path of directory which you
allow to be used.
Type identifier¶
Use the following identifier in step "type"
field: roboflow_core/local_file_sink@v1
to add the block as
as step in your workflow.
Properties¶
Name | Type | Description | Refs |
---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
file_type |
str |
Type of the file. | ❌ |
output_mode |
str |
Decides how to organise the content of the file. | ❌ |
target_directory |
str |
Target directory. | ✅ |
file_name_prefix |
str |
File name prefix. | ✅ |
max_entries_per_file |
int |
Defines how many datapoints can be appended to a single file. | ✅ |
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 Local File Sink
in version v1
.
- inputs:
Roboflow Custom Metadata
,Local File Sink
,VLM as Classifier
,Florence-2 Model
,Google Vision OCR
,OpenAI
,Model Monitoring Inference Aggregator
,Single-Label Classification Model
,Anthropic Claude
,Email Notification
,LMM
,Multi-Label Classification Model
,Stitch OCR Detections
,OCR Model
,CSV Formatter
,Clip Comparison
,LMM For Classification
,Twilio SMS Notification
,Webhook Sink
,OpenAI
,OpenAI
,CogVLM
,Object Detection Model
,Llama 3.2 Vision
,Roboflow Dataset Upload
,Florence-2 Model
,VLM as Detector
,Instance Segmentation Model
,Keypoint Detection Model
,Google Gemini
,Slack Notification
,Roboflow Dataset Upload
- outputs:
Time in Zone
,OpenAI
,Line Counter
,Line Counter Visualization
,SIFT Comparison
,LMM
,Multi-Label Classification Model
,Model Comparison Visualization
,Line Counter
,Stability AI Image Generation
,Distance Measurement
,Keypoint Detection Model
,Keypoint Detection Model
,YOLO-World Model
,Slack Notification
,Label Visualization
,Image Threshold
,Local File Sink
,Cache Set
,Polygon Visualization
,Pixelate Visualization
,Instance Segmentation Model
,Detections Consensus
,Keypoint Visualization
,Polygon Zone Visualization
,Template Matching
,Stability AI Inpainting
,QR Code Generator
,OpenAI
,Stability AI Outpainting
,Detections Stitch
,Multi-Label Classification Model
,Time in Zone
,Roboflow Dataset Upload
,Blur Visualization
,Color Visualization
,Instance Segmentation Model
,Halo Visualization
,Mask Visualization
,Time in Zone
,Path Deviation
,Background Color Visualization
,Perception Encoder Embedding Model
,Trace Visualization
,Google Vision OCR
,Dot Visualization
,Model Monitoring Inference Aggregator
,Classification Label Visualization
,Email Notification
,Anthropic Claude
,Pixel Color Count
,Object Detection Model
,Dynamic Crop
,LMM For Classification
,Gaze Detection
,CogVLM
,Object Detection Model
,Image Preprocessing
,Circle Visualization
,CLIP Embedding Model
,Florence-2 Model
,PTZ Tracking (ONVIF)
.md),Moondream2
,Roboflow Dataset Upload
,Reference Path Visualization
,Cache Get
,Bounding Box Visualization
,Dynamic Zone
,Roboflow Custom Metadata
,Icon Visualization
,Florence-2 Model
,Path Deviation
,Ellipse Visualization
,Single-Label Classification Model
,Image Blur
,Detections Classes Replacement
,Size Measurement
,Crop Visualization
,Corner Visualization
,Triangle Visualization
,Twilio SMS Notification
,Clip Comparison
,Webhook Sink
,OpenAI
,Single-Label Classification Model
,Llama 3.2 Vision
,Segment Anything 2 Model
,Google Gemini
,Perspective Correction
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Local File Sink
in version v1
has.
Bindings
-
input
-
output
Example JSON definition of step Local File Sink
in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/local_file_sink@v1",
"content": "$steps.csv_formatter.csv_content",
"file_type": "csv",
"output_mode": "append_log",
"target_directory": "some/location",
"file_name_prefix": "my_file",
"max_entries_per_file": 1024
}