Skip to main content
The SDK includes pre-built flows for common document processing patterns. These flows handle provider configuration, error handling, and retries out of the box.

VLM Direct Flow

Skip OCR and send documents directly to a Vision Language Model:

Configuration

When to Use

VLM direct is ideal when:
  • Documents have complex visual layouts (tables, forms, charts)
  • Speed is more important than cost
  • OCR might introduce errors (handwritten text, unusual fonts)
VLM direct may not be best when:
  • Documents are text-heavy with simple layouts
  • Cost is a primary concern (vision tokens are more expensive)
  • You need to process very large documents

Output

Multi-Provider Flow

OCR + LLM extraction with automatic provider fallback:

Configuration

Provider Fallback

Providers are tried in order. If one fails after retries, the next is used:
The circuit breaker prevents repeated calls to failing providers:
  • After circuitBreakerThreshold failures, provider is marked “open”
  • Open providers are skipped until reset

Output

Two-Provider Flow

Compare extraction results from two LLM providers:

Use Cases

  • Quality validation: Compare results to detect extraction errors
  • A/B testing: Evaluate provider performance on your documents
  • Consensus: Use matching results as high-confidence extractions

Output

Building Custom Pre-built Flows

Use createFlow() to build your own reusable flows:

Comparing Approaches

Next Steps

Creating Flows

Build your own custom flows

Flow Registry

Register flows for reuse