Manual document sorting is no longer needed
What it does
Automation Document Filing solves two related tasks: it recognizes the file type and sends it to the correct location in the file storage. The AI agent runs on every new document that arrives in the incoming folder or comes as an email attachment. It runs around the clock, without a manual trigger.
What the AI agent does
- Receives a file from the incoming folder of the file storage or mailbox — the trigger fires on the «new file» event.
- Extracts the text layer: OCR for scans and photos, parsing for PDF and DOCX, text as-is for TXT, RTF, EML.
- Classifies the document by type via LLM — contract, invoice, reconciliation act, HR document, commercial proposal, resume, bank statement, power of attorney.
- Extracts key metadata by document type: counterparty, date, number, amount for financial documents; full name, position, certificate type for HR documents.
- Generates a readable file name from a template — for example, «2026-04-24_Договор_ООО-Ромашка_№142.pdf» or «2026-04-24_Счёт_Контур_№СФ-00128.pdf».
- Moves the file to the target folder according to rules defined during setup: /Договоры/2026/Действующие/, /Счета/Входящие/, /Кадры/Документы-сотрудников/Иванов-И-И/.
- Logs the event: who initiated it, what type was recognized, with what confidence, where it was moved, timestamp for audit.
- Notifies the responsible manager when recognition confidence is low or when the document type does not match any of the categories — the file goes to the «For review» folder.
What the automation does not do
- Does not make legal or financial decisions based on the content — only classifies and files, does not sign, does not approve, does not authorize payment.
- Does not verify the correctness of document details: presence of a signature, seal, or compliance with a template. That remains the work of the accountant, lawyer, or quality department.
- Does not replace the business process for approving an incoming document. If a contract must go through a lawyer and a CFO, the approval workflow lives in a separate system, and Document Filing only ensures that the document is where it can be found.
How it works
Document routing is built on a combination of three layers: a file storage trigger, file processing via an LLM agent, and writing the result back to storage. A low-code stack lets you assemble the pipeline in a few days without writing a separate backend service.
Technical flow
- A trigger in a low-code platform or Zapier watches an incoming folder in Google Drive, Dropbox, OneDrive, or S3. When a new file appears, it passes its content to the next step.
- Text extraction step: text extraction is used for PDFs, OCR (Tesseract, Google Vision, AWS Textract) for scans, and DOCX and XLSX parsers for office formats.
- Classification step: the file text is passed to an AI model with a prompt describing the company's document types and the expected JSON response of the form {type, confidence, metadata}.
- Validation step: if confidence is below the set threshold, the file goes to a "For review" folder and a task is created in Slack or Notion.
- Naming step: a new file name is generated from the extracted metadata according to a template defined by the business.
- Moving step: the file is copied to the target folder, and the original is deleted or moved to a "processed" archive.
- Logging step: a record is written to an Airtable, Google Sheets, or Notion table for audit purposes — date, type, counterparty, path, confidence.
Implementation stages
- Week 1 — discovery. We collect the company's list of document types, the current folder structure, naming rules, and current owners. We identify the key types that cover the bulk of the incoming flow.
- Week 2 — prototype. We deploy the orchestrator, connect the file storage, write the classification prompt, and test on a representative sample of real documents.
- Week 3 — rules configuration. We fine-tune name templates, the "type → folder" mapping, confidence thresholds, and exception handling (unrecognized documents, duplicates, empty files).
- Week 4 — pilot and launch. We run it on a live flow with parallel manual oversight in the first days, record discrepancies, and iterate the prompt.
Solution components
Layer | Tool | Task |
|---|---|---|
Orchestration | low-code platform or Zapier | Trigger and step pipeline |
Storage | Google Drive, Dropbox, OneDrive, S3 | Source and target location |
OCR | Google Vision, AWS Textract, Tesseract | Text from scans and photos |
LLM | language model | Classification and metadata extraction |
Log | Airtable, Google Sheets, Notion | Audit and reporting |
Notifications | Slack, email | Escalation of unrecognized files |
Once the pipeline stabilizes, the solution runs in the background, requiring periodic log checks for quality drift — when a new document type appears or a counterparty changes their format.
Prerequisites
Before launching Document Filing, three layers need to be prepared: data, access, and people. Without any one of them, the pilot stalls.
Data and Access
- A file storage with an API — Google Drive, Dropbox, OneDrive, or S3-compatible. Read and write access to the relevant folders.
- An inbox folder where files arrive — either manually from managers, or via email integration, or exported from other systems.
- A list of document types that actually appear in the flow, and the rules for storing them — even if that currently lives in the office manager's head.
- Sample files for each type — several real files to configure the classifier and verify quality at the prototype stage.
- API key for the LLM provider (Anthropic for the AI model) and the OCR service, if scans are in the flow.
- A workflow engine account (self-hosted or cloud) or Zapier with a sufficient operation limit for the expected monthly volume.
Team Readiness
- A process owner — an office manager, operations lead, or lawyer who decides what counts as correct filing.
- An engineer or integrator who will build the pipeline in the workflow engine and write prompts — one mid-level specialist is enough.
- User agreement on changing file paths. If the team is used to filing documents manually, it is important to agree on the new structure before launch, not after.
Timeline
- A weekend-project format: 2-4 weeks from start to production with one engineer at part-time load.
- Week one — discovery and sample collection, week two — prototype, week three — configuration and testing, week four — pilot and launch with parallel manual oversight.
Pain points
- Document chaos
- Repetitive Routine Tasks
FAQ
How long does implementation take?
Document Sorting launches in 2–4 weeks. The first week goes to collecting document types and samples, the second — to a prototype in the orchestrator, the third — to configuring rules and testing on a real sample, the fourth — to a pilot launch with parallel manual review. One engineer at partial capacity handles it without bringing in an outside team.
What should we do if we don't have a unified file storage with an API?
If incoming documents currently sit in email or on a local drive with no single entry point, a file storage must be chosen before launching Document Sorting — Google Drive, Dropbox, OneDrive, or S3 will work. Migration of old files is not required: automation works only with the new flow, and the existing archive stays in place until a separate migration project.
What are the risks of automatic document sorting and what breaks?
The main risk is misclassification of rare or non-standard documents. For such cases, the pipeline sends the file to the "For Review" folder and notifies the responsible person — it does not discard or lose it. The second risk is format changes from counterparties; this is resolved by monitoring confidence and updating the prompt. Data loss is excluded: the original is preserved until successful sorting is confirmed.
Is the solution suitable for our industry?
Document Sorting works universally — anywhere there is an incoming flow of mixed-type files. Direct use cases: law firms (contracts, powers of attorney, court orders), consulting (contracts, client reports, NDAs), professional services and agencies (specifications, acts, invoices). For industries with specific documents — healthcare, logistics, real estate — a separate prompt is configured for the document types.
How accurately does AI classify documents?
Classification quality depends on the sample at the configuration stage. For standard document classes with a prepared prompt, the AI model delivers stable quality on most standard forms. Files with low confidence go to manual review — silent missorting does not occur. After the first month of operation, the prompt is refined based on actual errors, and accuracy improves.
Does this work with scanned and photographed documents?
Yes, scanned documents and photos of contracts are processed through an OCR layer — Google Vision, AWS Textract, or Tesseract for self-hosted setups. Quality depends on the resolution and legibility of the scan; for poorly legible files, the agent immediately sends them to the "For Review" folder. The rule is simple: a document that a person cannot read, AI will not classify either.
Want this in your business?
Book a free audit — we'll show how this automation will work for you.