Skip to content

Ports and data types

Ports define the data a block is allowed to read and publish. Each port has a direction, name, and type. Connections are valid only when the upstream output and downstream input use compatible types.

Supported types

Type Best for Python R
Arrow table Rows and columns, measurements, reportable results input_table / output_table ft_input_table / ft_output_table
JSON Configuration, small structured objects, scalar metadata input_json / output_json ft_input_json / ft_output_json
File Documents, images, CSV, Parquet, and custom artifacts input_file / output_file ft_input_file / ft_output_file

Port names

Valid port names:

rows
sample_measurements
configuration_2
_internal_result

Invalid port names:

sample rows
sample-rows
2nd_input
rows.csv

Port names are case-sensitive. Rows, rows, and ROWS are different names. Use a literal name in every SDK call:

rows = ft.input_table("rows")

Do not construct a port name dynamically. Literal names make the block contract reviewable and allow FlaskTrack to validate generated scripts before they run.

Arrow table ports

Use Arrow table ports for structured datasets. Arrow preserves column names and data types between blocks and is the preferred format for data that should remain available to downstream processing or reporting.

Python receives a pyarrow.Table. R returns a data.frame by default and can return an Arrow table when requested.

JSON ports

Use JSON for relatively small structured values such as thresholds, options, lookup objects, or a processing summary. JSON object keys must be strings.

JSON is not a substitute for large tabular datasets. Use an Arrow table when the value naturally consists of rows and columns.

File ports

Use file ports when the content should remain a file or when a specialized library reads and writes the format. Examples include PDF reports, images, Parquet datasets, CSV exports, sequence files, and instrument-specific formats.

An input file path is read-only. Publish a new file with an output helper rather than modifying the input in place.

One read and one publication per port

A processing script should read every declared input and publish every declared output exactly once. Remove unused ports from the block instead of leaving them unread, and do not publish multiple competing values to one output port.