Ingestion Router
Automate document categorization and storage with this Langflow system that intelligently routes uploaded files to separate knowledge bases based on content analysis, eliminating manual sorting for HR, legal, and business documents.
If the flow preview doesn't load, you can open it in a new tab.
This Langflow flow creates an intelligent document routing and ingestion system that automatically categorizes uploaded files and stores them in separate knowledge bases. Organizations often receive diverse document types that need to be processed differently, and manual sorting becomes time-consuming and error-prone. Langflow provides a visual, code-light approach to building this automation, allowing teams to create sophisticated document workflows without extensive programming.
How it works
This Langflow flow creates an intelligent document routing and ingestion system that automatically categorizes uploaded files and stores them in separate knowledge bases.
The flow starts by reading files through a File component, which can handle various document formats including PDFs, Word documents, images, and text files. These files are then passed to a Smart Router component that uses a language model to automatically categorize the content. The router is configured with two routes: "HR" for resumes and HR-related documents, and "Legal" for contracts and agreements. The language model analyzes each document's content and determines which category it belongs to based on the routing instructions.
Once categorized, the documents follow separate processing paths. Each route feeds into its own Split Text component that breaks the documents into manageable chunks with configurable size and overlap settings. The chunked text is then processed by dedicated Knowledge Ingestion components that store the data in separate knowledge bases - "HR_BASE" for HR documents and "Legal_BASE" for legal documents. Each knowledge base is configured to vectorize the text content for semantic search capabilities while maintaining the original document structure and metadata.
The classification process relies on either a Prompt Template combined with a Language Model or the Structured Output component to extract document types with confidence scores. The routing logic uses conditional components to evaluate classifications and direct documents to appropriate processing branches. Files can be uploaded through the UI, programmatically via the v2 files API, or attached to chat and webhook triggers, with support for files up to 1024 MB in common formats.
Example use cases
• Accounts payable departments can route invoices directly to ERP systems while sending non-invoice documents to review queues using API Request components.
• Recruiting teams can classify resumes versus cover letters and push qualified resumes to applicant tracking systems through HTTP integrations.
• Legal operations can identify contracts and load them into vector stores for clause search and compliance monitoring.
• Support teams can triage attachments like logs versus screenshots and automatically open tickets with appropriate templates using webhook triggers.
• Knowledge management systems can detect reference documents and ingest them for RAG applications while filtering out personal files.
The flow can be extended using additional Langflow components for more sophisticated processing. Teams can add confidence-aware routing by incorporating confidence scores from Structured Output and sending uncertain classifications to human reviewers via Slack integration. Storage options can be customized with S3 uploaders or local file storage, while database logging captures classification results. Multi-step processing chains can trigger secondary flows for OCR, redaction, or document signing workflows. For more complex scenarios, Agent components can replace simple language models to enable dynamic decision-making with access to external tools and APIs.
What you'll do
1.
Run the workflow to process your data
2.
See how data flows through each node
3.
Review and validate the results
What you'll learn
• How to build AI workflows with Langflow
• How to process and analyze data
• How to integrate with external services
Why it matters
Automate document categorization and storage with this Langflow system that intelligently routes uploaded files to separate knowledge bases based on content analysis, eliminating manual sorting for HR, legal, and business documents.
Trending
Email Calendar Integration
Build sophisticated communication and information management systems with Langflow's visual drag-and...
Generate Concise Overviews
Build document summarization workflows in Langflow using visual drag-and-drop components to automati...
Ingestion Router
Automate document categorization and storage with this Langflow system that intelligently routes upl...
Create your first flow
Join thousands of developers accelerating their AI workflows. Start your first Langflow project now.