TableFlow Templates: Define Once, Extract Thousands | TableFlow

Imagine this: You've perfected a document extraction process for your supplier invoices, capturing every field, validating data, and formatting it for your ERP system. Then, your company adds 50 new vendors with slightly different invoice layouts.

With traditional systems, you'd rebuild extraction rules 50 times. With TableFlow's templates, you define it once, and it adapts automatically across all variations.

Templates turn document processing from a tedious task into a scalable, intelligent system that grows with your business.

Why Templates Are a Game-Changer

TableFlow transforms document extraction into adaptive workflows. Instead of hardcoding rules for each format, you define the data structure you need, and AI figures out how to extract it from any layout.

Think of templates as smart blueprints. They define what data matters to your business, while the AI finds it no matter where it appears on the page.

The Old Problem

Before templates, document extraction involved rigid processes:

Each new format required custom development. Layout changes broke rules, and scaling increased complexity.

The Template Solution

Templates flip this model:

One template handles hundreds of layouts, and changes enhance future extractions.

Key Template Components

Template Structure

Each template consists of:

Field Definitions: Your Data Blueprint

Fields represent specific data points to extract. Each field includes:

{
  "name": "Invoice Number",
  "key": "invoice_number",
  "data_type": "string",
  "description": "The unique identifier for this invoice",
  "default_value": "",
  "extraction_guide": {
    "rules": [
      "Look for text containing 'Invoice #', 'INV-', or 'Invoice Number',",
      "Usually found in the top portion of the document"
    ],
    "examples": ["INV-2024-001", "Invoice #12345"]
  },
  "validations": [
    {
      "validate": "not_blank",
      "message": "Invoice number is required",
      "severity": "error"
    },
    {
      "validate": "regex",
      "options": {"pattern": "^(INV-)?[0-9]{4,}"},
      "message": "Invalid invoice number format",
      "severity": "warn"
    }
  ],
  "transformers": ["trim", "uppercase"]
}

Supported data types:

Table Structures: Organizing Complex Data

Templates handle tabular data like line items or transactions:

{
  "name": "Line Items",
  "key": "line_items",
  "description": "Individual items or services on the invoice",
  "columns": [
    {
      "name": "Description",
      "key": "description",
      "data_type": "string",
      "validations": [
        {
          "validate": "not_blank",
          "message": "Item description required",
          "severity": "error"
        }
      ]
    },
    {
      "name": "Quantity",
      "key": "quantity",
      "data_type": "number",
      "validations": [
        {
          "validate": "min",
          "options": {"value": 0.01},
          "message": "Quantity must be positive",
          "severity": "error"
        }
      ]
    },
    {
      "name": "Unit Price",
      "key": "unit_price",
      "data_type": "number",
      "transformers": ["currency"]
    },
    {
      "name": "Total",
      "key": "line_total",
      "data_type": "number",
      "transformers": ["currency"]
    }
  ]
}

Extraction Guides: Teaching AI Your Business Logic

Extraction guides provide natural language instructions to guide AI:

{
  "extraction_guide": {
    "rules": [
      "This is a purchase order document",
      "Vendor information appears in the header section",
      "Look for 'Bill To' or 'Vendor' labels",
      "Line items are in the main table with quantity and price columns"
    ],
    "examples": [
      "Vendor: Acme Corporation",
      "Bill To: John's Hardware Store"
    ]
  }
}

Available Validations

TableFlow supports powerful validation rules:

Transformers: Data Cleanup Made Easy

Transformers automatically clean and format extracted data:

Best Practices

  1. Start Simple: Begin with essential fields and add complexity gradually
  2. Use Extraction Guides: Provide clear rules and examples for better accuracy
  3. Choose the Right AI Model: Different providers excel at different document types
  4. Validate Critical Data: Use error-level validations for must-have fields
  5. Test with Real Documents: Upload sample documents to refine your template
  6. Enable Extraction Editing: For critical workflows, allow manual corrections

Key Takeaways

In Summary: TableFlow templates make document processing faster, smarter, and scalable, transforming how businesses handle document extraction at scale.

Frequently Asked Questions

What are TableFlow templates and how do they work?

What components make up a TableFlow template?

How do extraction guides teach AI business logic?

What validation and transformation options are available?

How do templates scale across different document variations?

About Eric Ciminelli

CTO & Co-Founder at TableFlow. Expert in AI/ML systems, distributed computing, and building enterprise-grade document processing solutions.