What tables are for
Use workflow tables when your workflow needs external reference data that should be maintained separately from the workflow graph:- map extracted names to internal IDs
- fuzzy-match vendors, ports, products, or locations
- validate extracted values against an approved list
- enrich extraction results with metadata from a catalog
- keep business rules editable without changing Function block code
Tables are designed for lookup and reference data. They are not a row-by-row
transactional database. To change table contents, upload a replacement CSV.
Data model
A table stores:
Each column has:
CSV upload rules
Create and replace operations accept amultipart/form-data upload with a
file field containing CSV bytes.
Current upload guardrails:
Trailing empty spreadsheet columns are ignored, but unnamed columns with data are
rejected because there is no stable column name to expose downstream.
Schema inference
When you upload a CSV without schema overrides, Retab infers each column’s JSON schema from its non-empty values. Inference recognizes:
If a column contains blanks, the inferred type becomes nullable, for example:
0012345 or 18-digit account numbers from losing precision or formatting.
Schema overrides
You can override inferred column types during create or replace by sending acolumn_schema_overrides multipart form field. The value is a JSON array of
objects with name and json_schema.
- supported base types are
string,integer,number,boolean,object, andarray - nullable schemas must be a single base type plus
null - supported string formats are
date,date-time, andtime - override names must match CSV headers after trimming
- duplicate overrides are rejected
Create a table
UsePOST /v1/tables to create a table from a CSV:
Replace table contents
Tables use a CSV-as-database write model. There are no row, column, or cell mutation endpoints. To change data, replace the full CSV:Update metadata
UsePATCH /v1/tables/{table_id} to rename a table or update metadata. This
does not change rows, columns, cells, or the backing CSV.
Query rows
UsePOST /v1/tables/{table_id}/query to read rows. Queries are read-only.
limit is 500.
Supported filter operators:
Query requests also support:
See Query Table for the full API reference.
Inspect and validate
Use these endpoints to inspect table shape:
Example validation request:
has_errors.
Mount tables in Function blocks
Function blocks can mount workflow tables as CSV files in the sandbox. Use this when code needs to join, search, or fuzzy-match against table data./tmp or /data. The
format field defaults to csv; csv is the supported table mount format for
Function blocks.
Legacy
table_refs configs with mount_path are still normalized, but new
workflow configs should use mounts.tables with path.Function lookup example
Once mounted, the table is just a CSV file. You can useduckdb, pandas, the
standard csv module, or string matching libraries such as rapidfuzz.
Best practices
- Keep tables focused on stable reference data.
- Use clear, unique header names.
- Prefer string schemas for IDs, postal codes, account numbers, and other identifier-like values.
- Validate required columns before relying on a table in production workflows.
- Replace the whole CSV when changing contents, and keep source CSVs in version control when business-critical.
- Keep mounted paths predictable, for example
/tmp/data/carriers.csv. - Use
profileto check null counts and distinct counts after upload.