Flexible content processing engine - Build intelligent pipelines with 40+ pre-built executors, YAML-based orchestration, and seamless Azure integration.
- 🎯 Overview
- Installation
- 📚 Core Concepts
- 🛠️ Executor Catalog
- 🔗 Data Connectors
- 🏗️ Project Structure
- 💡 Creating Custom Executors
ContentFlow is a Python library for building intelligent content processing pipelines:
- 40+ Pre-Built Executors - PDF, Word, Excel, embeddings, AI analysis, web scraping, and more
- YAML-Based Pipelines - Declarative configuration with conditional routing and parallel execution
- Azure Integration - Seamless connectors for Blob Storage, Search, Document Intelligence, and OpenAI
- Async Processing - Built on asyncio for scalable, non-blocking operations
- Extensible Architecture - Create custom executors and register them in the catalog
# Install from source
cd contentflow-lib
pip install -e .Pipelines are directed acyclic graphs (DAGs) of executors that process content. They are:
- Declaratively defined in YAML with optional Python composition
- Type-safe using Pydantic models
- Event-driven with comprehensive execution tracking
- Composable through sub-pipelines for complex workflows
Pipeline Structure:
pipeline:
name: pipeline_name
description: "Human-readable description"
executors:
- id: executor_id
type: executor_type
settings:
key1: value1
key2: ${ENV_VAR} # Environment variable substitution
edges:
- from: executor_id_1
to: executor_id_2Executors are reusable, configurable processors that operate on Content objects. Each executor:
- Inherits from
BaseExecutor - Implements a
process_input()method with async support - Has a defined settings schema for validation
- Returns modified
Contentwith results in thedatadictionary
Executor Types:
| Category | Examples |
|---|---|
| Input | azure_blob_input_discovery, local_file_reader, web_scraper |
| Extraction | pdf_extractor, azure_document_intelligence_extractor, word_extractor, excel_extractor |
| Processing | recursive_text_chunker, entity_extraction_executor, sentiment_analysis_executor, field_mapper_executor |
| AI/ML | azure_openai_embeddings_executor, azure_openai_agent_executor, content_classifier_executor |
| Output | azure_blob_writer, ai_search_index_uploader |
The Content class is the universal data structure passed through pipelines:
from contentflow.models import Content, ContentIdentifier
content = Content(
id=ContentIdentifier(
canonical_id="unique_canonical_id",
unique_id="unique_id",
source_name="azure_blob",
source_type="pdf",
container="input",
path="documents/file.pdf",
filename="file.pdf",
metadata={"author": "John Doe"}
),
summary_data={}, # High-level summary information
data={}, # Main processing results
executor_logs=[] # Execution history
)Pipelines emit events during execution:
result = await executor.execute(content)
# Check status
print(result.status) # PipelineStatus.COMPLETED
print(result.duration_seconds) # Execution time
# Review events
for event in result.events:
print(f"[{event.timestamp}] {event.executor_id}: {event.event_type}")
print(f" Data: {event.data}")
if event.error:
print(f" Error: {event.error}")ContentFlow includes 40+ pre-built executors organized in executor_catalog.yaml. This catalog defines:
- Executor metadata (name, description, version)
- Configuration schema with validation rules
- UI hints for form generation
- Input/output specifications
Document Extraction:
pdf_extractor- Extract text, images, tables from PDFs (PyMuPDF)azure_document_intelligence_extractor- Advanced extraction with Document Intelligence APIword_extractor- Process Word documentsexcel_extractor- Extract spreadsheet datapowerpoint_extractor- PowerPoint slide extractionazure_blob_input_discovery- List files from Blob Storage
AI & Analysis:
azure_openai_embeddings_executor- Generate vector embeddingsazure_openai_agent_executor- Run agentic workflows with OpenAIazure_content_understanding_extractor- Semantic analysissummarization_executor- Create summariesentity_extraction_executor- NER and entity identificationsentiment_analysis_executor- Sentiment classificationcontent_classifier_executor- Multi-class classification
Text Processing:
recursive_text_chunker- Intelligent text segmentationlanguage_detector_executor- Detect document languagetranslation_executor- Translate contentkeyword_extractor_executor- Extract keywordstable_row_splitter_executor- Convert table rows to documentsfield_mapper_executor- Transform field mappings
Routing & Control:
parallel_executor- Execute multiple paths concurrentlyweb_scraping_executor- Extract web content with Playwrightpass_through- Identity operation (for debugging)
Storage & Output:
azure_blob_writer- Write to Blob Storageai_search_index_writer- Write to Azure AI Search
Connectors provide standardized access to external services. Available connectors:
- AzureBlobConnector - Azure Blob Storage access
- AzureSearchConnector - Azure AI Search integration
- DocumentIntelligenceConnector - Document Intelligence API
Using Connectors:
from contentflow.connectors import AzureBlobConnector
connector = AzureBlobConnector(
name="storage",
settings={
"account_name": os.getenv("STORAGE_ACCOUNT"),
"credential_type": "default_azure_credential"
}
)
# List blobs
async with connector:
blobs = await connector.list_blobs("container", prefix="documents/")contentflow/
├── pipeline/
│ ├── _pipeline.py # Pipeline models
│ ├── _pipeline_executor.py # Executor wrapper
│ └── pipeline_factory.py # Configuration parser
│
├── executors/
│ ├── base.py # BaseExecutor class
│ ├── executor_registry.py # Dynamic loading
│ ├── executor_config.py # Validation
│ └── [40+ implementations]
│
├── connectors/
│ ├── base.py # ConnectorBase class
│ └── [connector implementations]
│
├── models/
│ └── _content.py # Content model
│
├── utils/
│ ├── credential_provider.py # Credential management
│ ├── config_provider.py # Configuration loading
│ └── [utilities]
│
└── executor_catalog.yaml # All executor definitions
Follow the guide Creating Custom Executors in ContentFlow
Contributions are welcome! To create a custom executor or connector:
- Inherit from
BaseExecutororConnectorBase - Implement required methods
- Add to executor catalog or register dynamically
- Write tests in
tests/ - Submit pull request
- Full ContentFlow Project README
- Sample Pipelines
- API Service Guide
- Web Dashboard Guide
- Infrastructure Deployment
- Creating Custom Executors Guide